Spread

Plots the Spread of two instruments

The first instrument is the primary chart data series. The secondary instrument is specified by the parameter "Symbol2". The secondary instrument does not need to be plotted on the chart, but if it is, then "Symbol2" may be left blank and if will default to the second instrument displayed on the chart.

The Parameters "Qty1" and "Qty2" are multipliers which are applied to each instrument's price before adding the two; default values are "Qty1=1" and "Qty2=‐1" which will simply plot the difference between the two instruments (P1‐P2). They may be set to other values, for example in pairs trading where the quantities might be set for roughly equal dollar amounts for each instrument. Also useful with Interactive Brokers' "Generic Combo" orders.

The Spread indicator may be used as the input to other indicators such as Bollinger Bands, to plot its relationship to its recent volatility.

The "UseMultiplier" parameter defaults to "true" to incorporate the contract multiplier into the calculation.

Default behavior is "CalculateOnBarClose = false" for real‐time display; set to "true" if not needed.

See also my "Index" indicator which can plot spreads of any number of instruments.

Created By kdoren
NinjaTrader Version 7
File Size 7.6 KB
Create Date 06/28/2010
# of Downloads 4538

Importing to NinjaTrader 7 is Easy!

To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:

  1. Download the app or add-on file to your desktop
  2. From the NinjaTrader Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file from your desktop

Questions?

Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.