And now when I run the EA against the demo account chart (or at least the data from it) in strategy tester for the past few days it calculates the above values exactly as it should...
Suggesting the demo charts and backend are using different data, can anyone confirm/deny? Am I missing something?
Show your code if you need coding help.
I don't think it's the code, but...
UpperRange = NormalizeDouble(iHigh(NULL, PERIOD_H1, 1) + (5.0 / multiplier), Digits); LowerRange = NormalizeDouble(iLow(NULL, PERIOD_H1, 1) - (5.0 / multiplier), Digits);
These then get plugged into OrderSend (where multipler is derived from Points)
Also when I run it in strategy tester now (with the past few days data) it works exactly as expected
This is set to run bang on 8am, I did wonder if it executes fast enough to pick the previous Candle (but I wouldn't have thought that was possible) and then that still doesn't reflect the values the orders were set with
I don't think it's the code, but...
These then get plugged into OrderSend (where multipler is derived from Points)
Also when I run it in strategy tester now (with the past few days data) it works exactly as expected
This is set to run bang on 8am, I did wonder if it executes fast enough to pick the previous Candle (but I wouldn't have thought that was possible) and then that still doesn't reflect the values the orders were set with
Of course it's your code. If your chart is other than H1 you need to check for error (4066/4073).
At 8AM, how ? where do you check it's candle 1 that you need ?
Of course it's your code. If your chart is other than H1 you need to check for error (4066/4073).
At 8AM, how ? where do you check it's candle 1 that you need ?
The chart is H1, getting no errors
8am, I'm in London so I just use: if(Hour() == 8) to calculate the Range values, I assume that for Hour() = 8 the previous candle (shift = 1) has to be the 7am one
The code works in Strategy Tester using the Demo Chart
(Also works against TickStory data)
All the code does is take the high and add to it, so if the result is less than the high how can the code be the issue
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've got an EA set up against a demo account (and then uploaded to the MQL VPS service)
It should be using iHigh and iLow based on the first Candle to determine a range and then uses these as SLs (plus a few pts) to set up 2 orders
But as you can see from the picture it seems to be using wrong values (the top red line should be above the high)
Also, it hasn't shifted down even though it slightly looks like it (the high/low difference doesn't match the red-line difference if this was the case) and none of the lower timeframe candle give this values (if you're thinking it if getting the values from a different timeframe)
I do use NormalizeDouble before parsing into OrderSend, which I can see some people have issues with, although this doesn't seem to explain the difference
I can't see where it's gone wrong other than the iHigh/iLow values being wrong in the first place, there's nothing complicated in the code that would do this
Has anyone had issues with iHigh/iLow or aware of anything that would cause this (do perhaps the Demo accounts use and show slightly different charts/values)