Overview
run_trading_job is the final step of the core pipeline . It triggers the trading-worker pipeline job, which runs a VectorBT backtesting simulation using the optimized portfolio weights and returns performance metrics.
The tool blocks until the job completes and returns the output blob URL.
Parameters
Blob storage URL pointing to a portfolio_optimization_*.json file. This is the output_url returned by run_po_job.
Trading and backtesting configuration. Backtest execution settings. Show Trading params fields
Backtesting engine. Supported values:
"VectorBT" — weights-based backtest (default)
"VectorBT_Advanced" — weights-based with extended options (VectorBT params block)
"VectorBT_from_signals" — signal-based; requires Entries and Exits DataFrames in the input JSON
Initial portfolio cash in USD. Default: 1000000.
Rebalancing frequency as a pandas Timedelta unit.
Examples: "D" (daily), "h" (hourly), "min" (minute). Default: "D".
Transaction cost as a fraction of trade value (not basis points).
Example: 0.0003 = 3 bps. Default: 0.0003.
Slippage in basis points. Example: 3 = 3 bps. Default: 3.
Annual risk-free rate used for Sharpe/Sortino ratio calculations. Default: 0.0.
Advanced VectorBT options. Applied only when Backtest method is "VectorBT_Advanced". Show VectorBT params fields
How portfolio sizes are interpreted. Options: "TargetPercent" (default),
"TargetValue", "TargetShares", "Amount".
Share cash pool across all assets. Default: true.
Group assets for portfolio-level statistics. Default: true.
Ticker symbol for benchmark comparison. Default: "SPY".
Date range for the backtest evaluation window. Show Backtest params fields
Start of the full dataset. Format: YYYY-MM-DD.
End of training / start of out-of-sample testing. Backtest begins one business day after this date.
Format: YYYY-MM-DD.
End of the out-of-sample testing period. Format: YYYY-MM-DD.
Returns
{
"status" : "Succeeded" ,
"output_url" : "https://stmcpfabricdev.blob.core.windows.net/data/trading_report_20260307_130504.json" ,
"output_name" : "trading_report_20260307_130504.json" ,
"execution_name" : "trading-worker-abc123xyz"
}
Field Description statusJob terminal status (Succeeded) output_urlFull HTTPS URL to the backtest results blob output_nameBlob filename execution_nameJob execution ID for audit/debugging
The trading_report_*.json blob contains VectorBT performance metrics: total return, Sharpe ratio,
max drawdown, win rate, and per-ticker statistics.
Example — Standard VectorBT
{
"input_url" : "https://stmcpfabricdev.blob.core.windows.net/data/portfolio_optimization_20260307_130215.json" ,
"config" : {
"Trading params" : {
"Backtest method" : "VectorBT" ,
"initial_capital$" : 1000000 ,
"frequency" : "D" ,
"trade_comission" : 0.0003 ,
"slippage_bps" : 3 ,
"risk_free_rate" : 0.02
},
"Backtest params" : {
"Learning_start" : "2020-01-01" ,
"Learning_end" : "2024-01-01" ,
"Testing_end" : "2026-03-01"
}
}
}
Example — VectorBT Advanced
{
"input_url" : "..." ,
"config" : {
"Trading params" : {
"Backtest method" : "VectorBT_Advanced" ,
"initial_capital$" : 500000 ,
"frequency" : "D" ,
"trade_comission" : 0.001 ,
"slippage_bps" : 5 ,
"risk_free_rate" : 0.04 ,
"VectorBT params" : {
"size_type" : "TargetPercent" ,
"cash_sharing" : true ,
"group_by" : true ,
"benchmark_ticker" : "SPY"
}
},
"Backtest params" : {
"Learning_end" : "2024-01-01" ,
"Testing_end" : "2026-03-01"
}
}
}
Resources
Resource Value Container Apps Job trading-workerContainer name trading-workerEnv vars injected INPUT_URL, CONFIGOutput blob prefix trading_report_Timeout 600 seconds
Next Steps
This is the last step of the core pipeline. Download the blob from output_url to inspect the results.
The trading_report_*.json file contains VectorBT performance metrics: total return,
Sharpe ratio, max drawdown, win rate, and per-ticker statistics.
You can also run optional post-processing tools from portfolio_optimization_*.json: