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);