cuemacro / finmarketpy

Python library for backtesting trading strategies & analyzing financial markets (formerly pythalesians)
http://www.cuemacro.com
Apache License 2.0
3.41k stars 490 forks source link

only available returns are cumprod #38

Open flipdazed opened 3 years ago

flipdazed commented 3 years ago

Currently the only returns available are cumulative products. I couldn't find any alternative to Calculations().create_mult_index() for cumulative sums

Suggest cumulative sum flag when calculating backtest cumulative PnL

saeedamen commented 3 years ago

I think that's a good idea @flipdazed. I had already started to add this functionality to the QuickCharts class. I'll add it to the backtest too, as a flag. I can add it to the BacktestRequest as a flag for the user to set.

saeedamen commented 3 years ago

@flipdazed I've added a cumulative sum flag to BacktestRequests (and added the associated method in Calculations in findatapy.

eg. br.cum_index = 'mult' # 'mult' or 'add'