How to close trades at specific day and time?
-
Hi! I would like to ask how can I automatically close trades at specific day and time?
Example: I will trade on August 19, 2024 at 15:45 server time and I would like to close it at August 20, 2024 at 23:30 server time.
What blocks do I need to use, and what should be its connectivity to other blocks?
I can't seem to find a way how to make the expiration option work in the buy now and sell now blocks.
Thank you in advance!
-
@tradingforward23 You can do it this way:

-
@l-andorrà Thank you so much for your reply!
Additional question: is there a way that trades can be managed and closed at next day's 23:30 server time without much human intervention? I mean, there were days that took longer to close (in profit or loss) and swaps can eat up some of the profits that is why I try to limit the swap to only 1 day max. Plus the fact that in my time zone, 23:30 server time is midnight here and I am currently sleeping. I might miss the time to close the trade if I were to do it manually that to systematically implement it on my EA.
I will implement your suggestion and I will observe if this will affect the placement of future trades.
Again, thank you so much for your reply and suggestion. It is greatly appreciated!
-
@l-andorrà Here's an update of what I found out with Expiration Mode on Buy now and Sell now blocks:
I explored the Expiration Option in the Buy now and Sell now block and here's what I did to make it work:
1.) Set the Expiration mode to Custom
2.) Under the Custom Expiration, choose "Value" and under it, choose "Time"
3.) For Time Mode, select "Time Stamp"
4.) For Time Stamp, input your desired time to close the trade
5.) Shift in time, select "Shift Forward"
6.) Depends on you, as for me, I put "1" in the Shift Days to indicate that I want to close the position next day at my predetermined time.
7.) I select "No" for Skip Weekdays for now until I notice something that needs to be adjusted.Positive effect upon implementing this:
It did not interfere with any of my EA's operation especially with executing trades daily at specific time and the closing of trades doesn't need to be adjusted daily and manually which can be a hassle for some traders.
Still, thank you for your suggestion! I appreciate you taking time to help me and giving me great ideas that I can work with in the future.
-
Great to see you made it! Congrats!
