CandleExpressionCondition
StockSharp.Algo.Candles.Patterns
Формула для одной свечи внутри паттерна.
Реализует: IAsyncPersistable
Конструкторы
CandleExpressionCondition
public CandleExpressionCondition(IFileSystem fileSystem, string expression)
candleExpressionCondition = CandleExpressionCondition(fileSystem, expression)
Создать экземпляр.
- fileSystem
- Файловая система.
- expression
- Выражение
Свойства
Expression
public string Expression { get; private set; }
value = candleExpressionCondition.Expression
candleExpressionCondition.Expression = value
Выражение.
Методы
CheckCondition
public bool CheckCondition(ReadOnlySpan<ICandleMessage> candles, int candleIndex)
result = candleExpressionCondition.CheckCondition(candles, candleIndex)
Проверьте, выполняется ли условие для данных свечей.
- candles
- Свечи для проверки состояния.
- candleIndex
- Индекс свечи в массиве свечей.
Возвращает: Проверьте результат.
LoadAsync
public Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = candleExpressionCondition.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.
Возвращает: A task that represents the asynchronous load operation.
PrepareAsync
public ValueTask PrepareAsync(CancellationToken cancellationToken)
result = candleExpressionCondition.PrepareAsync(cancellationToken)
Compile Expression, so that the condition can be evaluated. Repeated calls do nothing.
- cancellationToken
- CancellationToken
Возвращает: ValueTask
SaveAsync
public Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = candleExpressionCondition.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.
Возвращает: A task that represents the asynchronous save operation.
ToString
public override string ToString()
result = candleExpressionCondition.ToString()
Преобразовать к строковому представлению.
Возвращает: Строковое представление.
Поля
Variables
public static readonly Variable[] Variables
value = CandleExpressionCondition.Variables
Переменные формулы свечи.