Download MetaTrader 5
To add comments, please log in or register
Download documentation as one file. It is easy!
cat0l0n
18
cat0l0n 2015.07.05 20:54 

Hi guys,

I'm testing some EAs on strategy tester with stock data and I noticed that whenever the EA buys, it closes the deal at a price 1 cent above the open price of the bar, as I'm running it on open prices only. This does not happen when it sells, as the price of the deal is exactly the open price. I tried running on every tick and the result is the same, EA is always buying at a price 1 cent above the open price of the bar. This error is more evident when working with M1 period, as the EA buys at a price that is higher than high price of the bar, which makes no sense.

I'm using the CTrade class, checked the code, and it seems fine. I tried other EAs and it still gives me buy deals on wrong prices. Does anyone know how to solve it?

Thanks! 

Alain Verleyen
Moderator
30635
Alain Verleyen 2015.07.05 22:42  
cat0l0n:

Hi guys,

I'm testing some EAs on strategy tester with stock data and I noticed that whenever the EA buys, it closes the deal at a price 1 cent above the open price of the bar, as I'm running it on open prices only. This does not happen when it sells, as the price of the deal is exactly the open price. I tried running on every tick and the result is the same, EA is always buying at a price 1 cent above the open price of the bar. This error is more evident when working with M1 period, as the EA buys at a price that is higher than high price of the bar, which makes no sense.

I'm using the CTrade class, checked the code, and it seems fine. I tried other EAs and it still gives me buy deals on wrong prices. Does anyone know how to solve it?

Thanks! 

A SELL is open at bid price and close at ask price. A BUY is open at ask price and close at bid price. All MT4/MT5 charts are build on bid prices.

cat0l0n
18
cat0l0n 2015.07.08 00:09  
Alain Verleyen:

A SELL is open at bid price and close at ask price. A BUY is open at ask price and close at bid price. All MT4/MT5 charts are build on bid prices.

Thanks for your reply!

I think it makes sense now. 

/
To add comments, please log in or register