Shtick Hustler
Well-known member
- Joined
- Oct 15, 2020
- Posts
- 105
- Likes
- 46
I'd like to compute an ema on atr.
I see from looking at other studies that atr values are gotten like this:
In LBRPaintBar.java I see an MA computed like this:
So, if I'm understanding this correctly, it's 1st necessary to create a new dataseries dataset by inserting ATR values into dataseries (here using key Values.ATR), and then apply the ema to that dataset, by referencing the same key?
Or, is there an easier way to accomplish it
I see from looking at other studies that atr values are gotten like this:
Code:
DataSeries series=ctx.getDataSeries();
double atr=series.atr(index, atrPeriod);
In LBRPaintBar.java I see an MA computed like this:
Code:
series.setDouble(index, Values.ATR, atr);
...
double aatr=factor * series.ma(method, index, atrPeriod, Values.ATR);
So, if I'm understanding this correctly, it's 1st necessary to create a new dataseries dataset by inserting ATR values into dataseries (here using key Values.ATR), and then apply the ema to that dataset, by referencing the same key?
Or, is there an easier way to accomplish it