Ejemplo n.º 1
0
my_system = System([fcs, my_rules, combiner, possizer], data, my_config)

print(my_system.positionSize.get_price_volatility("EDOLLAR").tail(5))
print(my_system.positionSize.get_block_value("EDOLLAR").tail(5))
print(my_system.positionSize.get_instrument_sizing_data("EDOLLAR"))
print(my_system.positionSize.get_instrument_value_vol("EDOLLAR").tail(5))
print(my_system.positionSize.get_volatility_scalar("EDOLLAR").tail(5))
print(my_system.positionSize.get_daily_cash_vol_target())
print(my_system.positionSize.get_subsystem_position("EDOLLAR").tail(5))

# portfolio - estimated
from systems.portfolio import Portfolios
portfolio = Portfolios()

my_config.use_instrument_weight_estimates = True
my_config.use_instrument_div_mult_estimates = True
my_config.instrument_weight_estimate = dict(method="shrinkage",
                                            date_method="in_sample")

my_system = System([my_account, fcs, my_rules, combiner, possizer, portfolio],
                   data, my_config)

my_system.set_logging_level("on")

print(my_system.portfolio.get_instrument_weights().tail(5))
print(my_system.portfolio.get_instrument_diversification_multiplier().tail(5))

# or fixed
portfolio = Portfolios()
my_config.use_instrument_weight_estimates = False
my_config.use_instrument_div_mult_estimates = False