Summary
Base class for Indicators.
Remarks
Contains all necessary market information, provides access to built-in indicators and provides framework for
convenient indicators' creation.
Syntax
public class Indicator : Algo, IIndicator
Members
Name | Type | Summary |
---|---|---|
Account | Property | Contains information of the current account. |
Calculate | Method | Calculate the value(s) of indicator for the given index. |
Indicator | Method | Indicator class constructor |
IndicatorArea | Property | Defines the area where the indicator is placed. |
Initialize | Method | Custom initialization for the Indicator. This method is invoked when an indicator is launched. |
IsLastBar | Property | Returns true, if Calculate is invoked for the last bar |
ToString | Method | The name of the indicator derived class. |
Example 1
//... public override void Calculate(int index) { //This is where we place our indicator's calculation logic. } //...
Example 2
//... protected override void Initialize() { //Place your Initialization logic here } //...
Example 3
private IndicatorDataSeries input; protected override void Initialize() { input = CreateDataSeries(); } public override void Calculate(int index) { input[index] = (MarketSeries.Close[index] + MarketSeries.Open[index]) / 2; }
Example 4
//... public override void Calculate(int index) { if (IsRealTime) { //Place the code-logic that you want to be calculated on incoming live data } } //...