cinar/indicator

projectionOscillator returns values less than 0(minimum), and returns values grater than 100(maximum)

devspatron opened this issue · 0 comments

Describe the bug
platform used : node-js 14

i used the cinar/indicator-ts projectionOscillator function on node-js to calculate po and spo values for forex frxGBPUSD candleticks 15min chart Jul 29 2022 to Aug 19 2022. Total candlesticks were 3900 . According to the ordinary projection Oscillator values range from [0 -100].

The projectionOscillator returns object result = {po:[], spo:[], }

  1. result.po <0(minimum)= 227 AND >100(maximum)= 615

1.a) result.po <0(minimum) example array ---
[ -3.3633939444111167, -0.8758302034411173, -24.019556282486867,
-23.377598558947327, -21.839261607157514, -23.565740488302918, ..more items
]
1.b) result.po >100(maximum) example array ---
[ 203.68431696593336, 192.03208233276743, 177.33802237594486, 164.00029791532668,
146.40152710300603, 134.34599206753336, 123.76587143008528, 118.7143538347566, ..more items
]

res po

  1. result.spo <0(minimum)= 227 AND >100(maximum)= 610

2.a) result.spo <0(minimum) example array ---
[ -4.784059450181693, -6.092374493537617, -14.734986526242473,
-18.287124066699995, -20.926432277501455, -19.153219630901212, ..more items
]
2.b) result.spo >100(maximum) example array ---
[ 161.20075102580097, 147.77337154666716, 135.76962148837623, 127.24198766156641,
121.17732710603312, 117.05863821565518, 114.10352776471768, 112.5870261911729, ..more items
]

res spo