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. Properties

Markets

Array of Market objects in Multi Market Strategies that reveals information about all selected markets.

PreviousMarketNextPendingOrders

Last updated 5 years ago

In Multi Markets Strategy, Markets is a property of type containing all the selected markets. You can access a concrete market with array index operator - Markets[0] for first selected market, Markets[1] for second etc. as you can see in the editor's sidebar.

// Write current price of the first market in the list of selected markets to the logs
Log("Current price of " + Markets[0].Asset + " on " + Markets[0].Exchange + ": " + Markets[0].CurrentPrice);

// Write current price of the second market in the list of selected markets to the logs
Log("Current price of " + Markets[1].Asset + " on " + Markets[1].Exchange + ": " + Markets[1].CurrentPrice);
using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.SMA;

public class MyStrategy : MultiMarketsStrategy
{
    private Bars hourlyBarsFirstAsset;
    private Bars hourlyBarsSecondAsset;

    private Market firstMarket;
    private Market secondMarket;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        firstMarket = Markets[0];
        secondMarket = Markets[1];

        hourlyBarsFirstAsset = data.Bars(BarPeriodType.Hour, 1).OnMarket(firstMarket).WithOffset(25);
        hourlyBarsSecondAsset = data.Bars(BarPeriodType.Hour, 1).OnMarket(secondMarket).WithOffset(25);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(hourlyBarsFirstAsset).Do(() =>
        {
            Log("Current price of " + firstMarket.Asset + " on " + firstMarket.Exchange + ": " + firstMarket.CurrentPrice);
        });

        OnUpdateOf(hourlyBarsSecondAsset).Do(() =>
        {
            Log("Current price of " + secondMarket.Asset + " on " + secondMarket.Exchange + ": " + secondMarket.CurrentPrice);
        });
    }
}
Market[]