Low since last High
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Thanks,
Something like that I guess (good only if Period() = 60 )
Maximum = iHigh(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_HIGH,10,0)); bin = iHighest(Symbol(),1,MODE_HIGH,10*Period() + TimeMinute(iTime(Symbol(),1,0)),1) ; rbin = iLowest(Symbol(),1,MODE_LOW,bin,0); LowSinceMax = iLow(Symbol(),1,rbin ;
Thanks,
Something like that I guess (good only if Period() = 60 )
as whroeder1 already mention, use M1 chart
int bar = 3600 * 10; // last 10 hours int shiftHighest = iHighest(_Symbol,PERIOD_M1,MODE_HIGH,bar); int shiftLowest = iLowest(_Symbol,PERIOD_M1,MODE_LOW,bar); double high = iHigh(_Symbol,PERIOD_M1,shiftHighest); double low = iLow(_Symbol,PERIOD_M1,shiftLowest); datetime hightime = iTime(_Symbol,PERIOD_M1,shiftHighest); datetime lowtime = iTime(_Symbol,PERIOD_M1,shiftLowest);
Thanks
I guess you meant bar = 60 * 10.
So if I need the Low since the high was hit it would be (following your code)
double shiftLowestsinceHigh = iLowest(Symbol, PERIOD_M1,MODE_LOW,shiftHighest); double LowsinceHigh = iLow(Symbol,PERIOD_M1,shiftLowestsinceHigh);
Hello,
I 'm looking at an expert based on the High over last 10 Bars (H1)
I want to calculate the Low since last High was touched
Here's what I did but the problem is it gives me the Low since a time equal to the beginning of the Bar where the High was hit and what I want is the exact time when the High was hit.
Thanks for looking,