piquette / finance-go

:bar_chart: Financial markets data library implemented in go.
https://piquette.io/projects/finance-go
MIT License
724 stars 102 forks source link

PrevBar PrevBars methods? #19

Open qiquanlu opened 3 years ago

qiquanlu commented 3 years ago

Thank you for providing such great package!

When I try to use this package, it's very convenient to fetch data, and iterate data, however, the Next() method in iter will drop all previous values. And mosts of TAs are based on previous values.

I think it will be more convenient to change Next() (or add NextBar, NextBars method) and keep values. Also add PrevBar, PrevBars methods to get previous candle bars for technical analysis.

What do you think? Thanks!