Hi,
I'd like to have a P/L percent of the current close compare to the last day close next to the price on the next side of the chart.
What is the code to display the bubble on the right side of the chart like the price moving up and down with the moving candle?
This is what I've collected sofar:
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;
} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
plot PercenttoPrev = Round (100 * (close - PrevDayClose) / PrevDayClose);
Thanks.
I'd like to have a P/L percent of the current close compare to the last day close next to the price on the next side of the chart.
What is the code to display the bubble on the right side of the chart like the price moving up and down with the moving candle?
This is what I've collected sofar:
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;
} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
plot PercenttoPrev = Round (100 * (close - PrevDayClose) / PrevDayClose);
Thanks.
Last edited: