It seems like the functions Highest() and Lowest() are only working for the same chart, but not for other time scales, even if they are specified in the function. Is this correct?
- bug in Highest() & Lowest() need work around
- Peak ? Trough ?
- Trailing Stop depending on the last 3 bars not working
Slawa,
is there a plan to fix this bug?
is there a plan to fix this bug?
Example:
When i use this on M5 chart it gives correct result:
varhigh = High[Highest(NULL,5,MODE_HIGH,4,0)];
When i use this on M15 chart it gives correct result:
varhigh = High[Highest(NULL,15,MODE_HIGH,4,0)];
But I want to pull in different time frame:
When i use this on M5 chart it gives incorrect result (result is for M5 not for M15):
varhigh = High[Highest(NULL,15,MODE_HIGH,4,0)];
This looks like a bug, and I just tested again - does not seem to be fixed?
When i use this on M5 chart it gives correct result:
varhigh = High[Highest(NULL,5,MODE_HIGH,4,0)];
When i use this on M15 chart it gives correct result:
varhigh = High[Highest(NULL,15,MODE_HIGH,4,0)];
But I want to pull in different time frame:
When i use this on M5 chart it gives incorrect result (result is for M5 not for M15):
varhigh = High[Highest(NULL,15,MODE_HIGH,4,0)];
This looks like a bug, and I just tested again - does not seem to be fixed?
Slawa,
I realized what the problem must be. If I want to get Highest() prices from another timeframe, I cannot use High[] to return that price - I need to use iHigh() instead and specify the timeframe there as well. Otherwise it will return the prices from the timeframe on chart currently used.
The correct term for calling let's say highest prices from M15 time frame while running the expert on M5 would be:
varhigh = iHigh(NULL,15,Highest(NULL,15,MODE_HIGH,4,0));
:)
I realized what the problem must be. If I want to get Highest() prices from another timeframe, I cannot use High[] to return that price - I need to use iHigh() instead and specify the timeframe there as well. Otherwise it will return the prices from the timeframe on chart currently used.
The correct term for calling let's say highest prices from M15 time frame while running the expert on M5 would be:
varhigh = iHigh(NULL,15,Highest(NULL,15,MODE_HIGH,4,0));
:)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register