| Overall Statistics |
|
Total Orders
52
Average Win
9.88%
Average Loss
-7.45%
Compounding Annual Return
5.356%
Drawdown
36.600%
Expectancy
0.789
Start Equity
100000
End Equity
397206.32
Net Profit
297.206%
Sharpe Ratio
0.18
Sortino Ratio
0.132
Probabilistic Sharpe Ratio
0.005%
Loss Rate
23%
Win Rate
77%
Profit-Loss Ratio
1.33
Alpha
-0.003
Beta
0.517
Annual Standard Deviation
0.114
Annual Variance
0.013
Information Ratio
-0.221
Tracking Error
0.111
Treynor Ratio
0.04
Total Fees
$311.10
Estimated Strategy Capacity
$0
Lowest Capacity Asset
SPY R735QTJ8XC9X
Portfolio Turnover
0.54%
|
# https://quantpedia.com/strategies/market-seasonality-effect-in-world-equity-indexes/
#
# Be invested in global equity markets during November – April period, stay in cash during May-October period (alternatively go
# long in stocks from countries from northern hemisphere during winter period and long in stocks from countries from southern hemisphere
# during summer period; alternatively go long in cyclical companies during winter period and short defensive stocks and switch positions
# during the summer period)
from AlgorithmImports import *
class SeasonalityInEquitiesAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(1999, 1, 1)
self.set_cash(100000)
self.symbol: Symbol = self.add_equity("SPY", Resolution.DAILY).symbol
self.schedule.on(self.date_rules.month_start(self.symbol), self.time_rules.after_market_open(self.symbol), self.rebalance)
def rebalance(self) -> None:
if self.time.month == 5:
self.liquidate(self.symbol)
if self.time.month == 11:
self.set_holdings(self.symbol, 1)