Trader.NET APIs

To write a custom indicator, you must derive from the base class Indicator. The calculation must be provided in the Calculate method. There are two custom attributes designed to denote a property. They are IndicatorParameterAttribute and IndicatorValueAttribute. To provide customizable color for each indicator series, additional properties (type of SerializableColor) must be provided. The property name must follow the naming convention "PropertyNameColor". For implementation details, please refer to the sample script Stochastic.

All scripts must be placed in the Scripts folder and they can be compiled successfully either using .NET compiler or the built-in Script Manager. The built-in Script Manager does not use any external library you may use. If you use any third party library in your script, you have to compile it externally. Please refer to your compiler command manual for more details. You will have to reference TraderCharting.exe at least plus any other references you need to use. Once compiled externally, you can copy the DLL to the Plugins folder.

All indicators work with three kinds of data: Series, TimeSeries and Quotes based on the Visitor design pattern.


Supported data types:

  • Trader.Data.Frequency: An enum for time frame.
  • Trader.Data.Series: An array of doubles, our basic data structure.
  • Trader.Data.Quotes: An array of quotes with open, close, high, low, volume and timestamp.
  • Trader.Data.TimeSeries: An array of timestamps.

  • Base classes:
  • Trader.Study.Indicator: All indicators must derive from.
  • Trader.Study.Indicator.ChartPosition: An enum to indicate where to plot in a chart.

  • Built-in Indicators:
  • Trader.Study.SMA: Simple Moving Average
  • Trader.Study.EMA: Exponential Moving Average
  • Trader.Study.Sum: Sum
  • Trader.Study.StdDev: Standard Sample Deviation
  • Built-in scripts:
  • Trader.Study.VolumePlus: Volume Average
  • Trader.Study.BollingerBand: Bollinger Band
  • Trader.Study.Stochastic: Full Stochastic
  • Trader.Study.FastStochastic: Fast Stochastic
  • Trader.Study.SlowStochastic: Slow Stochastic
  • Trader.Study.RSI: RSI
  • Trader.Study.MACD: MCAD