Signals Help Center
  • About Signals
  • Getting Started
    • Tutorials
      • Your First Strategy
        • Create a New Strategy
        • Define Variables
        • Define Setup Method
        • Define Register Actions Method
        • Backtest
        • Deploy Strategy & Start Receiving Signals
    • Dashboard
    • Strategies
      • Strategy Tools and Settings
        • Editor
        • Strategy Detail
        • Backtests
          • Backtest Detail
          • Deploying a Backtest
          • Delete a Backtest
        • Deployments
          • Deployment Detail
          • Edit About, Rules & Alternative Markets
          • Undeploy an Active Deployment
          • (Un)Publish a Deployment
          • (Un)Follow a Deployment
          • Delete a Deployment
        • Followings
          • Following Detail
          • Unfollow a Deployment
          • Delete Record of Following
      • Strategies Marketplace
        • Follow a Strategy
        • Publish Strategy
      • Strategy Details
      • Strategy Metrics
        • Initial Capital
        • Initial Capital (USDT)
        • Strategy Balance
        • Strategy Balance (USDT)
        • Total Performance
        • Total Performance (USDT)
      • Strategy Types
        • Single Market Strategy
        • Multi Market Strategy
    • Account
      • Change Plan
      • Change or Reset Password
      • Change Name, Username, or E-mail
  • Framework Documentation
    • Strategy
      • Methods
        • Setup()
          • DataMarketplace
          • IndicatorsMarketplace
        • RegisterActions()
        • Orders Management
          • CancelOrder()
          • CancelAllPendingOrders()
          • EnterLong()
          • EnterLongLimit()
          • EnterShort()
          • EnterLongStop()
          • EnterShortLimit()
          • ExitLong()
          • EnterShortStop()
          • ExitLongLimit()
          • ExitShort()
          • ExitShortLimit()
          • ExitLongStop()
          • ExitShortStop()
        • Risk Management
          • SetProfitTarget()
          • SetStopLoss()
      • Properties
        • Market
        • Markets
        • PendingOrders
        • Position
        • Time
      • Types
        • IOrder
        • PendingOrder
    • Data
    • Logs
  • Knowledge Base
    • Vocabulary
      • Base currency
      • Deployment
      • Following
      • Quote currency
      • Strategy
    • Technical Indicators
      • Oscillators
        • Average Directional Index (ADX)
        • Momentum Indicator (MOM)
        • Moving Average Convergence Divergence (MACD)
        • Relative Strength Index (RSI)
        • Stochastic RSI (STOCH RSI)
      • Volatility
        • Average True Range (ATR)
        • Bollinger Bands (BB)
      • Trend Analysis
        • Exponential Moving Average (EMA)
        • Simple Moving Average (SMA)
        • Volume-weighted Moving Average (VWMA)
        • Weighted Moving Average (WMA)
      • Volume
        • Accumulation/Distribution Line (ADL)
  • Have a question?
    • FAQ
    • Ask on the forums
    • Contact us
Powered by GitBook
On this page
  1. Framework Documentation
  2. Strategy
  3. Methods

Setup()

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

PreviousMethodsNextDataMarketplace

Last updated 5 years ago

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 object) and indicators from the Indicators Marketplace (through object).

Parameters

Name

Type

Description

data

Object for accessing the historical data which you want to use in the strategy.

indicators

Object for accessing indicators and algorithms from the indicators marketplace which you want to use in the strategy.

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
    }
}
DataMarketplace
IndicatorsMarketplace
DataMarketplace
IndicatorsMarketplace