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..
k = 0
if DayOfWeek = 5 then
k = 1
elsif dayofweek = not 5 then
k = 0
endif
return k
I don’t have this issue. DJI daily on PRTv11.
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.
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:
RETURN Not 5
to see what’s returned.