Bucharest
Posts: 26 since Mar 2020
Thanks Given: 9
Thanks Received: 15
|
Hello,
I have this TOS study that plots lines on the chart showing the ATR distance above & below the close.
Is there a way to have it plot these line only for the last candle?
Alternatively, can I have the values shown on the price axes as normal bubbles without plotting the indicator on the chart?
Thank you
ThinkScript code:
def len = 2;
input length = 14;
input ShowATR = No;
def ATR = Average(TrueRange(high(period = “DAY”), close(period = “DAY”), low(period = “DAY”)), length )[1];
def dayHigh = DailyHighLow(AggregationPeriod.DAY, len, 0, no).dailyhigh;
def dayLow = DailyHighLow(AggregationPeriod.DAY, len, 0, no).DailyLow;
def price = close;
def ADR_high = price + ATR;
def ADR_low = price - ATR;
plot ADR_H = ADR_high;
plot ADR_L = ADR_low;
|