@check_is_trading
@export_as_api
@ExecutionContext.enforce_phase(EXECUTION_PHASE.HANDLE_BAR, EXECUTION_PHASE.SCHEDULED)
def order_percent(id_or_ins, percent, style=None):
 assert (0 < percent <= 1)
 portfolio_value = get_simu_exchange().account.portfolio.portfolio_value
 return order_value(id_or_ins, (portfolio_value * percent), style)

@ check_is_trading @ export_as_api @ ExecutionContext . enforce_phase ( EXECUTION_PHASE . HANDLE_BAR , EXECUTION_PHASE . SCHEDULED ) def order_percent ( id_or_ins , percent , style = None ) : assert ( 0 < percent <= 1 ) portfolio_value = get_simu_exchange ( ) . account . portfolio . portfolio_value return order_value ( id_or_ins , ( portfolio_value * percent ) , style )
place an order for a security for a given percent of the current portfolio value .