| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Indicator calculation?
Hi People
Can anyone have a look at this indicator code, it shows the daily WAIST level. If i code it with this setup the waist is correct double OPEN = iOpen(NULL,1440,1); double CLOSE = iClose(NULL,1440,1); double WAIST = (OPEN + CLOSE)/2; If i code it this way it reads 5 to 10 pips out depending on the previous days range. if(Open[i+1] > YesterdayOpen) YesterdayOpen = Open[i+1]; //---- if(Close[i+1] < YesterdayClose) YesterdayClose=Close[i+1]; if (TimeDay(Time[i])!= TimeDay(Time[i+1])) { WBuffer[i+1] = EMPTY_VALUE; WAIST = ( YesterdayOpen + Close[i+1] ) / 2; I can not see where the problem is - it is probably something real obvious but i just can not see it at present, any help would be greatly appreciated. Now i need to do it the 2nd way so that i can have it showing up on the previous days as a trading history. Here is the code Daily_Waist.mq4 cja Last edited by cja; 02-12-2007 at 08:59 AM. |
|
||||
|
Ok. Well, I have no idea about the logic, but obviously "YesterdayClose" is not of any use whatsoever.... Hmm, let's see... the line
PHP Code:
![]() If I understood your objective correctly, I might suggest you replace the for-loop with the following: PHP Code:
|
|
||||
|
Quote:
|
|
||||
|
Quote:
PHP Code:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculation question? | antone | Setup Questions | 2 | 03-12-2007 01:19 AM |
| Incorrect profit calculation in EA | ccronje | Expert Advisors - Metatrader 4 | 1 | 10-13-2006 03:30 PM |
| Multi timeframe through a shift calculation? | wananohoshi | Indicators - Metatrader 4 | 2 | 08-06-2006 10:02 AM |
| script for pips calculation | Beluck | Tools and utilities | 1 | 01-27-2006 05:40 AM |