StartUpTrend Indicator for ThinkorSwim

H

horserider

Active member
Code:
# Added line at .6 level by Horserider 8/7/2019


declare lower;

input length = 14;

def trSum = Sum(TrueRange(high, close, low), length);
plot Startuptrend = if trSum == 0 then 0 else Sum(AbsValue(high - low[1]), length) / trSum;



Startuptrend.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Startuptrend.DefineColor("Positive and Up", Color.GREEN);
Startuptrend.DefineColor("Positive and Down", Color.DARK_GREEN);
Startuptrend.DefineColor("Negative and Down", Color.RED);
Startuptrend.DefineColor("Negative and Up", Color.DARK_RED);

Startuptrend.AssignValueColor(if Startuptrend >= 0 then if Startuptrend > Startuptrend[1] then Startuptrend.Color("Positive and Up") else Startuptrend.Color("Positive and Down") else if Startuptrend < Startuptrend[1] then Startuptrend.Color("Negative and Down") else Startuptrend.Color("Negative and Up"));


plot  sixLine = .6;
 
S

SilverSurferAI

New member
VIP
# Added it as a scanner

input length = 14;

def trSum = Sum(TrueRange(high, close, low), length);
def Startuptrend = if trSum == 0 then 0 else Sum(AbsValue(high - low[1]), length) / trSum;

plot scanStartUpTrend= Startuptrend <= .6;
 
S

skynetgen

New member
So simple yet some quick testing shows it can have edge. So far best was on 1h chart. with period of 21 and addition of moving average
crossover. On daily signal is too rare or too false

Code:
#basically ATR based through detector - when range of the move compresses it shows that
declare lower;

input length = 21;
input through=0.8;

def trSum = Sum(TrueRange(high, close, low), length);
plot Startuptrend = if trSum == 0 then 0 else Sum(AbsValue(high - low[1]), length) / trSum;

plot pthrough=through;pthrough.setdefaultColor(color.VIOLET);pthrough.setLineWeight(2);

plot avg=expaverage(startuptrend,6);
plot crossup=if avg crosses above pthrough then avg else double.nan;
crossup.setpaintingStrategy(paintingStrategy.ARROW_UP);

Startuptrend.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Startuptrend.DefineColor("Positive and Up", Color.GREEN);
Startuptrend.DefineColor("Positive and Down", Color.DARK_GREEN);
Startuptrend.DefineColor("Negative and Down", Color.RED);
Startuptrend.DefineColor("Negative and Up", Color.DARK_RED);

Startuptrend.AssignValueColor(if Startuptrend >= 0 then if Startuptrend > Startuptrend[1] then Startuptrend.Color("Positive and Up") else Startuptrend.Color("Positive and Down") else if Startuptrend < Startuptrend[1] then Startuptrend.Color("Negative and Down") else Startuptrend.Color("Negative and Up"));
 
S

SilverSurferAI

New member
VIP
Sky - Thanks for the update. This looks promising. Been using the original on 3-minute chart, with other confirmation indicators. Will test yours out.
 

Top