Hi Brian,
I tried to go through my algo and kept disabling different parts of the code to see if the performance delta would disappear. However, the difference in performance did not disappear.
I am not sure what is causing the discrepancy. So I decided to test the two QR versions on a simple algo per below. This is a simple buy-and-hold with any cash balances reinvested.
As you can see there is still a significant difference in the performance of the QR versions. I have looked at the backtest files and I can not find anything. I can send them to you if you like.
The pricing database seems to be fine too!
I like to upgrade the environment to 2.10 but this is very confusing.
Thanks for your help.
import zipline.api as algo
def initialize(context):
"""
Called once at the start of a backtest, and once per day at
the start of live trading.
"""
# Set SPY as benchmark
algo.set_benchmark(algo.symbol("SPY"))
context.init = 0
def handle_data(context, data):
algo.order_target_percent(algo.symbol('VT'), 1.0)
def before_trading_start(context, data):
"""
Called every day before market open. Gathers today's pipeline
output and initiates real-time data collection (in live trading).
"""
pass
QR version 2.10
Start date 2023-01-04
End date 2024-04-25
Total months 15
Backtest
Annual return 16.65%
Cumulative returns 22.28%
Annual volatility 12.3%
Sharpe ratio 1.3141
Calmar ratio 1.4417
Stability 0.7389
Max drawdown -11.55%
Omega ratio 1.2332
Sortino ratio 1.9792
Skew -0.0156
Kurtosis -0.1577
Tail ratio 0.9679
Daily value at risk -1.49%
Gross leverage 1.0
Daily turnover 0.61%
Alpha -0.0546
Beta 0.9228
QR version 2.9.2
Start date 2023-01-04
End date 2024-04-25
Total months 15
Backtest
Annual return 18.984%
Cumulative returns 25.474%
Annual volatility 12.228%
Sharpe ratio 1.48
Calmar ratio 1.70
Stability 0.79
Max drawdown -11.179%
Omega ratio 1.27
Sortino ratio 2.26
Skew -0.01
Kurtosis -0.15
Tail ratio 0.99
Daily value at risk -1.469%
Gross leverage 1.00
Daily turnover 0.62%
Alpha -0.04
Beta 0.92