No entry before 11AM Monday

Forums ProRealTime English forum ProOrder support No entry before 11AM Monday

Viewing 10 posts - 1 through 10 (of 10 total)
  • #76284

    Hi,

    I’m have some trouble trying to code no entry between say Saturday 12PM and Monday 11AM.

    At the start of my strategy code.

    Can any assist?

    Thanks

     

     

    #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/.

     

    #76303

    Above added as row 51 to Snippet Library Snippet Link Library

    1 user thanked author for this post.
    #76304

    Hi, 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.

    #76305

    You could just set a flag on or off.

     

    #76309

    Just 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

     

    #76310

    Above also saved to Snippet Library as row 52

    #76312

    Your 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.

     

    #76313

    I think that code marks sense now.

    Thankyou!

    #76314

    You don’t really need the if then else so a shorter version would be:

     

Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login