ATR Scaled Elhers Decycler For ThinkOrSwim

YungTraderFromMontana

Well-known member
I whipped this up today, its a work in progress but already successful nonetheless. Arrows are the study's simple signals but there will be more complex ones to come.
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2015-2020
#

declare lower;
declare real_size;
input length = 20;
input averageType = AverageType.WILDERS;
def ATR = MovingAverage(averageType, TrueRange(high/close, close/close, low/close) * 100, length);
def price2 = ATR;
input length2 = 30;
input displace = 0;
input showBreakoutSignals = no;
def ATRAvgExp = ExpAverage(price2[-displace], length);



input price = close;
input roofCutoffLength = 60;
input k = 1.0;

def decycler = reference EhlersSimpleDecycler(price = price, "roof cutoff length" = roofCutoffLength);

plot DecyclerOsc = 100 * k * reference EhlersHighpassFilter(price = decycler, "roof cutoff length" = 0.5 * roofCutoffLength) / price;
plot ZeroLine = 0;
plot max = ATRAvgExp/4;
plot min = -ATRAvgExp/4;
plot sellmin = -ATRAvgExp/1.75;
input BuyEntry = 3;
input SellEntry = 3;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);
plot trueqb = qb[1];
plot trueqs = qs[1];

plot midline = (qs[1]+qb[1])/2;

plot up = (decyclerosc[1] <= min[1]) and (decyclerosc > min);
plot down = (decyclerosc[1] >= min[1]) and (decyclerosc < min);
 

TrueDepth

Member
VIP
Awesome. I am going to try it out. Is this better than your "Potential Breakout Arrow Plots Indicator" or a continuation of it?
 

TrueDepth

Member
VIP
Here is the code for the Arrows on this study, if you want it as a LOWER study.

Code:
plot up = if (decyclerosc[1] <= (min[1]+ .01)) and (decyclerosc >= min) then min else double.nan;
plot down = if (decyclerosc[1] >= min[1]) and (decyclerosc <= min) then min else double.nan;
plot sellup =  (decyclerosc[1] >= zeroline[1]) and (decyclerosc <= zeroline);

up.setPaintingStrategy(paintingstrategy.ARROW_UP) ;
up.setdefaultColor(color.green);
up.SetLineWeight(5);

down.setPaintingStrategy(paintingstrategy.ARROW_DOWN);
down.setdefaultColor(color.red);
down.SetLineWeight(5);
 

Kallyone

New member
VIP
Thank you for the indicator! Could you please include an identification (say a Dot or arrow) when the slope of the Decycler Oscillator changes from positive to negative or vice versa
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Thank you for the indicator! Could you please include an identification (say a Dot or arrow) when the slope of the Decycler Oscillator changes from positive to negative or vice versa
I don't use this study but is this might work. Paste it to the bottom of your study:
Ruby:
plot uparrow = if  up  then low else double.NaN ;
uparrow.SetPaintingStrategy(PaintingStrategy.ARROW_up);
uparrow.SetDefaultColor(color.blue) ;
uparrow.SetLineWeight(1);

plot downarrow = if down   then close else double.NaN ;
downarrow.SetPaintingStrategy(PaintingStrategy.ARROW_up);
downarrow.SetDefaultColor(color.magenta) ;
downarrow.SetLineWeight(1);
 

Similar threads

Top