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
  • Select indicators from the Indicators Marketplace
  • Apply indicator on a data series
  • OnSeries Method
  • Keep Method
  1. Framework Documentation
  2. Strategy
  3. Methods
  4. Setup()

IndicatorsMarketplace

Object for accessing indicators from Indicators Marketplace.

PreviousDataMarketplaceNextRegisterActions()

Last updated 5 years ago

To enable you to use various kinds of algorithms and indicators from Signals Indicators Marketplace, you need an object which allows you to access those algorithms inside your strategies. That is what the IndicatorsMarketplace object does in the Setup method of each strategy.

Select indicators from the Indicators Marketplace

Select indicators and their version (Signals Framework supports versioning of algorithms created by developers) from the Indicators dropdown in the sidebar. In the background, the framework will automatically reference the selected algorithm in your strategy and add a using statement into your code in the code editor.

Selected indicators will be accessible through the IndicatorsMarketplace indicators object in the Setup method and intellisense will automatically start suggesting all the indicators which you have selected via the dropdown.

Apply indicator on a data series

OnSeries Method

Definition of an indicator is not complete without defining which data series you want to use it on. The OnSeries method makes this definition easy. Some indicators need a stream of doubles, while others are processing Bars. That's why the OnSeries method input parameter varies, based on the type of indicator.

Parameters

Name

Type

Description

series

IDataSerires<TData>

Data series used as input for the indicator.

Example

// Apply SMA indicator on close values of a 24 hours bars data series
// with SMA period of 14.
sma = indicators.SMA(14).OnSeries(dailyBars.Close);
using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.SMA;

public class MyStrategy : SingleMarketStrategy
{
    private Bars dailyBars;
    private SMA sma;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(2);
        sma = indicators.SMA(14).OnSeries(dailyBars.Close);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(dailyBars).Do(() =>
        {
            // Prints the current SMA value
            Log("The current SMA value is " + sma.Value.ToString());
        });
    }
}

Keep Method

Very often in your strategy logic, you want to make your trading decision based not only on the current indicator value but also on its historical value. Using the Keep method, you can define how many historical values should be stored in an indicator. By default, indicators only store a value for the current bar.

Parameters

Name

Type

Description

requiredCount

int

The number of historical values the indicator should keep.

Example

Suppose you need to know what the value of an SMA indicator was 10 bars in the past, you can simply set up an indicator using the Keepmethod with a parameter value of 10.

// Apply SMA indicator on close values of a 24 hours bars data series
// with SMA period of 14 and keep a retrospective overview of 10 bars
// into the past.
sma = indicators.SMA(14).Keep(10).OnSeries(dailyBars.Close);
using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.SMA;

public class MyStrategy : SingleMarketStrategy
{
    private Bars dailyBars;
    private SMA sma;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(50);
        sma = indicators.SMA(14).Keep(10).OnSeries(dailyBars.Close);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(dailyBars).Do(() =>
        {
            // Prints the current SMA value
            Log("The current SMA value is " + sma.Value.ToString());

            // Prints the previous SMA value
            Log("The previous SMA value is " + sma.Values[1].ToString());
        });
    }
}

Selecting Simple Moving Average indicator from the Indicators dropdown.