Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculating level of contango / backwardation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Calculating level of contango / backwardation

    NT Team and the wider forum,

    Is there a generally accepted method of calculating the contango or backwardation between a futures contract and its parent index (spot price)? Or restated, the premium / discount a future contract is trading to its parent index. http://en.wikipedia.org/wiki/Contango

    Further, a contract in contango (trading above spot price) will decrease in value until it equals the spot price of the underlying at maturity. Similarly a contract in backwardation (trading below spot price) will increase in value until it equals the spot at maturity. How can I best estimate the level of contango or backwardation? Average the difference between the one hour closing prices of the index and future contract (in cash hours) over the course of the most recent trading day? Trading week? Create a regression over a longer period to account for trajectory of the contango or backwardation as the futures contract approaches maturity?

    The question is raised as an entry order, stoploss level, and profit target level are being calculated from and triggered from a parent index which must be executed via a futures contract using IOrders.

    I imagine there is a generally accepted method of calculating / estimating the contango or backwardation to enable index price levels to be converted to appropriate price levels on the futures contract. Any assistance would be appreciated.

    Regards
    Shannon

    #2
    Hi Shannon, would unfortunately not be aware of generally accepted / recommended way to approach those calcs - wouldn't it be easier to just use the 'true' signal from the index data and then generate the entry level and bracket orders from the actual futures underlying you trade?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      Thanks for the quick reply. Please confirm if my understanding of your proposal is correct:
      1) a trade is triggered from an index, to be executed via a future. The entry price set as the price on the futures contract at the time the trade was triggered. Alternatively, the trade could use a market order.
      2) the prices for bracket orders (i.e. stoploss & profit target) are set at the prices on the futures contract that correspond to the time on the index where the bracket orders would be set. e.g. where the stoploss on the index would be set a the low of the bar four bars ago, the stoploss on the futures contract would be set at the low of the bar four bars ago (allowing for trading outside of market hours).

      Please advise if I misunderstood your solution.

      To illustrate my query, please find attached a chart depicting three series, the SPX (SP500 - white), the ESZ2 (Dec'12 SP500 eMini - purple), and in the lower window the SPX - ESZ2 closing price spread. The chart covers 60min bars during cash hours for the period where the ESZ2 was the primary eMini (09/24/12-12/21/12).

      As you can see, as the ESZ2 approached maturity (12/21/12) the spread approached zero (i.e. the ESZ2 and SPX bars in the top window largely overlap). In late September & early October, the spread "averaged" above 5 points (allowing for the increased volatility). In late October, the spread "averaged" 5 points before decreasing over the course of November and December.

      Given the degree of volatility, gauging the "average" spread (excluding outliers) over the recent days appears to be a rough approximation of the spread to expect over coming days. I could include the gradient of the spread in the calculation to get a better approximation.

      I'll trial setting prices levels for bracket orders as the index price minus the rough approximation for spread.

      Any opinions / recommendations would very very welcome.
      Regards
      Shannon
      Attached Files

      Comment


        #4
        Shannon, that's correct in understanding. I would test though which stops / targets are more accurate for realtime trading, the index or future data generated ones. As the future tends to be more noisy, you might want to lean to those to ensure you're not stopped out prematurely.

        You could though as well look into working out the avg spread, perhaps even down to different intervals - so for example the avg spread of the 10-11 AM hourly timeframe for the last x sessions - not sure though if you would see a meaningful difference for your strategy here, just a thought what further to think about.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand & the NT Forum,

          Picking up on this thread, I would imagine this contango / backwardation calculation (i.e. the difference between index and associated derivative price levels) would be best implemented as a "user-defined function". Whereby, a strategy would call the function with the two dataSeries as arguments (e.g. Contango(^SPX, ES 03-12) ). Under this approach, a strategy based on the SPX would have to add the barsArray of the associated eMini contact (i.e. ES 03-12).

          This gives rise to the question, when the two dataSeries are are sent as arguments to the user-defined function, how can I ensure the two dataSeries are aligned in terms of time period. For example, how can I ensure the 10am 20 Feb SPX bar is compared to the 10am 20 Feb ES 03-12 bar? How can I ensure I am only comparing the dataSeries during the RTH (regular trading hours) of the index, specifically excluding the ETH (electronic trading hours) outside of RTH of the index.

          As always any insight would be appreciated.

          Regards
          Shannon

          Comment


            #6
            Shannon, as far as the sessions go, in most cases the primary chart's session would define the added bars session as well (only different if you added the symbol manually to the chart or if <use instrument settings> would be selected, then the session selected for the individual instrument would be used to conserve memory by not recreating the series).

            You are correct that you would need to be mindful about the sync, as the series updates would be strictly event based. KDoren has kindly shared a great framework here in the sharing section with this index / spread indicator works, where this topic is considered as well in development of the study - I suggest to review his works as starting point for your own.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ScottWalsh, 04-16-2024, 04:29 PM
            7 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cls71, Today, 04:45 AM
            0 responses
            5 views
            0 likes
            Last Post cls71
            by cls71
             
            Started by mjairg, 07-20-2023, 11:57 PM
            3 responses
            214 views
            1 like
            Last Post PaulMohn  
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            547 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Working...
            X