Closing all trades Friday
-
Hello just like the title indicates, I'm trying to close all trades at Friday 19:50 server time, tried several methods I saw on forum none seem to be working.
https://fxdreema.com/shared/5f4iNjPRd
I would appreciate if someone knows how to in MT5 but please first test it if it works I get so many replies try this and that just wasting my time tbh since this isn't a guessing game.
PS: I did try with those closing blocks on the OnTimer tab still nothing changed -
@raikneroz Not testing this for you mate, but change the pink blocks for a blue close block.
-
@jstap Hey, I tried that still same issue I even did "close losable" and "close profitable" blocks trying to make it work but still nothing, I really don't know why isn't closing trades at that time, the market is not close either sine I know the time it closes and it has no errors on the tester.
-
@raikneroz You need a 'switch on/off' structure on a daily basis like this:
https://fxdreema.com/shared/LHZfs3gvb
In my example trades are closed when some profit/loss is hit. You can do the same at the end of the day.
-
@l-andorrà Hello thanks for the tip, I tried that I still see no changes, I did it like this:
https://fxdreema.com/shared/NvI51SC7b
Maybe I misunderstood what you were trying to say but even me looking at this I really can't get why is it not closing I even tried placing start hour and ending hour the same still nothing changed any hints?
-
@raikneroz The bclock that should be turned ON/OFF is block number 10, not block number 19.
-
@l-andorrà Thanks for the response, but nothing changed still, I'm just going to let it run over the weekends the time filters on fxdreema for closing do not work properly not sure why if the open ones work I tried over 150 combinations of several flags, time filters, events, turn on/off blocks, even conditions.
None of it works with targeting specific time to close trades also I get no errors on tester to even know the problem.
That left connected blocks on the picture works for closing trades problem is the conditions is the indicator signals which I don't wanna use indicator signals for closure I simply want to close trades 23:55 Server time which is 2 minutes before my broker closes for the weekend.
-
@raikneroz said in Closing all trades Friday:
Hello just like the title indicates, I'm trying to close all trades at Friday 19:50 server time, tried several methods I saw on forum none seem to be working.
https://fxdreema.com/shared/5f4iNjPRd
I would appreciate if someone knows how to in MT5 but please first test it if it works I get so many replies try this and that just wasting my time tbh since this isn't a guessing game.
PS: I did try with those closing blocks on the OnTimer tab still nothing changedI backtested your project as is, for me it works.

-
@ambrogio Hi, well for me it does not I used H4 and H1 TF's and the only thing you see is TP or SL there's no empty spaces that indicate an exit or change in profit value.
-

Do it this way, the way you were doing it was too complicated for such a simple thing.On Friday at a specific time, close all trades. Thats what you said, thats what this does.
It takes it a step further in logic, you can not use the same minute to specify time for starters....if there are problems with time for some reason, you can put expiration on 'today' with the buy and sell blocks, so that you ensure things are closing at the end of the day. Remove that if you don't want to get rid of nightly holdover for trades.
-
@raikneroz as i told you your project (initial project) works as is, look at the "operation" tab not the "trade" or "history" tab. You can also place trades without stop loss and take profit, you will see that on Friday at 19.50 all trades will be closed. Don't overcomplicate a simple step with all those "turn on" and "turn off" blocks, it's a waste of time.

-
@raikneroz Hello
I want my trades closed when my account lost 4%
Thank you for helping me -
@tipsywisdom Hello thanks for the tips, so I tried that hmm it works if I put "expiration on today'" it closes trades just not on Friday since market is closed at 00:00.
https://fxdreema.com/shared/3c20zmP7c
What would you suggest to make it close Friday only at the time I have on that link, I also tried to change time on buy and sell for that time also but saw no change, what's funny about this this is a simply thing and I'm experiencing so much trouble.

-
@ambrogio Hi, I have no trades closed at 19:50 like it appears on yours only 19:00 I checked every trade, by either TP or SL, I do not trade without TP and SL in any of my trades my ea places TP and SL right on the start of the trade so that would be impossible, I know it's not closing because there's no empty space on comment because I usually have buy or sell there if it's empty it closed because I also look at the result and it's a different profit from usual trades that TP and SL.

Might work on your MT5 but on mine that result does not appear either we use different testing methods might be also. I simply use H4 or H1 with open prices.
-
@pour66 Hmm can't really help you with that I'm having problems closing trades over here xd, hopefully if this can be sorted it serves as template for others to use it for their close trades at certain times.
-
@raikneroz said in Closing all trades Friday:
@ambrogio Hi, I have no trades closed at 19:50 like it appears on yours only 19:00 I checked every trade, by either TP or SL, I do not trade without TP and SL in any of my trades my ea places TP and SL right on the start of the trade so that would be impossible, I know it's not closing because there's no empty space on comment because I usually have buy or sell there if it's empty it closed because I also look at the result and it's a different profit from usual trades that TP and SL.

<<<<<<<<<<<<<< I simply use H4 or H1 with open prices.>>>>>>>>>>>>>>>
here's the problem, if you run a backtest based on the open price, you will get no action within the candle. You should test on every ticks, better with real ticks.
-
@ambrogio hmm I see, well I won't test any other method my open prices work on live accounts, for what doing it's good I have no need to use more precision since I also use M1 data not tick data, but thanks for the insight I need to figure out an alternative if there's none I will just leave it over the weekend been one week almost I am trying to fix this.
-
@raikneroz said in Closing all trades Friday:
@ambrogio hmm I see, well I won't test any other method my open prices work on live accounts, for what doing it's good I have no need to use more precision since I also use M1 data not tick data, but thanks for the insight I need to figure out an alternative if there's none I will just leave it over the weekend been one week almost I am trying to fix this.
Of course your starting project works in real, but answering to your topic you will not see closing trades at a certain time in case you backtest with open price method. Hope that is clear.
-
@ambrogio Yeah it kinda sucks not be able to close it since the demos testing I did compensated to close before Friday, but it is what it is I also can't figure out any way around it unless I change the testing method which is a big no for me right now, well I guess I could always manually close it but that would be different from the backtest results which I trusted in the first place to work.
-
@raikneroz Ok, anyway i suggest you to run always the real ticks based backtest, it is the most accurate. Backtesting based on open price method is not reliable at all.
