Floating arrows on MT5 Strategy tester chart bug

 

Greetings everyone,

I have recently started testing mt5 for algorithmic trading, however I have noticed that all of the codes I wrote had the same issue in the Strategy Tester - floating arrows;
Arrows displaying buy/sell signals appear to be at an offset from the actual chart regardless of the algorithm I am using, if I recall correctly the offset is at a constant 120 pips from the price on the chart. After copying a code from youtube (by Trading Bot Wizard) I hoped to solve the problem by using a simple 30 line code to just check entries and exits but nothing appears to work. If it helps, I have my account set up for OANDA. The pictures attached below are some screenshot which show the problem, and the code I used (which I belive is irrelevant) is First1.mq5 (again, by Trading Bot Wizard on youtube). 
Thanks for reading this.

 
Luca Martina:

Greetings everyone,

I have recently started testing mt5 for algorithmic trading, however I have noticed that all of the codes I wrote had the same issue in the Strategy Tester - floating arrows;
Arrows displaying buy/sell signals appear to be at an offset from the actual chart regardless of the algorithm I am using, if I recall correctly the offset is at a constant 120 pips from the price on the chart. After copying a code from youtube (by Trading Bot Wizard) I hoped to solve the problem by using a simple 30 line code to just check entries and exits but nothing appears to work. If it helps, I have my account set up for OANDA. The pictures attached below are some screenshot which show the problem, and the code I used (which I belive is irrelevant) is First1.mq5 (again, by Trading Bot Wizard on youtube). 
Thanks for reading this.

I have to say, go ask Trading Bot Wizard.

Your posted source code contains no arrow drawing code. The arrows in your posted screenshots merely mark the points of your MA crossovers─not price.

 
Luca Martina:
Arrows displaying buy/sell signals appear to be at an offset from the actual chart regardless of the algorithm I am using,

For Buy, the Ask price is used, and for Sell, the Bid price is used. Considering that both Buy and Sell prices deviate from the chart, I suspect the chart in your screenshot is based on the Last price.

Check the "Chart mode" in the symbol properties. Or try testing on a symbol whose "Chart mode" is set to "By bid price".


 
Ryan L Johnson #:

I have to say, go ask Trading Bot Wizard.

Your posted source code contains no arrow drawing code. The arrows in your posted screenshots merely mark the points of your MA crossovers─not price.

That is true, however, I have also attempted using some other codes I made and the issue was excactly the same, which prompts me to wonder if there is an automatic arrow drawing option in the mt5 tester. If so, I'd want to disable it, however I have not found anything online. 
 
Vladislav Boyko #:

For Buy, the Ask price is used, and for Sell, the Bid price is used. Considering that both Buy and Sell prices deviate from the chart, I suspect the chart in your screenshot is based on the Last price.

Check the "Chart mode" in the symbol properties. Or try testing on a symbol whose "Chart mode" is set to "By bid price".


It is indeed, however it appears that every symbol available is using the same "by last price" mode; I cannot change it nor make a custom symbol, so I belive it is an OANDA limitation and there isn't much I can do about it.