how to delay entering / closing trade at certain time

Posted By: happysun

how to delay entering / closing trade at certain time - 05/21/20 22:52

Hello,
My script's BarPeriod=60, so it enters / closes trades on hourly basis. But I have problem entering / closing trades at New York closing time (EST 17:00) as at that time the market is closed for a few seconds and also the spread is very high. How can I delay trade entry / closing at this time (only at this time) for say 1 minutes?
Many thanks
Posted By: Smon

Re: how to delay entering / closing trade at certain time - 05/22/20 04:33

The Parameters you are looking for are BarOffset or FrameOffset!
Posted By: danatrader

Re: how to delay entering / closing trade at certain time - 05/22/20 05:03

Or use BarPeriod = 15; and Timeframe to create 60 Min bars.
Than you can close out early by 15 minutes.
Posted By: happysun

Re: how to delay entering / closing trade at certain time - 05/22/20 09:57

Thank you for the advice! But this way [use BarPeriod = 15; and Timeframe to create 60 Min bars] will effect all my trade entry/close, so all my trades are shifted, but I only want to change the timing for this particular hour: EST 17:00
Posted By: danatrader

Re: how to delay entering / closing trade at certain time - 05/22/20 11:41

Use Tick with a TMF that closes at that time maybe.
Or shift Timezone.
Posted By: ozgur

Re: how to delay entering / closing trade at certain time - 05/22/20 12:20

Maybe try OrderDelay

https://zorro-project.com/manual/en/timewait.htm
Posted By: happysun

Re: how to delay entering / closing trade at certain time - 05/23/20 11:51

Many thanks guys for all your advice. In the end I decide to split my script into 2: one filter out EST 17:00 hour completely and another I use BarPeriod=30 to trade only at EST 16:30 hour. I have tried using TimeFrame to put both feature into one script but the results are not as good. My experience is that there are many surprises in TimeFrame feature and can produce unexpected results, difficult to debug. So two scripts solved my issue.
© 2024 lite-C Forums