Show / Hide Table of Contents

    Class Strategy

    The base class for strategies

    Namespace: TradingPlatform.BusinessLayer
    Syntax
    public abstract class Strategy : ExecutionEntity, ICustomizable, IXElementSerialization, IConnectionStateDependent

    Constructors

    Strategy()

    Declaration
    protected Strategy()

    Properties

    Id

    Unique ID of the strategy

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    System.String

    InstanceName

    Declaration
    public string InstanceName { get; set; }
    Property Value
    Type Description
    System.String

    MonitoringConnectionsIds

    Declaration
    public virtual string[] MonitoringConnectionsIds { get; }
    Property Value
    Type Description
    System.String[]

    NewVersionAvailable

    Declaration
    public bool NewVersionAvailable { get; }
    Property Value
    Type Description
    System.Boolean

    Settings

    Declaration
    public override IList<SettingItem> Settings { get; set; }
    Property Value
    Type Description
    IList<TradingPlatform.BusinessLayer.SettingItem>
    Overrides
    TradingPlatform.BusinessLayer.ExecutionEntity.Settings

    State

    The current state of the strategy

    Declaration
    public StrategyState State { get; }
    Property Value
    Type Description
    StrategyState

    Methods

    GetConnectionStateDependency()

    Declaration
    public ConnectionDependency GetConnectionStateDependency()
    Returns
    Type Description
    TradingPlatform.BusinessLayer.ConnectionDependency

    GetLogs(DateTime, DateTime)

    Get logs from the strategy for specified date range

    Declaration
    public StrategyLoggerEvent[] GetLogs(DateTime from, DateTime to)
    Parameters
    Type Name Description
    DateTime from
    DateTime to
    Returns
    Type Description
    TradingPlatform.BusinessLayer.StrategyLoggerEvent[]

    GetMetrics()

    Get current metrics from the strategy

    Declaration
    public List<StrategyMetric> GetMetrics()
    Returns
    Type Description
    List<StrategyMetric>

    Log(String, StrategyLoggingLevel)

    Write log message

    Declaration
    protected void Log(string message, StrategyLoggingLevel level = StrategyLoggingLevel.Info)
    Parameters
    Type Name Description
    System.String message
    StrategyLoggingLevel level

    OnCreated()

    Declaration
    protected virtual void OnCreated()

    OnGetMetrics()

    Declaration
    protected virtual List<StrategyMetric> OnGetMetrics()
    Returns
    Type Description
    List<StrategyMetric>

    OnRemove()

    Declaration
    protected virtual void OnRemove()

    OnRun()

    Declaration
    protected virtual void OnRun()

    OnStop()

    Declaration
    protected virtual void OnStop()

    Remove()

    Remove the strategy

    Declaration
    public void Remove()

    Run()

    Run strategy

    Declaration
    public void Run()

    Stop()

    Stop strategy

    Declaration
    public void Stop()

    Events

    NewLog

    Event occured when strategy write a new log

    Declaration
    public event StrategyEventHandler NewLog
    Event Type
    Type Description
    TradingPlatform.BusinessLayer.StrategyEventHandler

    SettingsChanged

    Event occured if any of strategy settings was changed

    Declaration
    public event Action<Strategy> SettingsChanged
    Event Type
    Type Description
    Action<Strategy>
    Back to top Copyright QUANTOWER LLC. © 2017-2021. All rights reserved.