RiskRule
StockSharp.Algo.Risk
Base risk-rule.
Implements: IRiskRule, IAsyncPersistable, INotifyPropertyChanged
Constructors
Properties
Action
public RiskActions Action { get; set; }
value = riskRule.Action
riskRule.Action = value
Action.
Title
public string Title { get; private set; }
value = riskRule.Title
riskRule.Title = value
Header.
Methods
LoadAsync
public virtual Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = riskRule.LoadAsync(storage, cancellationToken)
Asynchronously loads the state of the object from the specified SettingsStorage.
- storage
- The SettingsStorage instance from which to load the data.
- cancellationToken
- A token to monitor for cancellation requests.
Returns: A task that represents the asynchronous load operation.
ProcessMessage
public abstract bool ProcessMessage(Message message)
result = riskRule.ProcessMessage(message)
To process the trade message.
- message
- The trade message.
Returns: , if the rule is activated, otherwise, .
SaveAsync
public virtual Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = riskRule.SaveAsync(storage, cancellationToken)
Asynchronously saves the state of the object to the specified SettingsStorage.
- storage
- The SettingsStorage instance to which to save the data.
- cancellationToken
- A token to monitor for cancellation requests.
Returns: A task that represents the asynchronous save operation.