No Trade on First Friday in Month and on each Thursday afternoon

Forums ProRealTime English forum ProOrder support No Trade on First Friday in Month and on each Thursday afternoon

Viewing 2 posts - 1 through 2 (of 2 total)
  • #13150

    Hello,

    i try to build an Strategy System to trade the sideway Times on Market. So i need a code to avoid trade on the First Friday in Month (NFP Non Farm Payrols) and on each Thursday Afternoon, because there are many news so the market is trendy.

    My Code was:

    IF (CurrentDayofWeek = 5 and Date <= 07 and Hour >= 12) THEN
    …..
    ENDIF

    IF (CurrentDayofWeek = 4 and Hour >= 12) THEN
    …..
    ENDIF

    The second part, it seems, thats runs, but the first part does not run. There the system avoid on every Friday after 12 o`clock a trade. But it should do only on the first Friday in month. I think the Part “and Date <= 07” does not run.

    How can i realise this?

    Thanks.

     

     

    #13152

    Hi,

    “Date” format is year and month and day, so date<=7 wouldn’t do what you want. You probably want to use “day” instead.

    Also, currentdayofweek is litterally the current one, so it wouldn’t work in historic data, you probably want to use dayofweek instead.

    Coding example for singling out the NFP day can be found in the following topic:

    http://www.prorealcode.com/topic/how-to-halt-strategy-during-high-volatility-news/

     

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

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