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

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top