so I've got another pysystemtrade noob question (let me know if this isn't the right place...)
say I've got one asset and one trading rule. The resulting accountCurve then remains fairly consistent through adding stages to the system (scale, combine, sizing)...
... that is, until the final, Portfolio, stage. For some reason, the accountCurve produced by portfolio() looks a bit different and has different (worse) stats. I tried various values for capital and vol target, no change. No idea what causes it, other than portfolio() calling pandl_for_instrument() which is where the accountCurve gets built.
to replicate this, you can start e.g. from simplesystem.ipynb and do
for the portfolio() curve, and for the manual accountCurve you can do
here's the two resulting curves:

what am I missing?
say I've got one asset and one trading rule. The resulting accountCurve then remains fairly consistent through adding stages to the system (scale, combine, sizing)...
... that is, until the final, Portfolio, stage. For some reason, the accountCurve produced by portfolio() looks a bit different and has different (worse) stats. I tried various values for capital and vol target, no change. No idea what causes it, other than portfolio() calling pandl_for_instrument() which is where the accountCurve gets built.
to replicate this, you can start e.g. from simplesystem.ipynb and do
Code:
my_config = Config(
dict(
trading_rules=dict(ewmac8=ewmac_8),
instrument_weights=dict(US10=1),
instrument_div_multiplier=1,
forecast_scalars=dict(ewmac8=5.3),
forecast_weights=dict(ewmac8=1),
forecast_div_multiplier=1.))
my_system = System([
Account(), Portfolios(), PositionSizing(), ForecastCombine(),
ForecastScaleCap(), Rules()
], data, my_config)
my_system.accounts.portfolio().curve().plot()
print(my_system.accounts.portfolio().percent().stats())
Code:
price = data.get_raw_price('US10')
from syscore.accounting import accountCurve
account = accountCurve(price, forecast = my_system.portfolio.get_actual_position("US10"))
print(account.percent().stats())
account.curve().plot()
here's the two resulting curves:

what am I missing?

