Saturday, April 16, 2016

THINKSCRIPT PriceAsATRtrendHist (old and current)

#PriceAsATRtrend via Histogram (old) with flaws because different returns from when i put i to the watchlist widget

declare lower;

input MAlength = 50;
input averageType = AverageType.EXPONENTIAL;

def PPA = TotalSum (close - close [1]) / (ATR(10, AverageType.WILDERS));

def PPAMA = MovingAverage (averageType, PPA, MAlength);

plot PPAhist = PPA - PPAMA;

plot zerobase = 0;

PPAhist.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HISTOGRAM);

PPAhist.AssignValueColor(if PPA >= PPAMA then Color.GREEN else Color.RED);

PPAhist.SetLineWeight(3);

No comments:

Post a Comment