using TradingPlatform.BusinessLayer;
namespace IndicatorWithBuiltIn
public class IndicatorWithBuiltIn : Indicator
/// Indicator's constructor. Contains general information: name, description, LineSeries etc.
public IndicatorWithBuiltIn()
// Defines indicator's name and description.
Name = "IndicatorWithBuiltIn";
// Defines line on demand with particular parameters.
AddLineSeries("line1", Color.CadetBlue, 1, LineStyle.Solid);
// By default indicator will be applied on main window of the chart
/// This function will be called after creating an indicator as well as after its input params reset or chart (symbol or timeframe) updates.
protected override void OnInit()
// Create first instance of EMA indicator with Period 12
fastEMA = Core.Indicators.BuiltIn.EMA(12, PriceType.Open);
// Create second instance of EMA indicator with period 26
slowEMA = Core.Indicators.BuiltIn.EMA(26, PriceType.Open);
/// Calculation entry point. This function is called when a price data updates.
protected override void OnUpdate(UpdateArgs args)
double difference = fastEMA.GetValue() - slowEMA.GetValue();
// Use difference as a value for parent indicator