bennycode / trading-signals

Technical indicators to run technical analysis with JavaScript & TypeScript. 📈
https://bennycode.com/trading-signals
MIT License
621 stars 90 forks source link

Replacing update #624

Closed piboistudios closed 10 months ago

piboistudios commented 10 months ago

Would be nice to have a method to be able to replace the last value, rather than pushing a new value to the dataset.

This way you can have live indicators, where the last data point will update in realtime until the next period of data is available. Otherwise you have to basically recreate the indicator and re-push all the values with the last value replaced if I'm not mistaken.

bennycode commented 10 months ago

That can be easily added. Can you suggest how you would the API to look like? Do you want to pass a boolean flag to the update method to indicate if you wish to replace the last value?