NinjaScriptPropertyAttribute
<< Click to Display Table of Contents >> NinjaScriptPropertyAttribute |
Determines if the following declared property should be included in the NinjaScript object's constructor as a parameter. This is useful if you plan on calling a NinjaScript object from another (e.g., calling a custom indicator from a strategy) or customizing the display parameter data on a grid or from a chart. This also used to make parameters optimizable in the Strategy Analyzer.
Warning: Only types which can be Xml Serialized should be marked as a NinjaScriptAttribute, otherwise you may run into errors when persisting values in various scenarios (e.g., saving workspace, or running Strategy Optimizations). Should you have a property you wish to use as user defined input, you will need to implement a secondary simple type (such as an int or string) as the value to be serialized as user input. Please see the example below which demonstrates using a simple type as the NinjaScriptProperty against types which cannot be serialized |
[NinjaScriptProperty]
Basic usage of NinjaScriptProperty |
---|
#region Properties |
Using a simple type as the NinjaScriptProperty against types which cannot be serialized |
---|
[XmlIgnore] // cannot serialize type of TimeSpan, use the BeginTimeSpanSerialize object to persist properties |