A remark also said to split out the closing of the trades from the rest. So here below the left setup is better than the right one?

A remark also said to split out the closing of the trades from the rest. So here below the left setup is better than the right one?

@ambrogio When I tried the hours filter it gave me the same results but then I realised I was using the backtester on visual mode at the settings "control point" instead of every tick because that takes way too long.
So I tried with visual mode off and with setting "every tick" and now it closes on the right candle.
I still find that odd because on the control points settings it jumps 20 minutes every time and my hours settings are 23:30 - 23:59. So I would think that when it jumps from 23:20 to 23:40 it should close the trade at 23:40 because at that time the price is below the MA... But it doesn't and I also noticed that on this mode it doesn't pick up on certain trades that it should be entering.
So the problem of the trades not losing is solved but now I wonder, is there no way to be able to analyse your trades on chart without the slow "every tick" option in visual mode?
Thanks!
@ambrogio Yes but I only want to close out the trades when the condition is met during the timestamp set in the filter above.
Because price can drop below and bounce back above the MA during the day but I dont want the trades to be closed then. Only when price is still below the MA just before the close of the candle.
If I remove those links wont they be closed out immediately on the cross below the MA?
Thanks already for all the help!
@trader-philipps Sorry for my noob questions but what is a pass block or how does it look like?
Hi all,
For my EA I'm trying to implement a rule where my trades are closed when the price crosses my moving average. As you can see below the trade is only closed the candle after the crossover:

These are my settings:

The strange this is that sometimes it does work like here FE:

Perhaps important to mention is that I have a condition where my EA only runs once per day with these settings:

I have also tried this option but then it doesn't close my trades at all.

This is an overview of how my EA is strucutred, perhaps my problem is in the structure?

Thanks for all the help you gave me already!
Cheers!
@trader-philipps DiDi.mq4 is my EA. The suggestion from @Fabien-S worked, thanks a lot!
Hi all,
My EA gives the error below:

I already read some threads handling this problem but I can't find a solution for my settings:

I read that this problem is because when SL is 0, but I can't understand how this is possible when as you can see my SL is 1.5 x ATR value. The ATR value can never be 0 imo.
Any ideas about how to solve this? This is a vital part of my system that I can't change.
All help is much appreciated!
Cheers
@hadees
Thanks for the info. So i guess I can use that in combination with the "run once per candle"?
And do you know if this will work in the MT4 backtester?
Cheers
Hi everyone,
I'm new here and new in creating ea's.
For my system it is important that the ea only runs once 20 minutes before NY closing time. I see the "once per candle option" but I cant enter the specific time there. How can I do this and will it also work when I try to backtest this in MT4? Or is the MT4 backtester not using time and only ticks?
Thanks in advance guys!
Cheers