ezyquant.backtesting.context.Context.target_pct_port#

Context.target_pct_port(pct_port: float) float#

Calculate buy/sell volume to make the current position reach the target percentage of the portfolio.

Parameters:

pct_port (float) – percentage of the portfolio

Returns:

buy/sell volume, not round 100

Return type:

float