Setup()

Use the Setup method to connect the strategy with data streams and indicators.

The role of the Setup method is to define the connection of the strategy with data and indicators. For this, the method has two objects with which you are able to access data from the Data Marketplace (through DataMarketplace object) and indicators from the Indicators Marketplace (through IndicatorsMarketplace object).

Parameters

Example

// Connecting strategy with selected indicators and data streams
public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
{
    hourlyBars = data.Bars(BarPeriodType.Hour, 1).WithOffset(25);
    sma = indicators.SMA(14).OnSeries(hourlyBars.Close);
}

Last updated