Ignore sunday bar

Forums ProRealTime English forum ProOrder support Ignore sunday bar

Viewing 8 posts - 16 through 23 (of 23 total)
  • #43224

    It’s currentdayofweek not dayofweek.

    Or am I off track?

    #43227
    AVT

    CurrentDayOfWeek is for the current candle, wheras DayOfWeek can be any candle you specify (like finding out whether the 10th candle before was on a Monday=1 or not)

    #43230

    This seems to be the good one (on Eur/Usd, DAILY, on Dax it still opens trades on Sunday, occasionally):

    The strategy tests Thursday to open a new trade on Friday and Friday (on Sunday BAR) to open a new trade on Monday, if conditions are met.

    1 user thanked author for this post.
    #43244

    When testing daily bar, you should use OpenDayOfWeek

    2 users thanked author for this post.
    #43253

    Still Nicolas, I need to know some (unknown to me) details: “when are DayOfWeek, CurrentDayOfWeek and OpenDayOfWeek best used?”.

    Because, as you can see from the screenshot (EurUsd daily), on Thursday DoW is 5 while the other two are both 4, on Friday all the three retain value 5 and on Monday DoW is 2 while the other two are both 1. It appears that DoW is always one day ahead, but on Friday!  What’s the logic behind this?

     

    2 users thanked author for this post.
    #44256

    Hello robertogozzi,

    take a look a the attached screenshot for this code:

    “CDow” is always referring to the same day which is Friday and not the actual Sunday of the day when I took the screenshots. Trying CDow on a IG Market that actually trades on Sundays did not change the observation.

    Dow” is counting from 1 on Sundays to 5 on Thursday and remains 5 on Friday.

    ODow is working properly.

    I guess this helps to decide which function to use.

    #44259

    The good news is: All three are working fine on the intraday timerframes. The screenshot shows an hourly t-bond futures chart.

    Here currentdayofweek switches to the new day faster. The rest of the day currentdayofweek and opendayofweek are identical,

    #44321

    And I have to correct myself:

    On intraday timeframes currentdayofweek works just the same as on longer timeframes.

    It’s dayofweek that switches to the new day on the first intraday bar. Openday of week waits for the first bar to close, before returning the next day’s value.

    Sorry for the confusion.

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

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