HasContractChangeEvent ( String rootSymbol);

Default values:

rootSymbol: getSymbol()


Returns true if active futures contract has changed; false, otherwise.

Input parameters

Parameter Default value Description
rootSymbol current symbol Defines the root symbol.


def change = open - close[1];
AddVerticalLine(HasContractChangeevent(), "Change is " + change);

This example script draws a vertical line at the point where active contract change has occurred. It also displays the difference between the first Open after active contract change and last Close price of previously active contract. Note that this example only makes sense when automatic contract change adjustments for futures is disabled (see the Futures Settings article for details).