No entry before 11AM Monday
Forums › ProRealTime English forum › ProOrder support › No entry before 11AM Monday
- This topic has 9 replies, 4 voices, and was last updated 5 years ago by Vonasi.
-
-
07/19/2018 at 8:12 AM #7628407/19/2018 at 9:34 AM #76292
Here you can find the coding example to use (lines 7 and 10, then 25 and 30) https://www.prorealcode.com/topic/d-i-rsioma-trend-following-on-dax/.
07/19/2018 at 11:00 AM #76303Above added as row 51 to Snippet Library Snippet Link Library
1 user thanked author for this post.
07/19/2018 at 11:19 AM #76304Hi, its not quite what I’m after. I’m running a 24 hour FX strategy, but what I’m finding is it takes trades as soon as the market opens on Monday morning when the spreads are very large and there is a gap. So I Just want it to only take trades from 11AM monday all the way to Friday when the FX markets close.
So what I need is a time range which overlaps into days rather than a time interval per day. Like for example, if the time is between Monday after 11AM to Saturday 11AM then enter the trade.
07/19/2018 at 11:26 AM #76305You could just set a flag on or off.
1234567891011if opentime = 110000 and opendayofweek = 1 thentradeflag = 1endifif opentime = 110000 and opendayofweek = 6 thentradeflag = 0endifif tradeflag and (your entry conditions) thenbuy 1 contract at marketendif07/19/2018 at 11:38 AM #76309Just so I understand exactly what that does –
Does the first part require the system to be on and when it clicks to 11AM on Monday the timeflag = 1
What happens if the system gets shut off mid week and I turn it back on, and hence the time has already passed Monday 11AM will the timeflag still be 1?
And the same goes for Saturday, what if my expiry is on Friday and I only start the system on Sunday, because the time never passed 11am Saturday when the system is onn, is it possible for the timeflag to be 1 on Monday before 11AM given the condition of opentime on the Saturday was never meet?
Thank you
07/19/2018 at 11:39 AM #7631007/19/2018 at 11:56 AM #76312Your strategy will do nothing until the trigger time is hit. I think this will allow you to start your strategy at any time and start trading immediately. Not tested – I suggest graphing tradeflag to check it does what you want it to do.
123456789if (opendayofweek = 6 and opentime < 110000) or (opendayofweek = 1 and opentime >= 110000) or (opendayofweek >= 2 and opendayofweek <= 5) thentradeflag = 1elsetradeflag = 0endifif tradeflag and (your entry conditions) thenbuy 1 contract at marketendif07/19/2018 at 12:06 PM #7631307/19/2018 at 12:13 PM #76314You don’t really need the if then else so a shorter version would be:
12345timeok = (opendayofweek = 6 and opentime < 110000) or (opendayofweek = 1 and opentime >= 110000) or (opendayofweek >= 2 and opendayofweek <= 5) thenif timeok and (your entry conditions) thenbuy 1 contract at marketendif -
AuthorPosts
Find exclusive trading pro-tools on