MT4 Backtesting Problem, Buys and Sells not within bar range
jsinger0422: I'm trying to backtest an ea for a single indicator on the 15 minute time frame. I can run the backtest with 90% modeling quality, but the results are inaccurate. When I open the chart to view the trades made, there are many buys and sells that were triggered by a price not within the range of the bar. I cannot figure out how to fix this. I downloaded the historical data from MT4 starting from the 1-minute to get accurate prices. It is a regular occurrence on every backtest.
It is called "spread"! There is a Ask price and a Bid price. Charts only shows the bars/candles based on Bid prices.
- A "buy" position opens at the Ask price and closes at the Bid price.
- A "sell" position opens at the Bid price and closes at the Ask price.
Also read the following ... Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
- book.mql4.com
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
Fernando Carreiro #:
Thanks fernando. That explains it
It is called "spread"! There is a Ask price and a Bid price. Charts only shows the bars/candles based on Bid prices.
- A "buy" position opens at the Ask price and closes at the Bid price.
- A "sell" position opens at the Bid price and closes at the Ask price.
I'm trying to backtest an ea for a single indicator on the 15 minute time frame. I can run the backtest with 90% modeling quality, but the results are inaccurate. When I open the chart to view the trades made, there are many buys and sells that were triggered by a price not within the range of the bar. I cannot figure out how to fix this. I downloaded the historical data from MT4 starting from the 1-minute to get accurate prices.
It is a regular occurrence on every backtest.