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

Logs

Use logs to debug and analyze the behavior of your strategy.

Your strategy can easily generate log output by using the Log() method. Log output appears in the backtest result page - if you are running a backtest - or the strategy detail page - if the strategy is deployed, below the charts section under the "Logs" tab.

Example

Let's say we have a strategy which triggers and action every single day:

public override void RegisterActions()
{
    OnUpdateOf(dayBars).Do(() =>
    {
        // define action
    });
}

Now let's say that we would like to output a "Hello world" message each time the registered action is triggered. We also would like to know what the date is in the log, so we will use the Market object to add time information into our log.

public override void RegisterActions()
{
    OnUpdateOf(dayBars).Do(() =>
    {
        Log($"Hello world. Today is {Time}.");
    });
}

Now, when you run the backtest for two days, you will find two your logs in the backtest result page. You can identify your logs by the severity code set to DEBUG.

Complete example
using Signals.DataSeries.Bars;
using Signals.Framework;

public class MyStrategy : SingleMarketStrategy
{
    private Bars dayBars;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        dayBars = data.Bars(BarPeriodType.Day, 1).WithOffset(25);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(dayBars).Do(() =>
        {
            Log($"Hello world. Today is {Time}.");
        });
    }
}

PreviousDataNextKnowledge Base

Last updated 5 years ago