Saturday, April 16, 2016

THINKSCRIPT PriceAsATRtrend - fixed but can't use!

#PriceAsATRtrend via Histogram (new + fixed!!!) with sum=999 instead of totalsum and change to all have the same averagetype of wilders...so it is the same as the watchlist widget! BUT cannot use it because widget still cannot do it, so might as well use totalsum because gives all data

declare lower;


input MAlength = 50;

input averageType = AverageType.wilders;


def PPA = sum ((close - close [1]) / (ATR(10, averagetype)),999);


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