Re: The Winners of the Q19 Stock Contest
Hi, why was the live trading on my successful strategy suspended, while other strategies that trade a similar low amount of assets are still running?
Best regards,
EDDDIE
Re: The Winners of the Q19 Stock Contest
Hi, why was the live trading on my successful strategy suspended, while other strategies that trade a similar low amount of assets are still running?
Best regards,
EDDDIE
@support
Sorry, I did not know that strategies that were submitted to the checking process are still eligible to take part in the contest even when the contest has already started. Now I know better for the future.
What to do? I have at least 5 strategies stuck in the checking process.
Regards,
EDDDIIIE
@support is ".shift(time=-1)" really forward looking?
In the Quantiacs Ridge Classifier example ".shift(time=-1)" is used, so I guess this operation is not forward looking.
def get_target_classes(data):
# define categorical targets
price_current = data.sel(field="close").dropna("time") # rm NaN
price_future = price_current.shift(time=-1).dropna("time")
class_positive = 1
class_negative = 0
target_is_price_up = xr.where(price_future > price_current, class_positive, class_negative)
return target_is_price_up.to_pandas()
@support Thanks, I just checked the availability of fundamental data. Unfortunately, the quality of the data before 2012 is not sufficient. Maybe you can improve this in the future.
Kind Regards,
EDDIEE
Hi Quantiacs Team,
do I have to adjust this backtest function in order to participate in the Q20 Contest?
weights = qnbt.backtest_ml(
train=train_model,
predict=predict,
train_period=4365, # the data length for training in calendar days
retrain_interval=20365, # how often we have to retrain models (calendar days)
retrain_interval_after_submit=None, # how often retrain models after submission during evaluation (calendar days)
predict_each_day=False, # Is it necessary to call prediction for every day during backtesting?
# Set it to true if you suspect that get_features is looking forward.
competition_type='stocks_nasdaq100', # competition type
lookback_period=365, # how many calendar days are needed by the predict function to generate the output
start_date='2006-01-01', # backtest start date
build_plots=True # do you need the chart?
)
And a second question: Is the usage of fundamental data is obliged, in order to participate in the Q20 Contest or is it just a valuable option?
Best
EDDIEE
The list provided here: https://quantiacs.com/documentation/en/data/fundamental.html
is obviously not complete, as the example below uses other additional indicators.
Best
EDDIEE
Introduction:
In this blog post, I will explore the goals of Quantiacs when organizing their contest and discuss potential improvements to better align the interests of developers with those of Quantiacs. By reevaluating the contest setup, we can create a more conducive environment for the development of profitable and robust strategies.
Understanding Quantiacs' Goals (I am not an insider this is my rational guess):
Quantiacs aims to identify the top X strategies that meet the following objectives:
Long-Term Profitability:
Quantiacs seeks strategies that exhibit profitability in the long term, extending beyond a mere four-month period. The focus on long-term profitability ensures the development of strategies that can consistently generate positive returns, providing stability and sustainability.
Uncorrelated Strategies:
Quantiacs recognizes the importance of utilizing top strategies that are not highly correlated. By encouraging uncorrelated strategies, Quantiacs aims to build a diverse and resilient portfolio. Correlation among strategies can amplify risks and diminish the benefits of diversification. Therefore, strategies that exhibit low correlation are preferred, enhancing overall stability and risk management.
Inherent Diversification:
Quantiacs values strategies that are inherently well-diversified and not overly concentrated. A well-diversified strategy reduces reliance on specific assets or markets, mitigating potential losses associated with single-point failures. Quantiacs promotes strategies that encompass broad market exposure and distribute risk across various assets or sectors.
Contest Setup and Its Impact:
However, the current setup of the contest may not entirely align with Quantiacs' objectives. The contest is primarily focused on finding a strategy that performs exceptionally well in terms of the contest Sharpe ratio over a four-month period.
Incentives and Rationality:
As a rational developer, the contest goal may incentivize you to build highly risky strategies that generate exceptional returns within the short contest period. This approach aims to secure a top position in the rankings and to get a riskless try with real money (allocation of funds). However, this mindset does not fully consider Quantiacs' emphasis on long-term profitability, low correlation, and inherent diversification. Additionally, many developers adopt similar strategies, resulting in a high degree of correlation among the top performers. Because the strategies that aims short term profitability are in many cases similar.
Suggested Improvements:
To better align the objectives of developers with those of Quantiacs, here are some suggestions:
Customized Risk-Weighted Score:
Introduce a customized score that places more weight on risk. For instance, an adjusted Sharpe ratio that emphasizes the volatility component or a comprehensive performance score that considers multiple aspects such as mean, recovery time, volatility, downside beta/capture, max drawdown, concentration, and correlation with other (top) strategies.
Multiple Rankings for One Contest:
Introduce multiple rankings within a single contest. For example:
Adjust Submission Filters:
Consider adjusting the submission filters, such as requiring a minimum number of actively traded assets within each strategy (e.g., 10 or 15). Additionally, strategies with excessively high returns that may indicate overfitting should not be accepted.
Extended Contest Duration:
Consider increasing the contest duration significantly, from four months to, for example, 12 months. This adjustment could differentiate between genuinely profitable strategies and overfitted or risky ones. But this adjustment would be clearly against the interest of the developers because the contest would be dissolved only once in a year. To maintain regular participation, a potential solution could involve starting a new contest every three or four months, each running for a year.
Conclusion:
By implementing these improvements, Quantiacs can foster a contest environment that better aligns the goals of developers with their own objectives. These adjustments would promote long-term profitability, encourage uncorrelated strategies, enhance inherent diversification, and lead to the development of more robust and sustainable investment strategies.
With this blog post, I hope to contribute to the continuous improvement of Quantiacs and the better alignment of goals between Quantiacs and developers.
Best regards,
EDDIEE
Dear Quantiacs Team,
I have some questions on the Q19 Contest.
Are the rules and the stocks universe exactly the same as in the Q18 contest? If yes, why?
Can I use the codes from the Q18 contest for the search of investment strategies or are code adjustments necessary?
Best
Eddie
I have numerous submissions with "calculation time exceeded".
Just to be on the safe side, do I have to actively resubmit those strategies or is it not necessary?
Dear Quantiacs Team, why is the "is_liquid" dataset flawed?
Especially in the first years, the sum of liquid assets just drops to zero (for one day!) several times. Some investment strategies, I backtested, are screwed up by this issue. These strategies have a certain time dependency and are just reset to zero from one day to another.
Specifically, I am interested in the exact time period of the first train period.
In this example, the train period equals 4x365 days and the backtest starts at 2006-01-01.
Does is it mean that the first train period spans from 2006-01-01 to 2009-12-31?
So the first four years of the backtest periods are actually in-sample predictions?
When the model is retrained every 5x365th day, is the train period always 4x365 days long (rolling window)? Is it possible to implement the expanding window approach for model retraining?
weights = qnbt.backtest_ml(
train=train_model,
predict=predict,
train_period=4x365, # the data length for training in calendar days
retrain_interval=5x365, # how often we have to retrain models (calendar days)
retrain_interval_after_submit=50, # how often retrain models after submission during evaluation (calendar days)
predict_each_day=True, # Is it necessary to call prediction for every day during backtesting?
competition_type='stocks_nasdaq100', # competition type
lookback_period=365, # how many calendar days are needed by the predict function to generate the output
start_date='2006-01-01', # backtest start date
build_plots=True # do you need the chart?
)
I have a different issue with testing and submitting.
I tested my strategy (Ridge Regression, random state = 18) with multi-pass backtesting using qnbt.backtest_ml. The Sharpe Ratio is 1.13, there is no forward looking, because the Sharpe Ratio is the same when predict_each_day is set to True.
Now comes the problem: I submitted this strategy (written in multi-pass backtesting format) and this strategy always gets rejected, because the Sharpe Ratio is drastically smaller 1 (exactly
0.49).
Why is there such a big difference in the Sharpe Ratio?
weights = qnbt.backtest_ml(
train=train_model,
predict=predict,
train_period=4x365, # the data length for training in calendar days
retrain_interval=5x365, # how often we have to retrain models (calendar days)
retrain_interval_after_submit=50, # how often retrain models after submission during evaluation (calendar days)
predict_each_day=True, # Is it necessary to call prediction for every day during backtesting?
# Set it to true if you suspect that get_features is looking forward.
competition_type='stocks_nasdaq100', # competition type
lookback_period=365, # how many calendar days are needed by the predict function to generate the output
start_date='2006-01-01', # backtest start date
build_plots=True # do you need the chart?
)
The last day shown ist currenty August 2th.
Best
Eddie
@vyacheslav_b said in Strategy Optimization in local development environment is not working:
result = qnop.optimize_strategy(
data,
single_pass_strategy,
qnop.full_range_args_generator(
wma_period=range(10, 20, 5), # min, max, step
roc_period=range(5, 15, 5) # min, max, step
),
workers=1 # you can set more workers when you run this code on your local PC to speed it up
)
I tried other ranges, it still doesn't work, any ideas?
Dear Support Team, I can not replicate the optimization example in the local development environment. My code just got stuck in the first iteration, I waited 8 hours and absolutely nothing happened. Do you have any idea?
Best
Eddie
Hello friends,
how can I update my local development to the Q18 contest? Loading nasdaq data doesn't work.
Best
Eddie
Thanks for your support, I really appreciate, together we are better!
This is how I solved the step four issue:
Kind Regards
Eddie