Unwanted trades live vs backtest
-
Hi everyone, im at a loss to what ive done wrong here and im hoping someone might be able to take a look and provide some advice. My EA works as it should in backtest but since i have let it run live this week im getting random trades that it isnt supposed to put on in addition to the ones that are expected. Im only trying to trade once a day so i suspect it is something to do with the count of how many trades there has been on a given day. Any help would be much appreciated!
Here is the link and some photos of what im seeing:

-
@that_adam_guy
you are wearing asia session? -
@that_adam_guy no trade block is better at limiting to 1, light pink blocks need to go under a dark for each block, this needs to be in a separate tree because under the no trade of check trade, they won't work. Generally though this is set up how I would do it, so a couple of changes is all you need.
-
@jstap Thanks for this. Ive also noticed that this random trade only seems to happen just after midnight local time but not at the exact same time each day (and some days not at all) so im wondering if this is a coincidence or it has something to do with my local time being a new day? It also doesnt happen if i have a trade still running so keeping to 1 trade at a time seems to be working fine. The trade doesnt even line up with the rules so im very confused?
-
@that_adam_guy I haven't noticed trades doing this, the only thing I can suggest is use a time filter block to prevent trade from and to a certain time.
-
Ok so ive improved the function of the 1 trade per day by adding in a conditon block with a constant set at max 1 trade and have that checking against the variable which gets a number added to it each time a trade occurs then resets at the start of each day.
https://fxdreema.com/shared/uDYZGbXTbOn a day where there is actually a trade it will now block that random trade which is helpful but on days where there is no trade it may still appear so the problem is still there. I must be missing something in the blocks but i have no idea what it is?
Since im asking the platform for highs and lows from a certain time period in the day could i be having some sort of issue with the data coming from the brokers side which is throwing off the ea? Maybe i should run it parallel on a different broker and compare the results?
-
@that_adam_guy You need the for each position block, you dont need the once per tick block on the on tick tab.

-
@jstap thank you for this
-
@jstap I thought of this but it is within the time period I do actually want to trade so I can’t block it out.
-
So the EA is still misbehaving 🤬, it seems to do it at or around 15:00 server time if a trade hasn’t been placed before that (the 1 trade per day blocks it at that point) 15:00 server time is coincidentally 12:00 midnight here. I wonder if my physical day ticking over is somehow doing something to confuse it? It works exactly as expected in backtest.
-
@that_adam_guy Possibly but I don't know.
-
Just an update to anyone who may read this in the future that may have a similar problem. I seem to have solved to the problem by moving the modify variables field out on its own with a Once a Day on timer field. It only needed to get that info once per day and with it getting it repeatedly it either got confused or got a bad bit of data from the broker and it was set off.
-
@that_adam_guy Thank you for sharing that info.