Overall Statistics |
Total Trades
152
Average Win
0.41%
Average Loss
-0.44%
Compounding Annual Return
0.325%
Drawdown
12.500%
Expectancy
0.010
Net Profit
2.715%
Sharpe Ratio
0.084
Probabilistic Sharpe Ratio
0.082%
Loss Rate
47%
Win Rate
53%
Profit-Loss Ratio
0.91
Alpha
-0
Beta
0.036
Annual Standard Deviation
0.034
Annual Variance
0.001
Information Ratio
-0.544
Tracking Error
0.152
Treynor Ratio
0.079
Total Fees
$391.60
Estimated Strategy Capacity
$18000.00
Lowest Capacity Asset
QAT VQ6KGBSR66AT
Portfolio Turnover
0.56%
|
# https://quantpedia.com/strategies/ramadan-effect/ # # The investment universe consists of countries for which stock market index data are available and in which the proportion of population the professing Muslim faith # exceeded 50%. Most of the countries could be easily tracked via index ETFs. The research paper we use as an example uses 14 Muslim countries. # Ramadan is the ninth month in the Islamic calendar, which is based on the motion of the moon. The Ramadan month could be calculated by using information on the # lunar phases and sunset times from astronomical calendar or information about Ramadan dates from various public sources. # The trading strategy is simple. The investor holds an equally weighted portfolio of ETFs during Ramadan month. He/she is otherwise invested in cash. from AlgorithmImports import * class RamadanEffect(QCAlgorithm): def Initialize(self): self.SetStartDate(2015, 1, 1) self.SetCash(100000) self.symbols = ['TUR', 'GULF', 'GAF', 'PAK', 'UAE', 'QAT', 'EGPT', 'EWM', 'EIDO', 'KSA'] for symbol in self.symbols: self.AddEquity(symbol, Resolution.Daily) csv_string_file = self.Download('data.quantpedia.com/backtesting_data/economic/ramadan_dates.csv') date_pairs_str = csv_string_file.split('\r\n') date_pairs = [] for pair in date_pairs_str: split = pair.split(';') date_pairs.append([datetime.strptime(split[0], "%d.%m.%Y"), datetime.strptime(split[1], "%d.%m.%Y")]) self.start_dates = [pair[0].date() for pair in date_pairs] self.end_dates = [pair[1].date() for pair in date_pairs] def OnData(self, data): # open trades if self.Time.date() in self.start_dates or self.Time.date()-timedelta(days=1) in self.start_dates: if not self.Portfolio.Invested: long = [] for symbol in self.symbols: if self.Securities[symbol].GetLastData() and (self.Time.date() - self.Securities[symbol].GetLastData().Time.date()).days < 5: long.append(symbol) count = len(long) for symbol in long: self.SetHoldings(symbol, 1 / count) # close trades if self.Time.date() in self.end_dates or self.Time.date()-timedelta(days=1) in self.end_dates: self.Liquidate()