Interface IAlgorithm
Application interface to trading algorithms.
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public interface IAlgorithm
Properties
| Improve this Doc View SourceFitnessReturn
Custom fitness value representing the return-aspect of the algorithm.
Declaration
double FitnessReturn { get; }
Property Value
Type | Description |
---|---|
double |
FitnessRisk
Custom fitness value representing the risk-aspect of the algorithm.
Declaration
double FitnessRisk { get; }
Property Value
Type | Description |
---|---|
double |
FitnessValue
Custom fitness value representing a blend of return and risk. Algorithms should use this, to report the fitness of the current algorithm settings to the optimizer. Outside of optimization, this field has no relevance.
Declaration
double FitnessValue { get; }
Property Value
Type | Description |
---|---|
double |
IsDataSource
Field indicating if this algorithm instance is used as a data source. Algorithms should use this to reduce unnecessary calculations and output, to speed up calculation and conserve memory.
Declaration
bool IsDataSource { set; }
Property Value
Type | Description |
---|---|
bool |
IsOptimizerParamsValid
Check, if current parameter set is valid. This is used to weed out illegal parameter combinations during grid optimization.
Declaration
bool IsOptimizerParamsValid { get; }
Property Value
Type | Description |
---|---|
bool | true, if parameter set valid |
IsOptimizing
Field indicating if this algorithm instance is being optimized. Algorithms should use this to reduce unnecessary calculations and output, to speed up optimization and conserve memory.
Declaration
bool IsOptimizing { set; }
Property Value
Type | Description |
---|---|
bool |
Name
Return class type name. This method will return the name of the derived class, typically a proprietary algorithm derived from Algorithm.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
OptimizerParams
Container holding all optimizable parameters, along with their settings.
Declaration
Dictionary<string, OptimizerParam> OptimizerParams { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<TKey, TValue><string, OptimizerParam> |
OptimizerParamsAsString
String representation of the current settings of all optimizable parameters.
Declaration
string OptimizerParamsAsString { get; }
Property Value
Type | Description |
---|---|
string |
Progress
Progress indicator, ranging from 0 to 100. This progress indicator is based on the time stamp of the current bar being processed, which may or may not be a good indicator of CPU time.
Declaration
double Progress { get; }
Property Value
Type | Description |
---|---|
double |
Methods
| Improve this Doc View SourceClone()
Clone algorithm, including all optimizer parameters. The application uses this method to clone the 'master' instance, and create new algorithm instances before running them.
Declaration
IAlgorithm Clone()
Returns
Type | Description |
---|---|
IAlgorithm | new algorithm instance |
Report()
Create report. This method can be called after calling Run(), to create and display a custom report. Typically, trading algorithms override this method with their own implementation. Algorithms are not required to call the base class implementation of this method.
Declaration
void Report()
Run()
Entry point for trading algorithm. This method is called only once per instance. Nonetheless, care should be taken that the implementation of this method initializes/ resets all parameters, to allow multiple runs.
Declaration
void Run()