Forum on trading, automated trading systems and testing trading strategies
MT4 didn't close position when TP reached
Fernando Carreiro, 2022.05.24 02:47
There is the Bid price and there is the Ask price, and the difference between the two is the Spread.
- Buy (or Long) positions, open at the Ask price and close at the Bid price.
- Sell (or Short) positions, open at the Bid price and close at the Ask price.
Charts, display the OHLC bars as Bid prices (or Last prices). So, the Take-Profit or the Stop-Loss price for a Sell (short) position will close at the Ask price, which is not shown on the chart. So, even if the low price (bid) has touched or crossed the price level of the Take-Profit, the Ask price may still not have reached it. That is why your position's Take-Profit was not triggered.
Also, please don't link to external sites for your images.
If you can't insert (Alt+I) an image due to low rating, then just attach the image file instead (green icon at the end "+ Attach file").
In the tester, setting the spread is just for simulation. On live trading you can't change the spread.
However, you seem to have ignored the rest of my post. So please pay attention about the ask and bid prices for orders.
There is the Bid price and there is the Ask price, and the difference between the two is the Spread.
- Buy (or Long) positions, open at the Ask price and close at the Bid price.
- Sell (or Short) positions, open at the Bid price and close at the Ask price.
Charts, display the OHLC bars as Bid prices (or Last prices).
In the tester, setting the spread is just for simulation. On live trading you can't change the spread.
However, you seem to have ignored the rest of my post. So please pay attention about the ask and bid prices for orders.
yes, I understand why the prices are not touched, but why changing the spread in the backtest does the results remain the same?
thank you
Show a screenshot of where and how you are changing the spread.
Also, which symbol? Show screenshot of the contract specifications.
Show the log entries for a few of the trades, both buy and sell trades.
Show a screenshot of where and how you are changing the spread.
Also, which symbol? Show screenshot of the contract specifications.
Show the log entries for a few of the trades, both buy and sell trades.
You did not show the log entries I requested. The screenshots of trades does not provide enough information about the current ask and bid prices when the orders were placed.
Please provide log entries for sell and buy orders for two different tests with the spread changed.
You did not show the log entries I requested. The screenshots of trades does not provide enough information about the current ask and bid prices when the orders were placed.
Please provide log entries for sell and buy orders for two different tests with the spread changed.
- 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 have a problem with entry price of trades in my EA. I do it with this code:
But the trades are open with wrong price on the chart, as shown in the attached picture.
I tried to change the spread but nothing changes. Does someone know what's wrong?
Thank you