something wrong with dayofweek = 5?

Forums ProRealTime English forum ProBuilder support something wrong with dayofweek = 5?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #124729

    Hello, stumbled upon this weird thing.

    When using the following code i get weird results, K = 1 both thursday and friday, but if i use weekday = 1, 2, 3 or 4, i get K =1 only on that spesific day.

    This is true (for me) on any market.

    More wird stuff,

    dayofweek = 1 gives me k=1 on sundays,

    dayofweek = 2 gives me k=1 on mondays

    dayofweek = 3 gives me k=1 on tuesdays

    Dayofweek = 4 gives me k=1 on wedensdays

    dayofweek = 5 gives me k=1 on thursdays and fridays

    Dayofweek = 6 gives me k=0 always

    Dayofweek = 7 gives me k=0 always

     

    Guessing this is because i have weekend on? Still weird they havnt fixed that so sunday = day 6/7 or at elast split thursday and friday..

     

    #124731

    I don’t have this issue. DJI daily on PRTv11.

    #124734

    Can update that the code work in other timeframes, showing k = 1 only on fridays data.. but on daily timeframe it still shows k = 1 on thursday and friday.

    #124735

    I think you’d better use NOT = 5, because you are comparing DayOfWeek with, I guess, 2, since NOT 5 is 2, in binary math:

    5 = 101

    Not 5 = 010 (which is 2)

    or:

    5 = 0101

    Not 5 = 1010 (which is 10)

    I am not sure what kind of comparison PRT make, maybe not just a nibble but the whole byte (which yield 250) , who knows?!

    Or maybe NOT 5 = 0?

    Create this indicator:

    to see what’s returned.

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

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