Setup()
Use the Setup method to connect the strategy with data streams and indicators.
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);
}using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.SMA;
public class MyStrategy : SingleMarketStrategy
{
private Bars hourlyBars;
private SMA smaSlow;
private SMA smaFast;
public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
{
hourlyBars = data.Bars(BarPeriodType.Hour, 1).WithOffset(25);
smaSlow = indicators.SMA(25).OnSeries(hourlyBars.Close);
smaFast = indicators.SMA(10).OnSeries(hourlyBars.Close);
}
public override void RegisterActions()
{
// Here goes your strategy logic
}
}Last updated