I am using for first time DAYS statement, which in v11 i’have tested returns then number of day, on a standard calendar (365/366 days for year), from Jan 1 1970 to open date of the current bar.
For example, if it returns 120,80 since jan 1 1970 are 120 days and 0,80 days in decimal form.
I think i’ve found a malfunction, i will ask to you to replicate my test, using code i write below and run in daily timeframe in market that work from monday to friday standard business hours, like major european market.
This code calculate delta from what Days returns pointing to current bar (“today”, we are in daily timeframe) and what from previous bar (yesterday in a daily timeframe) and print on the chart.
I notice that delta tuesday on monday is correct 1, and ok until thurdsay on wedsnday, but friday on thurdays the gap i 2 and not 1. Monday on Friday is 2, but i think it should be 3.
I’m a newbie, a maybe i can do mistake. I think thath PRT developer are better than me, but …..
What do you think?
if barindex > 0 then
a = days
b = days[1]
c = a-b
if barindex mod 2 = 0 then
DRAWTEXT("a#a#", barindex, high*1.03)
DRAWTEXT("b#b#", barindex, high*1.02)
DRAWTEXT("c#c#", barindex, high*1.01)
else
DRAWTEXT("a#a#", barindex, low*0.99)
DRAWTEXT("b#b#", barindex, low*0.98)
DRAWTEXT("c#c#", barindex, low*0.95)
endif
endif
return