Hi all,
How do I change this code from daily to hourly please?
#follow @KRose_TDA on twitter for updates to this and other custom scripts
#
#Script below is meant to find stocks breaking above a resistance point in the last 3 days.
#input the length of the lookback for resitance level broken into line 5 default is 15
Input Length = 15;
def price = close;
def HighPrice = fold counter = 2 to length with holder = 0 do if high[counter] > holder then high[counter] else holder;
def trig = if (close[1]<highPrice and close > HighPrice)then 1 else if (close[2]<highPrice and close[1] > HighPrice and close > HighPrice)then 2 else if (close[3]<highPrice and close[2] > HighPrice and close > HighPrice)then 3 else 0;
AddLabel(yes, if trig >0 then "BreakOut "+ trig else " ",Color.PLUM);
AssignBackgroundColor(if trig then color.YELLOW else color.white);
How do I change this code from daily to hourly please?
#follow @KRose_TDA on twitter for updates to this and other custom scripts
#
#Script below is meant to find stocks breaking above a resistance point in the last 3 days.
#input the length of the lookback for resitance level broken into line 5 default is 15
Input Length = 15;
def price = close;
def HighPrice = fold counter = 2 to length with holder = 0 do if high[counter] > holder then high[counter] else holder;
def trig = if (close[1]<highPrice and close > HighPrice)then 1 else if (close[2]<highPrice and close[1] > HighPrice and close > HighPrice)then 2 else if (close[3]<highPrice and close[2] > HighPrice and close > HighPrice)then 3 else 0;
AddLabel(yes, if trig >0 then "BreakOut "+ trig else " ",Color.PLUM);
AssignBackgroundColor(if trig then color.YELLOW else color.white);