Indicator should not display for series with few points. This is useful for dynamic series.
Both PSAR and MACD indicators throw exceptions and fail for series with few points.
Thanks for reporting!
This is result of using less points than params.longPeriod
+params.signalPeriod
(defaults to 26+9-current point). I see two solutions:
H.error()
, or maybe H.warn()
?) that we have less points than neededWhat do you think @oysteinmoseng , @TorsteinHonsi ?
I think gracefully do nothing, that's what the other indicators do (e.g. sma). Or alternatively return null or 0 points. It's useful to not throw an error for this, as the data might be dynamic.
Oh, SMA accidentally works fine.. It looks like during transition/refactoring from Indicator class to Series this safeguard was removed.
Most helpful comment
Oh, SMA accidentally works fine.. It looks like during transition/refactoring from Indicator class to Series this safeguard was removed.