Back to Community
Contest 38 Rules Changes - Slippage, Leverage, and order_optimal_portfolio

In case you haven’t seen it yet, we are currently building an entirely new contest with new rules, a new prize structure, and a new UI. That work is in progress, so in the meantime we are making three changes to the rules in Contest 38. The submission deadline for Contest 38 is February 1, 9:30AM ET.

Everyone can make 3 new entries this month, regardless of how many you already have entered. Previous entries will not roll over into this new contest making this a clean start. If you've made a new entry already this month, we will send you an email and ask you to re-submit your entry.

These are the rule changes:

  1. All orders must be placed using order_optimal_portfolio. You can use MaximizeAlpha or TargetWeights as your objective function, and pass any constraints that you’d like (though we recommend some further down in this post). This means orders cannot be placed with other functions like order_target_percent.
  2. Algorithms must have a minimum EOD gross leverage of 0.7x. This means that more than 70% of your capital base will have to be invested at the end of each day. You can track your leverage with context.account.leverage.
  3. All entries will use the 5 bps fixed slippage model in the 2 year backtest and in paper trading. When you submit an algorithm to the contest, the slippage model used will be automatically set to the 5bps fixed model for all contest entries. However, you can test your algorithm with this model before submitting your algorithm by adding this line to your initialize function:

Why these changes?

The order_optimal_portfolio function is the only ordering function supported in our internal live trading infrastructure. Everyone who receives an allocation must update that algorithm to use the Optimize API. We're steering the community to use the Optimize API at the very beginning of the process rather than stubbing it in at the end. This will make the simulations an even better predictor of the as-traded performance.

The minimum gross leverage check is being added to help transition over to the new contest rules that are specially tailored to cross-sectional, long-short equity strategies with a minimum per-asset holding time of ~2-3 days.

The change to the slippage model reflects an upcoming change to the default model on the platform. The new model is more accurate and more consistent with the tools we use internally to evaluate algorithms for capital allocations.

Last of Its Kind

Contest 38 will be the last of its kind. As mentioned above, we are working on an entirely new contest with new rules, a new prize structure, and a new UI. We are expecting this to be ready in early February. The three new rules in Contest 38 will also exist in the new contest.


The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

14 responses

Hi Jamie,

Wondering if there is a "maximum" EOD gross leverage to along with the new minimum 0.7X

How is this EOD constraint different than 0.8X- 1.1X from the or does this new constraint only apply to EOD?

Is there a motivation for this rule. Are we discouraging day trading type strategies for the new contest and allocation? Just curious even though it doesn't affect my algorithms.


Can you tease us about the amount of the monthly new prizes?

Hi Jamie -

I'm trying to interpret this statement:

The minimum gross leverage check is being added to help transition over to the new contest rules that are specially tailored to cross-market, long-short equity strategies with a minimum per-asset holding time of ~2-3 days.

Presumably, the minimum per-asset holding time of ~2-3 days results from the Mean Daily Turnover constraint of 5% to 65%. The gross leverage and the turnover would seem to be independent measures of alignment of the algo with your requirements (e.g. the gross leverage could be ~ 1.0, with a mean daily turnover > 65%). Wouldn't an algo that is trading in and out of stocks on a short time scale end up running afoul of the turnover constraint? Or maybe you just don't have the machinery in place at this point to check the turnover, and so you are going at it via the gross leverage?

Also, I'm curious why you use the term "cross-market" when it is all one market--U.S. equities? Are there distinct sub-markets within the U.S. equity market (and if so, what are they)? How do the contest rules check that the algo is cross-market? Reviewing the constraints, would it be the Sector Exposures and/or perhaps the QTradableStocksUS base universe, combined with the Position Concentration, that somehow capture the cross-market-ness?

Hi Jamie: I believe you have a typo, it should be


@Leo: I spoke a bit about the motivation for the EOD minimum leverage rule in this reply. Essentially, the risk model requires EOD positions. We also want algos to be invested, not just sitting in cash.

The 0.8x-1.1x requirement in the new contest will guard against outliers and use 0.7x as the absolute minimum. You can think of the 0.7x minimum in this contest as 'warming up' to the big rule change in the next one.

@Emiliano: Unfortunately, I don't have more info to share on the new prize structure at this time. I imagine we will make an announcement on this topic later in the month.

@Douglas: Nice catch, thanks!

@Grant: The turnover and leverage constraints will both be required in the new contest. 'Cross-market' should have been 'cross-sectional'. Thanks for pointing that out.

I still receive this error when I enter an algorithm in the contest:
ValueError: Request for risk model data ending with 2018-01-08 could not be processed. Data is available up to 2018-01-04.

How can I make sure that my algorithm does not get disqualified, because there is no data available?

I tried again, same script but now the error states:
ValueError: Request for risk model data ending with 2018-01-10 could not be processed. Data is available up to 2018-01-08.

@Guido: The problem you're encountering is that the risk model data isn't available in paper trading so algorithms which use the risk model or the risk API don't work in the contest. You will be able to submit an algorithm that uses the risk model/risk API to the new contest next month. Sorry for the inconvenience.

Ok, so to be clear there's no requirement for dollar and sector neutrality, or position concentration, as per the previous contest rules:

Trying to submit an entry where all ordering happens with order_optimal_portfolio function. However, it still won't allow me to submit telling me that the function must be used for ordering. Are there any common errors we must watch out for?

@Dan: sorry I missed your statement/question. You're correct that the the position concentration, risk model exposures, dollar neutrality, etc. are not required for contest 38 as per the rules found here.

@Alexander: Are you using any other ordering functions in your code? If not, the check for order_optimal_portfolio might be picking up one of the old ordering functions in a comment somewhere. Make sure to remove any commented out old ordering functions. Sorry for the confusion!

Yeah, I've commented out the old order_target_percent. Removed it now and it works! Thanks.

Noted, Jamie yet to allow fetch_csv() in the new contests after 38?

Hi Karl,

The new contest won't allow fetch_csv() right away, but we've got a similar tool in the works that will allow you to use your own uploaded data in the contest. Unfortunately, there's no timeline on it yet, but we'll post in the community when we have more info.