Step5. Add attributes |
To use custom indicators in charting you need to specify few attributes in your source code.
Write it directly before class definition. It specifies indicator category. Choose one of the following type:
Indicator (string fullName, string shortName, string description)
Write it directly before class definition, after IndicatorCategory. It provides some information about indicator for GUI. Fill text values according to those names.
Constructor(string description)
Place it directly before constructor which you want to use in charting. Specify one of the following classifications in description parameter:
"Point Window" – for point based constructor
"Time Window" – for time based constructor
Parameter(string description, object defaultValue)
Place it before every parameter in constructor marked before Constructor attribute. description – name of parameter which will be shown on GUI,
defaultValue – default value for this parameter. You can use null for TimeSpan.
OutputProperty(string description, ChartPlacement placement)
Mark all indicator values properties with this attribute.
description – name of property which will be shown on GUI,
placement – select one of the following values:
PriceChart – if you want this value to be drawn on chart with price (by default).
NewChart – if you want this value to be drawn on another chart (by default).