DooMGuarD: The code below runs perfectly fine in Real and demo account, however in the backtest, first bar (index==0) for all quotes received, this bar in particular, gets the same value for OHLC (equal open price) for CopyRates function. Please tell me, is something wrong in the code, or what the problem.
Name = "Canlde." + IntegerToString(i) + ".Body";
- OHLC should not be equal except on the first tick. (Beyond that, I'm currently, too intoxicated to understand your post).
- Don't use a bar shift as a object name. After the start of the new bar, the name is wrong. Use:
Name = "Canlde." + IntegerToString(Time[i]) + ".Body";
WHRoeder:
- OHLC should not be equal except on the first tick. (Beyond that, I'm currently, too intoxicated to understand your post).
- Don't use a bar shift as a object name. After the start of the new bar, the name is wrong. Use:
ok, nom problmem, but my question is
Why, this code
CopyRates(_Symbol,_Period,0,TotalBars,Rates)
return always in the first bar, only open price for Hihg, Low and close for every tick in backtest for bar index "0"....
Rates[0].open = read open price
Rates[0].High = read open price
Rates[0].low = read open price
Rates[0].close = read open price
in every tick for backtest....
best regards
Charles
No problem for me :
MT4 build 722.
I get the same as the OP
Build 670
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
The code below runs perfectly fine in Real and demo account, however in the backtest, first bar (index==0) for all quotes received, this bar in particular, gets the same value for OHLC (equal open price) for CopyRates function. Please tell me, is something wrong in the code, or what the problem.
Thanks in advance