(F1) Help : iHighest(...) & iLowest(...)
This will probably be closer, but I haven't tried it ...
int LOWt=0; int HIGHt=0; int y=iBarShift(Symbol(),PERIOD_M15,iTime(Symbol(),PERIOD_D1,1)); LOWt=iLowest(Symbol(),PERIOD_M15,MODE_LOW,96,(y-1)); HIGHt=iHighest(Symbol(),PERIOD_M15,MODE_HIGH,96,(y-1)); Comment("\ny: "+(y)+"\nHigh"+High[HIGHt]+"\nLow"+Low[LOWt]);
It is bound to be wrong by ±1 here and there :-)
And of course it will ONLY work on an M15 chart (since you are using High[] in your comment)
This will probably be closer, but I haven't tried it ...
It is bound to be wrong by ±1 here and there :-)
Going by the Red and Blue lines drawn on the chart I think the (y-96) is correct . . .
No, I think the count needs to be 1 days worth= 96 M15 bars.
okay,
I'm predicting movement value, for example (65 pip).
Now I want to know when price touch in my Forecast. (for back test)
Market maybe move over the my forecast .
(96 BARS in Period_M15 equal 1 day)
(96 BARS in Period_M15 equal 1 day)
Yes, but (y-96) is the starting point, not the count ;-)
No, I think the count needs to be 1 days worth= 96 M15 bars.
datetime now = TimeCurrent(), bod = now - now % 86400, ltd = iTime(NULL,PERIOD_D1, 1); // Last trading day int iBod = iBarShift(NULL,0, bod), iLtd = iBarShift(NULL,0, ltd), nBars = iLtd - iBod + 1, iLL = iLowest( NULL, MODE_LOW, nBars-1, iBod+1), iHH = iHighest(NULL, MODE_HIGH, nBars-1, iBod+1); Comment("High", High[iHH]+"\nLow"+Low[iLL]);Also works on any chart, not just M15.
why not just use iHigh and iLow and PERIOD_D1 ? or am I misunderstanding ?
Ah, yes, but I couldn't be bothered to figure out which day was which, so I expected it to be wrong by ±1 day on the starting point. But I at least got the count right at 96 in my version :-)
hi everybody
this is simple code, but i don't understand what's happening.
High[]==> Correct
Low[]==> Wrong
please help me .