Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Secs_till_close__Future_looped= if (!Market_Hours_USED) then na else if IsZeroFirstBar then na else
- if (DaysPassed OR !isnan(Secs_till_close__Future_looped[1])) then Secs_till_close__Future_looped[1] else
- fold ST_indx=0 to max_bars_in_day with D_start=0 while D_start==0 do if getvalue(IsNewDay,-ST_indx) and getvalue(Seconds_Till_OPEN,-ST_indx+1)<0 and getvalue(Seconds_Till_CLOSE,-ST_indx+1)>0 then getvalue(Seconds_Till_CLOSE,-ST_indx+1) else getvalue(BarFrameInSeconds,0);
- def Seconds_till_Last_Market_Bar = if (!Market_Hours_USED) then na else if IsZeroFirstBar then na
- else if (Seconds_Till_CLOSE < Secs_till_close__Future_looped) and Seconds_Till_OPEN<0 and Seconds_Till_CLOSE>0 then Seconds_Till_CLOSE
- else if IsNewDay and Seconds_Till_CLOSE[1] >Seconds_till_Last_Market_Bar[1] and Seconds_Till_OPEN<0 and Seconds_Till_CLOSE>0 then Seconds_Till_CLOSE[1] else Seconds_till_Last_Market_Bar[1];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement