Back to Community
New Default Commissions and Capital

Today, we shipped a change to the default commission model and capital base used in backtests, in order to bring them in line with the contest. There are two changes of note:

  • The default commission is now $0.001 per share, down from $0.0075. This means that backtests use the same default commission as we apply in the contest.
  • The default capital base is now $10 million, up from $1 million. Like with commission, backtests are now using the same default capital base as we apply in the contest.

This change to the defaults doesn't affect existing backtests or contest entries, but will apply to new backtests going forward.

Disclaimer

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.

5 responses

Hi,

I'm trying to manually set the commission for S&P e-minis. I do that under the initialize function, like it's supposed to be. But it doesn't seem to make a difference to the algo's performance. How can I manually set the commission parameters?

Clone Algorithm
4
Loading...
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
"""

To run an algorithm in Quantopian, you need to define two functions: 
initialize and handle_data. 
"""
"""
The initialize function sets any data or variables that 
you'll use in your algorithm. 
It's only called once at the beginning of your algorithm.
"""
def initialize(context):
    # In our example, we're looking at ES.
    context.future = (continuous_future('ES'))
    
    # Specify that we want the 'rebalance' method to run once a day
    schedule_function(rebalance, date_rule=date_rules.every_day())
    
    #set commission to zero
    set_commission(commission.PerTrade(cost=0.00001))
    
"""
Rebalance function scheduled to run once per day (at market open).
"""
def rebalance(context, data):
    # To make market decisions, we're calculating the ES's 
    # moving average for the past 5 days.
    
    #I had to convert the continuous future object into a futures contract.
    context.future = data.current(continuous_future('ES'), 'contract')
    
    # We get the price history for the past 5 days. 
    price_history = data.history(
        context.future,
        fields='price',
        bar_count=5,
        frequency='1d'
    )

    # Then we take an average of those 5 days.
    average_price = price_history.mean()
    
    # We also get the ES's current price. 
    current_price = data.current(context.future, 'price') 
    
        # If the current price is 1% above the 5-day average price, 
        # we open a long position. If the current price is below the 
        # average price, then we want to close our position to 0 shares.
    if current_price > (1.01 * average_price):
            # Place the buy order
            order_target_percent(context.future, 1)
            log.info("Buying %s" % (context.future.symbol))       
   
    elif current_price < average_price:
            # Sell all our positions by setting the target position to zero
            order_target_percent(context.future, 0)
            log.info("Selling %s" % (context.future.symbol))
    
    # Use the record() method to track up to five custom signals. 
    # Record ES's current price and the average price over the last 
    # five days.
    record(current_price=current_price, average_price=average_price)
There was a runtime error.

@Theodory: To change the commission model used for futures, you'll have to do something like this:

set_commission(us_futures=commission.PerFutureTrade(cost=0.00001))  

This is missing from the documentation. We'll have to add it in. Sorry for the confusion.

Disclaimer

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.

Thank you!!

Did min_trade_cost get set to 0? The docs say it is still $1, but I am seeing different results with the following commission set (which I thought was the default):

set_commission(commission.PerShare(cost=0.001, min_trade_cost=1))  

I'm pretty sure 0 is the default and used in the contest (and their PB probably don't charge a minimum commission). $1 min I believe is IBs minimum commission.