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)
The size of your array is wrong . . . the High is correct by chance . . . not by design. I assume you are trying to get the high and low during a day ? why not just use iHigh and iLow and PERIOD_D1 ? or am I misunderstanding ?
dabbler:
Going by the Red and Blue lines drawn on the chart I think the (y-96) is correct . . .
This will probably be closer, but I haven't tried it ...
It is bound to be wrong by ±1 here and there :-)
RaptorUK:
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.
Going by the Red and Blue lines drawn on the chart I think the (y-96) is correct . . .
dabbler:
No, I think the count needs to be 1 days worth= 96 M15 bars.
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.
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)
cisco:
Yes . . . but what are you trying to get ? High and Low for a calendar day or for the last 24 hours ?
(96 BARS in Period_M15 equal 1 day)
RaptorUK:
Yes, but (y-96) is the starting point, not the count ;-)
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 :-)
Yes, but (y-96) is the starting point, not the count ;-)
dabbler:
No, I think the count needs to be 1 days worth= 96 M15 bars.
There are not 96 M15 bars in a day when your broker is GMT+0. If it's Sunday, only 8 bars. Don't hard code numbers.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.
RaptorUK:
why not just use iHigh and iLow and PERIOD_D1 ? or am I misunderstanding ?
If all you want is Hi/Lo then iHigh(D1) will work.
why not just use iHigh and iLow and PERIOD_D1 ? or am I misunderstanding ?
dabbler:
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 :-)
Yep, I agree the count is probably going to be 96 . . . just not sure about the starting point . . . if it is (y-1) then he can use iHigh(NULL, PERIOD_D1, 1) and iLow
(NULL, PERIOD_D1, 1)
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 :-)
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
hi everybody
this is simple code, but i don't understand what's happening.
High[]==> Correct
Low[]==> Wrong
please help me .