Errors and "deleted trades" in Metatrader

35 views
Skip to first unread message

John Verbrugge

unread,
Oct 14, 2024, 1:37:44 PM10/14/24
to Adaptrade Builder
Hi Mike (or anyone who's using Metatrader),

I have a really nice strategy that Builder created for trading the EUR/USD pair in Forex.  It performs really well in Builder, with good net profit and low drawdown.

When I take the strategy and back-test it in Metatrader, I am getting some strange errors.

The most concerning is that all of the trades that are placed are soon "deleted" so very few of them are able to close, either at a loss or profit.

Below I have the examples from the logs in Metatrader.  Trade #1 is a buy, and then a few milliseconds later, trade #1 is deleted.

I've also attached the screenshot of the chart. 

Clearly I have something not set right - maybe position size?

When I run one of the sample Metatrader strategies that come with Metatrader (such as a MACD strategy), I don't see these same errors, so it's something to do with the strategy or my settings. 

Any direction you can point me would be helpful.  I'm happy to upload the Builder strategy file here if that would be helpful. 

Thank you!

Best,
John

2024.10.14 07:39:38.039 2019.01.02 11:00:00  Adaptrade-001 EURUSD,H1: open #8 sell limit 0.10 EURUSD at 1.16004 ok
2024.10.14 07:39:38.039 2019.01.02 11:00:00  Adaptrade-001 EURUSD,H1: open #7 buy limit 0.10 EURUSD at 1.13601 ok
2024.10.14 07:39:38.039 2019.01.02 11:00:00  Adaptrade-001 EURUSD,H1: delete #6 sell limit 0.10 EURUSD at 1.15009 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 11:00:00  Adaptrade-001 EURUSD,H1: delete #5 buy limit 0.10 EURUSD at 1.13536 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 10:00:00  Adaptrade-001 EURUSD,H1: open #6 sell limit 0.10 EURUSD at 1.15009 ok
2024.10.14 07:39:38.039 2019.01.02 10:00:00  Adaptrade-001 EURUSD,H1: open #5 buy limit 0.10 EURUSD at 1.13536 ok
2024.10.14 07:39:38.039 2019.01.02 10:00:00  Adaptrade-001 EURUSD,H1: delete #4 sell limit 0.10 EURUSD at 1.15288 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 10:00:00  Adaptrade-001 EURUSD,H1: delete #3 buy limit 0.10 EURUSD at 1.13207 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 09:00:00  Adaptrade-001 EURUSD,H1: open #4 sell limit 0.10 EURUSD at 1.15288 ok
2024.10.14 07:39:38.039 2019.01.02 09:00:00  Adaptrade-001 EURUSD,H1: open #3 buy limit 0.10 EURUSD at 1.13207 ok
2024.10.14 07:39:38.039 2019.01.02 09:00:00  Adaptrade-001 EURUSD,H1: delete #2 sell limit 0.10 EURUSD at 1.14904 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 09:00:00  Adaptrade-001 EURUSD,H1: delete #1 buy limit 0.10 EURUSD at 1.13347 sl: 0.00000 tp: 0.00000 ok
2024.10.14 07:39:38.039 2019.01.02 08:00:00  Adaptrade-001 EURUSD,H1: open #2 sell limit 0.10 EURUSD at 1.14904 ok
2024.10.14 07:39:38.039 2019.01.02 08:00:00  Adaptrade-001 EURUSD,H1: open #1 buy limit 0.10 EURUSD at 1.13347 ok
2024.10.14 07:39:37.930 2019.01.01 00:00:00  Adaptrade-001 inputs: EntryPctL=1.0893; NBarExL1=29; LevEntS1=3; NBarEnS2=49; EntFrS=3.6672; NBarExS1=37; StartEquity=10000; PSParam=23.81; RoundPS=1; RoundTo=1; MinSize=10000; SizeLimit=100000;
2024.10.14 07:39:37.711 TestGenerator: there are 17 generating errors
2024.10.14 07:39:34.774 TestGenerator: unmatched data error (low value 1.11542 at 2022.03.31 02:00 is not reached from the least timeframe, low price 1.11559 mismatches)
2024.10.14 07:39:34.774 TestGenerator: unmatched data error (high value 1.11601 at 2022.03.31 01:33 and price 1.11602 mismatched)
2024.10.14 07:39:33.228 TestGenerator: unmatched data error (low value 1.17140 at 2021.03.31 02:00 is not reached from the least timeframe, low price 1.17166 mismatches)
2024.10.14 07:39:33.228 TestGenerator: unmatched data error (low value 1.17151 at 2021.03.31 01:09 and price 1.17140 mismatched)
2024.10.14 07:39:33.228 TestGenerator: unmatched data error (low value 1.17151 at 2021.03.31 01:08 and price 1.17148 mismatched)
2024.10.14 07:39:33.228 TestGenerator: unmatched data error (low value 1.17151 at 2021.03.31 01:07 and price 1.17144 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10236 at 2020.03.31 02:00 is not reached from the least timeframe, low price 1.10330 mismatches)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (high value 1.10537 at 2020.03.31 02:00 is not reached from the least timeframe, high price 1.10501 mismatches)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (high value 1.10555 at 2020.03.31 01:00 is not reached from the least timeframe, high price 1.10544 mismatches)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:37 and price 1.10316 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:36 and price 1.10280 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:35 and price 1.10299 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:34 and price 1.10289 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:28 and price 1.10236 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:18 and price 1.10304 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:03 and price 1.10279 mismatched)
2024.10.14 07:39:31.994 TestGenerator: unmatched data error (low value 1.10363 at 2020.03.31 01:02 and price 1.10254 mismatched)
2024.10.14 07:39:29.010 TestGenerator: current spread 14 used
2024.10.14 07:39:26.761 Expert Adaptrade-001 EURUSD,H1: loaded successfully
EURUSDH1-orders.png

