swaschke / pypnf

GNU General Public License v2.0
18 stars 15 forks source link

Implementation of ATR based box scaling #3

Closed Pipsopath closed 8 months ago

Pipsopath commented 1 year ago

Hi there! Would it be possible to add the method of box scaling by the Average True Range of n days?

fivethreeo commented 8 months ago

I would like that aswell. But I think it is a bit hard since the code precalculates all the boxes. Atr must be done on the go. So since this code relies on the indexes of boxes in a list it can be difficult to adapt.

I ported all the code to javascript so i know it intimately by now.

fivethreeo commented 8 months ago

It seems I am wrong. ATR should be calculated only at the beginning of the chart. Should be a easy feat to add then. Just calc the boxsize using atr and use a static boxsize as normal.

swaschke commented 8 months ago

Thanks for your pull request and implementation of the ATR scaling. Its a nice and welcomed contribution and your are right in above comment and your code shows this as well: ATR scaling is some kind of absolute scaling, using the ATR of the last n periods as absolute box size for the point and figure chart