Glif Trend Channel

Platform
  1. Thinkorswim
  2. TradingView
May I please have help to convert this indicator from tradingview to thinkscript? Thank you

Code:
//@version=4
study("Glif Trend Channel", overlay=true)

channel_shortterm_up=ema(high,25)
channel_shortterm_down=ema(low,25)

channel_longterm_up=ema(high,90)
channel_longterm_down=ema(low,90)

channel_shortterm_up_plot=plot(channel_shortterm_up, title="shortterm_up", color=color.green)
channel_shortterm_down_plot=plot(channel_shortterm_down, title="shortterm_down", color=color.green)

channel_longterm_up_plot=plot(channel_longterm_up, title="longterm_up", color=color.red)
channel_longterm_down_plot=plot(channel_longterm_down, title="longterm_down", color=color.red)
 
Last edited by a moderator:

barbaros

Administrator
Staff member
try this

Code:
def channel_shortterm_up=MovAvgExponential(high,25);
def channel_shortterm_down=MovAvgExponential(low,25);

def channel_longterm_up=MovAvgExponential(high,90);
def channel_longterm_down=MovAvgExponential(low,90);

plot channel_shortterm_up_plot=channel_shortterm_up;
channel_shortterm_up_plot.SetDefaultColor(color.green);

plot channel_shortterm_down_plot=channel_shortterm_down;
channel_shortterm_down_plot.SetDefaultColor(color.green);

plot channel_longterm_up_plot=channel_longterm_up;
channel_longterm_up_plot.SetDefaultColor(color.red);

plot channel_longterm_down_plot=channel_longterm_down;
channel_longterm_down_plot.SetDefaultColor(color.red);
 
Top