MikeBryant

unread,
Oct 14, 2024, 2:40:33 PM10/14/24
to Adaptrade Builder

To see if it’s related to position sizing, I would change the position sizing to “fixed”. Are you using the “well formed” option for stop and limit orders?

Mike Bryant

Adaptrade Software

John Verbrugge

unread,
Oct 15, 2024, 1:35:33 PM10/15/24
to Adaptrade Builder
Hi Mike,

Thanks for the suggestion.  I did some testing and digging into the details and I found that any time we entered the market with an Enter At Market, the trade was accepted in Metatrader, but Enter At Limit orders  were deleted.  So that's a clue.

As a test, I built a strategy that only allows for Enter at Market, and that strategy worked just fine in Metatrader.  (Not very profitable, but all of the trades went through!)

So, what might be causing the Enter At Limit orders to be rejected by Metatrader?

Thanks again. I appreciate your deep insight into this.

Best,
John

MikeBryant

unread,
Oct 15, 2024, 1:40:31 PM10/15/24
to Adaptrade Builder
You didn't answer my question about the "well-formed" orders option. That's for stop and limit orders. You need to be using that if you're not already.

John Verbrugge

unread,
Oct 16, 2024, 3:25:55 AM10/16/24
to Adaptrade Builder
Hi Mike,

Sorry I forgot to answer that - I attached a screen shot.  Is the "well formed" orders option this dialog box, or somewhere else?

Thank you.

Best,
John
Capture.PNG

MikeBryant

unread,
Oct 16, 2024, 3:34:19 AM10/16/24
to Adaptrade Builder
The "well-formed" option was added in version 4.2, but I don't see it in your image. You should be using 4.2 or newer if you want to make sure your stop and limit orders don't get placed with the prices on the wrong side of the market. Otherwise, you'll have to play with the build settings to minimize that possibility.

John Verbrugge

unread,
Oct 16, 2024, 2:26:33 PM10/16/24
to Adaptrade Builder
Hi Mike, I didn't realize how out of date my Builder version was!  Time to upgrade!  
Thanks for your help, and for pointing that out.  

JV
Reply all
Reply to author
Forward
0 new messages