Robot-Wealth / rsims

R package for financial simulation
Other
38 stars 16 forks source link

Make MAINT_MARGIN a parameter? #12

Open Thie1e opened 2 years ago

Thie1e commented 2 years ago

Hi Kris,

would it be possible to make the MAINT_MARGIN variable in the backtest functions a parameter instead of hardcoding it to be 0.25?

I tried it myself by modifying the function, but when I set it to 1 (intending to use no leverage), that leads to some weird results. For example, more margin calls than expected and 'trades' where stocks have trade_value < 0 but share_trades = 0.