DiagramStrategy

StockSharp.Diagram

The strategy whose algorithm is presented in the form of a diagram.

Inherits: Strategy

Implements: INotifyPropertiesChanged

Constructors

DiagramStrategy
public DiagramStrategy()
diagramStrategy = DiagramStrategy()

Initializes a new instance of the DiagramStrategy.

Properties

Composition
public CompositionDiagramElement Composition { get; set; }
value = diagramStrategy.Composition
diagramStrategy.Composition = value

The strategy diagram. Settings loaded before a diagram was set are applied by CancellationToken), or at the start of the strategy.

HistoryCalculated
protected override TimeSpan? HistoryCalculated { get; }
value = diagramStrategy.HistoryCalculated

The history period required before the strategy can start, or .

OrderBookSources
public override IEnumerable<IOrderBookSource> OrderBookSources { get; }
value = diagramStrategy.OrderBookSources

Order book sources used by the strategy.

OverflowLimit
public int OverflowLimit { get; set; }
value = diagramStrategy.OverflowLimit
diagramStrategy.OverflowLimit = value

Max allowed elements per iteration to prevent stack overflow.

StartSecurities
internal IReadOnlyList<Security> StartSecurities { get; }
value = diagramStrategy.StartSecurities

Securities the diagram refers to at the start: Security and the security values of the elements' parameters, resolved through the security provider. Available to the elements from CancellationToken).

Methods

CopyToAsync
protected override ValueTask CopyToAsync(Strategy copy, CancellationToken cancellationToken)
result = diagramStrategy.CopyToAsync(copy, cancellationToken)

Copy settings into .

copy
Strategy
cancellationToken
CancellationToken

Returns: ValueTask

DisposeManaged
protected override void DisposeManaged()
diagramStrategy.DisposeManaged()

Disposes the managed resources. Override this method to add custom clean up of managed resources.

Flush
public void Flush(DateTime time)
diagramStrategy.Flush(time)

Flush non trigger (root) elements.

Flush``1
public void Flush<TMessage>(TMessage message)
diagramStrategy.Flush(message)

Flush non trigger (root) elements.

GetWorkingPortfolios
public override IEnumerable<Portfolio> GetWorkingPortfolios()
result = diagramStrategy.GetWorkingPortfolios()

Get all portfolios required for strategy.

Returns: Portfolios.

LoadAsync
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = diagramStrategy.LoadAsync(storage, cancellationToken)

Load settings.

storage
SettingsStorage
cancellationToken
CancellationToken

Returns: Task

OnReseted
protected override void OnReseted()
diagramStrategy.OnReseted()

The method is called at the strategy reset.

OnStarted2
protected override void OnStarted2(DateTime time)
diagramStrategy.OnStarted2(time)

The method is called when the strategy has entered the started state.

time
The strategy start time.
OnStartedAsync
protected override ValueTask OnStartedAsync(DateTime time, CancellationToken cancellationToken)
result = diagramStrategy.OnStartedAsync(time, cancellationToken)

The method is called when the strategy has entered the started state, before DateTime). An exception stops the strategy the same way as one thrown from DateTime).

time
The strategy start time.
cancellationToken
Cancellation token.

Returns: ValueTask

OnStopped
protected override void OnStopped()
diagramStrategy.OnStopped()

The method is called when the strategy has entered the stopped state.

RaisePropertiesChanged
protected virtual void RaisePropertiesChanged()
diagramStrategy.RaisePropertiesChanged()

To call the available properties change event.

SaveAsync
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = diagramStrategy.SaveAsync(storage, cancellationToken)

Save settings.

storage
SettingsStorage
cancellationToken
CancellationToken

Returns: Task

SetCompositionAsync
public ValueTask SetCompositionAsync(CompositionDiagramElement composition, CancellationToken cancellationToken)
result = diagramStrategy.SetCompositionAsync(composition, cancellationToken)

Set Composition and apply to it the settings loaded before it was set.

composition
The strategy diagram.
cancellationToken
CancellationToken

Returns: ValueTask

Events

CompositionChanged
public event Action<CompositionDiagramElement> CompositionChanged
diagramStrategy.CompositionChanged += handler

The strategy diagram change event.

PropertiesChanged
public event Action PropertiesChanged
diagramStrategy.PropertiesChanged += handler

The available properties change event.