Show / Hide Table of Contents

Interface IAlgorithm

Application interface to trading algorithms.

Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public interface IAlgorithm

Properties

| Edit this page View Source

FitnessReturn

Custom fitness value representing the return-aspect of the algorithm.

Declaration
double FitnessReturn { get; }
Property Value
Type Description
double
| Edit this page View Source

FitnessRisk

Custom fitness value representing the risk-aspect of the algorithm.

Declaration
double FitnessRisk { get; }
Property Value
Type Description
double
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

OptimizerParams

Container holding all optimizable parameters, along with their settings.

Declaration
Dictionary<string, OptimizerParam> OptimizerParams { get; }
Property Value
Type Description
Dictionary<string, OptimizerParam>
| Edit this page View Source

OptimizerParamsAsString

String representation of the current settings of all optimizable parameters.

Declaration
string OptimizerParamsAsString { get; }
Property Value
Type Description
string
| Edit this page View Source

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

| Edit this page View Source

Clone()

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

| Edit this page View Source

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()
| Edit this page View Source

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()
  • Edit this page
  • View Source
In this article
Back to top Copyright © 2011-2023, Bertram Enterprises LLC dba TuringTrader.com