prevent my system from taking a trade with CurrentDayOfWeek condition

Forums ProRealTime English forum ProOrder support prevent my system from taking a trade with CurrentDayOfWeek condition

Viewing 6 posts - 1 through 6 (of 6 total)
  • #145170

    Hi,

    I’m trying to prevent my system from taking a trade prior to 8pm Sunday night for a system in the US.. to avoid the ASX open. I have added this code however it does not prevent the trade entry.

    I have then included ‘noTradeTimeBlock’ in the buy order requirements. I understand this to say to remain false if the time is between 4pm & 8pm of a Sunday. Is there something incorrect here?

    When backtesting the system, a trade is still taken at 19:10 of a Sunday night, which I’m trying to avoid. I do also have the PRT time settings set to New York UTC +04:00.

    #145182

    Do Not use CURRENTTIME, use either TIME (time when a bar closes)  or OPENTIME (time when a bar opens).

    Try this (not tested):

     

    #145652

    Hi @robertogozzi, thanks for the reply. I tried the code you suggested using ‘OpenTime’ or ‘Time’ and it works but begins to fail when I include the ‘CurrentDayOfWeek=0’. I am trying to avoid the opening of a trade in the hours before the markets open in New York time (8pm).

    So, this works to exclude the trade within the time as below

    but as soon as I add the CurrentDayOfWeek function it begins to fail to remove the trades in the time frame I am trying to avoid.

    So in plain terms, if it is a Sunday and between 2pm and 8pm I want the strategy not to open any trade. So ‘noTradeTimeBlock’ will positive or true only when it is not a Sunday & between 2pm & 8pm.

    I don’t believe the syntax is incorrect but have I then used the ‘CurrentDayOfWeek’ function incorrectly?

    #145655

    Sorry, I incorrectly used CURRENTdayofweek, use OpenDayOfWeek

    o or DayOfWeek, instead.

     

    #145700

    Same results. This really has me puzzled.

    #145710

    TIME or OPENTIME will use your time zone, not NY’s.

    Did you take this into account?

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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