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
  • Trading application
  • Calculation
  • Parameters
  • Examples
  1. Knowledge Base
  2. Technical Indicators
  3. Oscillators

Relative Strength Index (RSI)

A momentum indicator that measures the speed and magnitude of the recent price changes of an asset, to determine if it has been overbought or oversold.

RSI is considered one of the most popular oscillators. It is a momentum indicator that measures the speed and magnitude of the recent price changes of an asset, to determine if it has been overbought or oversold.

Trading application

RSI shows values between 0 and 100, with 0 being the highest oversold conditions and 100 the highest overbought conditions. In common interpretations, if RSI shows values over 70, the indicator suggests the asset is overbought, while values under 30 suggest oversold conditions.

Divergences also reflect bullish or bearish conditions: we can consider it bearish if the asset’s price increases more than the RSI (e.g. reaching a new high while the indicator doesn’t), in the same way that it would be bullish to see the asset’s price decreasing more than the RSI does.

Calculation

RSI=100−100/(1+RS)RSI = 100 - 100/(1+RS)RSI=100−100/(1+RS)

RS = Average gain of periods which ended in profit / Average loss of periods which ended in loss

Note: Number of periods is generally set in 14.

Parameters

Input Parameters

Name

Type

Range of value

Description

period

int

<1, int.MaxValue>

Number of bars used in the calculation.

Output Parameters

Indicator ouptuts a single value.

Type

Range of value

double

(0, double.MaxValue)

Examples

// Prints the current value of a 20 period RSI using
// the daily bars close price value.
rsi = indicators.RSI(20).OnSeries(dailyBars.Close);
Log(rsi.Value.ToString());

// Evaluates if the current bar RSI value is greater than
// the value one bar ago.
rsi = indicators.RSI(20).Keep(2).OnSeries(dailyBars.Close);
if (rsi.Values[0] > rsi.Values[1]) {
    Log("RSI is rising.");
}

Complete example

using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.RSI;

public class MyStrategy : SingleMarketStrategy
{
    private Bars dailyBars;
    private RSI rsi;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(25);
        rsi = indicators.RSI(20).OnSeries(dailyBars.Close);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(dailyBars).Do(() =>
        {
            Log(rsi.Value.ToString());
        });
    }
}

PreviousMoving Average Convergence Divergence (MACD)NextStochastic RSI (STOCH RSI)

Last updated 5 years ago