TraderTheJoker
New member
I created this previous high low indicator but to the right future line projections obstructing chart, is anyway to remove them or add code to remove projections, thank you
input TimeFrame = {default HOUR, DAY, WEEK, MONTH, QUARTER, YEAR};
input ShowCurrentBarOpen = yes;
input CurrentPeriodOnly=NO;
def H = high(period = timeFrame)[1];
def L = low(period = timeFrame)[1];
def C = close(period = timeFrame)[1];
def O = open(period =timeframe)[1];
Plot PreviousBarHigh;
Plot PreviousBarLow;
if (CurrentPeriodOnly and !IsNaN(close(period = timeFrame)[-1])) or (getAggregationPeriod() > if timeframe == timeframe.month then AggregationPeriod.month else AggregationPeriod.Year)
then {
PreviousBarHigh = Double.NaN;
PreviousBarLow = Double.NaN;
}
else {
PreviousBarHigh= H;
PreviousBarLow= L;
}
PreviousBarHigh.DefineColor("Color1", Color.GREEN);
PreviousBarHigh.AssignValueColor(PreviousBarHigh.color("Color1"));
PreviousBarHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PreviousBarLow.DefineColor("Color2", Color.RED);
PreviousBarLow.AssignValueColor(PreviousBarLow.color("Color2"));
PreviousBarLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
input TimeFrame = {default HOUR, DAY, WEEK, MONTH, QUARTER, YEAR};
input ShowCurrentBarOpen = yes;
input CurrentPeriodOnly=NO;
def H = high(period = timeFrame)[1];
def L = low(period = timeFrame)[1];
def C = close(period = timeFrame)[1];
def O = open(period =timeframe)[1];
Plot PreviousBarHigh;
Plot PreviousBarLow;
if (CurrentPeriodOnly and !IsNaN(close(period = timeFrame)[-1])) or (getAggregationPeriod() > if timeframe == timeframe.month then AggregationPeriod.month else AggregationPeriod.Year)
then {
PreviousBarHigh = Double.NaN;
PreviousBarLow = Double.NaN;
}
else {
PreviousBarHigh= H;
PreviousBarLow= L;
}
PreviousBarHigh.DefineColor("Color1", Color.GREEN);
PreviousBarHigh.AssignValueColor(PreviousBarHigh.color("Color1"));
PreviousBarHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PreviousBarLow.DefineColor("Color2", Color.RED);
PreviousBarLow.AssignValueColor(PreviousBarLow.color("Color2"));
PreviousBarLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Attachments
Last edited: