Serious issue with charts in MT5!

Hi all, there is a serious issue here.

When I closed my positions, there is no way that I had so much slippage. The spread was not this massive! The account stats work out but the chart does not match the reality at all:



Any advice on how to get more accurate closing levels on the chart?

classicaltrading:

Hi all, there is a serious issue here.

When I closed my positions, there is no way that I had so much slippage. The spread was not this massive! The account stats work out but the chart does not match the reality at all:

Any advice on how to get more accurate closing levels on the chart?

Although your issue of massive spreads appears in MT5, your broker-dealer exclusively controls the specifications of your instruments/symbols.

I should note that I've seen FX/CFD spreads that don't always match the returned value of Spread()─with bucket shop OTC broker-dealers. To programmatically verify the accuracy of the Spread(), calculate the raw bid-ask spread. An old indicator of another coder is attached below. Years ago, I replaced Spread() with the raw bid-ask spread in its code. I also set the default x and y inputs for my high res widescreen monitor, so you might have to reset those.

Based on my experience, there are 9 to 1 odds that you simply need a new broker-dealer.

Files:
Ryan L Johnson #:

Although your issue of massive spreads appears in MT5, your broker-dealer exclusively controls the specifications of your instruments/symbols.

I should note that I've seen FX/CFD spreads that don't always match the returned value of Spread()─with bucket shop OTC broker-dealers. To programmatically verify the accuracy of the Spread(), calculate the raw bid-ask spread. An old indicator of another coder is attached below. Years ago, I replaced Spread() with the raw bid-ask spread in its code. I also set the default x and y inputs for my high res widescreen monitor, so you might have to reset those.

Based on my experience, there are 9 to 1 odds that you simply need a new broker-dealer.

Thank you for your message and suggestions. I am using Pepperstone, which is supposed to be good. 

Also, here is a screenshot which shows the historical spread, not matching the chart:


Thanks also for your indicator, but I'm not familiar with MQL5 coding...

classicaltrading #:

Thank you for your message and suggestions. I am using Pepperstone, which is supposed to be good. 

Also, here is a screenshot which shows the historical spread, not matching the chart...

Thanks also for your indicator, but I'm not familiar with MQL5 coding...

You're welcome.

Just so you know, the indicator in your screenshot displays the current spread as text and the average spread per chart bar as an oscillator. I don't have access to that indicator's source code. Those two facts bring up twp potential issues:

  1. As the bid-ask spread varies with every price tick, and there can be thousands of ticks in one bar, the average spread per bar is a very rough approximation.
  2. If that indicator implements the MQL5 standard Spread() function, it doesn't necessarily verify the raw bid-ask spread─even in the current spread text.
classicaltrading #:

Thank you for your message and suggestions. I am using Pepperstone, which is supposed to be good. 

Also, here is a screenshot which shows the historical spread, not matching the chart:


Thanks also for your indicator, but I'm not familiar with MQL5 coding...

Please show your Journal log file (not a screenshot or an excerpt, the whole file) from this day.
Alain Verleyen #:
Please show your Journal log file (not a screenshot or an excerpt, the whole file) from this day.

Hi, here is another example. Please find below the log as well. This time on Go markets. The previous one was a real account, this is a demo account:




