Add "shift" function to Donchian Channel?

mrmac

New member
Hi, I have a very simple donchian channel indicator and would like to add a "shift" (I think it is called shift) function to it, is this possible please?

Code:
input length_used_for_calc= 10;
input Use_Other_Time_Frame=yes;
input Time_Frame=aggregationPeriod.DAY;
def h= if use_Other_Time_Frame then high(period=time_Frame) else high;
def l= if use_Other_Time_Frame then low(period=time_Frame) else low;
def highline= highest(high,length_used_for_calc);
def lowline= lowest(low,length_used_for_calc);
Plot High_Line= highline;
high_line.setdefaultColor(color.magENTA);
Plot Low_Line=lowline;
low_Line.setdefaultColor(color.magentA);
 
Last edited by a moderator:

Similar threads

Top