Indicator contango/backwardation and v/v

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #257252 quote
    Andrea Carandina
    Participant
    New

    I would like to know whether it is possible to program an indicator that identifies the transition from contango to backwardation and vice versa by analyzing two futures contracts of the same commodity with different expiration dates; for example, CLH6 compared with CLM6. Such an indicator would make it possible to observe, within a specific market, how buying and selling activity shifts for traders like me who operate through spread trading.

    I am not experienced in programming, and I do not usually use technical indicators, except for COT data and volume analysis.

    I believe that a comparison between two instruments is required in order to use this indicator. Specifically, the indicator should take into account the daily closing prices of the two selected contracts (I trade on daily charts). Essentially, to give a clearer idea, we are interested in identifying when the market begins to move from contango (where longer-dated contracts trade at higher prices) to backwardation, a situation in which nearer expirations start trading at higher prices. This condition typically leads to a widening of the spread, allowing for potentially interesting trading opportunities.

    To complete the explanation, I am attaching images of the CLH6–CLM6 spread chart and of the price comparison between the two contracts. By observing the daily closing data, we can see that on December 19, 2025, a clear inversion (backwardation) begins, which causes the spread to widen.

    Thank you in advance to anyone who may be able to provide information on this topic.

    Kind regards,

    #257290 quote
    Iván González
    Moderator
    Master

    Please do not duplicate messages in the forums.


    Hello. Reference to other assets cannot be made in the indicators module, nor in the backtester module. What can be done is to create a “calculated instrument”. See screenshots.

    #257503 quote
    Andrea Carandina
    Participant
    New

    Hello Ivan, thanks for you help.

    At the end I’ve got what I need.

    With best regards,

    Andrea


    REM === BAR COUNT BACKWARDATION ===


    Spread = CLOSE


    IF Spread > 0 THEN

    cpt = cpt + 1

    ELSE

    cpt = 0

    ENDIF


    RETURN cpt AS “Backwardation Bars”


Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Indicator contango/backwardation and v/v


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Andrea Carandina
1 day, 7 hours ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/01/2026
Status: Active
Attachments: 4 files
Logo Logo
Loading...