IO    0    11:36:42.844    Network    '273863': terminal synchronized with Go Markets Pty Ltd: 0 positions, 0 orders, 1842 symbols, 0 spreads
PP    0    11:36:42.844    Network    '273863': trading has been enabled, demo account - hedging mode
LG    0    11:36:42.844    Network    '273863': balance management has been disabled - demo account
FE    0    11:36:43.952    Network    '273863': scanning network for access points
ES    0    11:36:59.565    Network    '273863': scanning network finished
DE    0    11:37:16.311    Experts    expert RelicusRoad CopyTrader MT5 (XAUUSD,M1) loaded successfully
LM    0    11:38:09.319    Experts    automated trading is enabled
ME    0    11:39:28.451    Trade    '273863': one click trading has been enabled
LN    0    11:39:30.118    Trades    '273863': market sell 0.5 XAUUSD
LD    0    11:39:30.340    Trades    '273863': accepted market sell 0.5 XAUUSD
HL    0    11:39:30.342    Trades    '273863': deal #35856625 sell 0.5 XAUUSD at 4125.83 done (based on order #43586020)
MN    0    11:39:30.345    Trades    '273863': order #43586020 sell 0.5 / 0.5 XAUUSD at 4125.83 done in 229.059 ms
MJ    0    11:41:11.656    Trades    '273863': market buy 0.5 XAUUSD
IQ    0    11:41:11.888    Trades    '273863': deal #35856669 buy 0.5 XAUUSD at 4132.84 done (based on order #43586067)
HS    0    11:41:11.889    Trades    '273863': accepted market buy 0.5 XAUUSD
MG    0    11:41:11.889    Trades    '273863': order #43586067 buy 0.5 / 0.5 XAUUSD at 4132.84 done in 233.886 ms
MD    0    11:41:20.845    Trades    '273863': market buy 0.5 XAUUSD
GO    0    11:41:21.074    Trades    '273863': accepted market buy 0.5 XAUUSD
FF    0    11:41:21.076    Trades    '273863': deal #35856679 buy 0.5 XAUUSD at 4131.43 done (based on order #43586078)
JM    0    11:41:21.076    Trades    '273863': order #43586078 buy 0.5 / 0.5 XAUUSD at 4131.43 done in 231.288 ms
CM    0    11:48:13.392    MQL5 Market    Start downloading free product 'Execution Caliper Broker Cost Meter'
NP    0    11:48:14.662    MQL5 Market    downloading product 'Execution Caliper Broker Cost Meter' 199.59 Kb
CF    0    11:48:16.303    MQL5 Market    'Execution Caliper Broker Cost Meter' product has been downloaded to 'MQL5\Experts\Market\Execution Caliper Broker Cost Meter.ex5'
IO    0    11:48:25.968    Experts    expert Basket Close Manager (XAUUSD,M1) removed
HF    0    11:48:25.976    Experts    expert Execution Caliper Broker Cost Meter (XAUUSD,M1) loaded successfully
LN    1    14:45:22.626    Network    '273863': connection to GoMarkets-Demo lost
OK    0    14:45:30.407    Network    '273863': authorized on GoMarkets-Demo through Access Server SYD01 (ping: 212.33 ms, build 5830)
KI    0    14:45:30.407    Network    '273863': previous successful authorization performed from 1.128.110.6 on 2026.09.29 04:38:19
DH    0    14:45:31.995    Network    '273863': terminal synchronized with Go Markets Pty Ltd: 3 positions, 0 orders, 1842 symbols, 0 spreads
LD    0    14:45:31.995    Network    '273863': trading has been enabled, demo account - hedging mode
HH    0    14:45:31.995    Network    '273863': balance management has been disabled - demo account
KL    0    14:49:40.012    Trades    '273863': bulk closing of all positions started
EF    0    14:49:40.012    Trades    '273863': close position #43586020 sell 0.5 XAUUSD by position #43586067 buy 0.5 XAUUSD
KH    0    14:49:40.263    Trades    '273863': accepted close position #43586020 sell 0.5 XAUUSD by position #43586067
IE    0    14:49:40.263    Trades    '273863': deal #35859768 buy 0.5 XAUUSD at 4132.84 done (based on order #43589933)
QR    0    14:49:40.264    Trades    '273863': close position #43586020 sell 0.5 XAUUSD by position #43586067 done in 251.344 ms
PM    0    14:49:40.264    Trades    '273863': market sell 0.5 XAUUSD, close #43586078 buy 0.5 XAUUSD 4131.43
LR    0    14:49:40.492    Trades    '273863': accepted market sell 0.5 XAUUSD, close #43586078 buy 0.5 XAUUSD 4131.43
KP    0    14:49:40.493    Trades    '273863': deal #35859770 sell 0.5 XAUUSD at 4126.73 done (based on order #43589934)
FJ    0    14:49:40.493    Trades    '273863': order #43589934 sell 0.5 / 0.5 XAUUSD at 4126.73 done in 229.771 ms
RK    0    14:49:50.418    Experts    expert RelicusRoad CopyTrader MT5 (XAUUSD,M1) removed
QM    0    14:50:02.460    Experts    expert Execution Caliper Broker Cost Meter (XAUUSD,M1) removed
 
classicaltrading #:

Hi, here is another example. Please find below the log as well. This time on Go markets. The previous one was a real account, this is a demo account:




 

This happens whenever I close two opposite positions at the same time, e.g.:


classicaltrading #:

This happens whenever I close two opposite positions at the same time, e.g.:

Looks like your broker-dealer is offsetting your open position with your own open opposing position.

Forum on trading, automated trading systems and testing trading strategies

Serious issue with charts in MT5!

Ryan L Johnson, 2026.09.24 00:48

Based on my experience, there are 9 to 1 odds that you simply need a new broker-dealer.


classicaltrading:

Hi all, there is a serious issue here.

When I closed my positions, there is no way that I had so much slippage. The spread was not this massive! The account stats work out but the chart does not match the reality at all:



Any advice on how to get more accurate closing levels on the chart?

Hi, I think I can see what's happening here, and the good news is that nothing is wrong with your fills. It looks like the Close By mechanism rather than slippage.

Your log shows it: "bulk closing of all positions started", then "close position #43586020 sell 0.5 XAUUSD by position #43586067 buy 0.5". When MT5 bulk-closes a hedged account, it first settles opposite positions against each other (Close By) and only closes the rest at market.

With Close By, the two positions aren't closed at the current market price. They're settled against each other at the opening price of the opposite position:

- sell #43586020 opened at 4125.83
- buy #43586067 opened at 4132.84
- the Close By deal is "buy 0.5 at 4132.84", so the sell is shown closed at the buy's entry price

That's why the chart shows the sell closing about 7 dollars away from the market, which no spread could explain. The result itself is correct, though. That amount (7.01 x 0.5 lot x 100 oz = 350.50) was already locked in at 11:41:11, when the opposite buy was opened while the sell was still running. Close By simply books it. It also explains why your account statistics add up while the chart arrows look off.

Only the third position (#43586078) was closed at market, at 4126.73, and that one reflects the real price at that moment.

Two practical notes:
1. Close By actually works in your favour: the two opposite positions are settled without paying the spread on either leg, whereas closing them separately would cost two spreads.
2. If you'd prefer the chart to show market prices, close the positions one by one instead of using bulk close. The combined result will be the same, or slightly worse because of the extra spreads.

You can confirm it in the History tab: the Close By deal has the direction "out by", and its price matches the opposite position's open price.

Hope this helps!
Tuna is correct. They arrows are plotted such in case of closeby operation which basically is an accounting operation, you also save on commission. Changing broker will not solve it, changing to a normal close is throwing money away. With a simple script it perfectly possible to draw your own arrows from your trading history on chart any way you please.
Enrique Dangeroux #:
Tuna is correct. They arrows are plotted such in case of closeby operation which basically is an accounting operation, you also save on commission. Changing broker will not solve it, changing to a normal close is throwing money away. With a simple script it perfectly possible to draw your own arrows from your trading history on chart any way you please.

I've never heard of closeby... likey because I'm in Netting Land.

What is the effect of closeby in a Hedge account? Is it a complete wash with no spread?