Created with Highcharts 12.1.2EquityJan 6Jan 13Jan 20Jan 27Feb 3Feb 10Feb 17Feb 24Mar 395k100k105k-10-50012-2-100500M1,000M99,544.38455055
Overall Statistics
Total Orders
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-5.309%
Drawdown
6.200%
Expectancy
0
Start Equity
100000
End Equity
99126.96
Net Profit
-0.873%
Sharpe Ratio
-0.762
Sortino Ratio
-1.147
Probabilistic Sharpe Ratio
27.172%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.073
Beta
-1.025
Annual Standard Deviation
0.113
Annual Variance
0.013
Information Ratio
-0.444
Tracking Error
0.223
Treynor Ratio
0.084
Total Fees
$1.00
Estimated Strategy Capacity
$530000000.00
Lowest Capacity Asset
SPY R735QTJ8XC9X
Portfolio Turnover
1.67%
# region imports
from AlgorithmImports import *
# endregion

class TestAlgorithm(QCAlgorithm):

    def initialize(self):
        self.set_start_date(2025, 1, 1) 
        self.set_end_date(2025, 3, 1) 
        self.set_cash(100000)
        self.add_equity("SPY", Resolution.SECOND) 
        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(days=10)))
        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.DOWN, timedelta(days=10)))
        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(lambda t: Expiry.END_OF_QUARTER(t)))  
        self.settings.rebalance_portfolio_on_insight_changes = False      
        self.debug_mode = True 

    

    def on_end_of_algorithm(self):
        for insight in self.insights.get_active_insights(self.utc_time):
            self.log(f"Insight for {insight.symbol.value} generated at {insight.generated_time_utc} UTC by {insight.source_model}.")