Professional Documents
Culture Documents
Range Expansion Bars
Range Expansion Bars
input Length = 5;
#def UpBar = MovingAverage(AvgType, close(period = Period), Length) < priceclose and priceclose >
(close(period = Period) + (range * percentage));
def UpBar = MovingAverage(AvgType, close(period = Period), Length) < priceclose and priceclose >
(close(period = Period)[1] + (range[1] * percentage)) and open(period = Period) <
MovingAverage(AvgType, close(period = Period), Length);
def DownBar = MovingAverage(AvgType, close(period = Period), Length) > priceclose and priceclose <
(close(period = Period)[1] - (range[1] * percentage)) and open(period = Period) >
MovingAverage(AvgType, close(period = Period), Length);
AssignPriceColor (if !PaintBars then Color.CURRENT else if UpBar >= 0 and UpBar > DownBar[0] then
Color.GREEN else if UpBar <= 1 and UpBar < DownBar[1] then Color.RED else Color.WHITE);