A live candle series: history plus live updates. Implements ICandleCreator, so it plugs directly into CandlePartSeries (and through it into nested indicators' SourceDataSeries). Dispose to release.
More...
|
| Task | LoadMoreHistoryAsync (int days) |
| | Deepens the loaded history to at least the given number of trading days without resubscribing. The returned task is the new Loaded. No-op (returns the current Loaded) when the series is already at least that deep. The host clamps the depth the same way as the initial request.
|
| |
| IndicatorCandle? | GetCandleByTime (DateTime time) |
| | The last candle that had started at or before the given time, or null when the series has no such candle. Binary search; call from a candle event or the chart's calculation callbacks (the list is appended on the source instrument's data thread).
|
| |
| IndicatorCandle? | GetClosedCandleByTime (DateTime time) |
| | The last candle that was already CLOSED at the given time (its successor had started at or before time ), or null when the series has no such candle. This is the anti-repaint lookup for historical calculations: the returned candle's values were fully known at time , so historical and live results match. Conservative by construction - a candle is only considered closed once the next one exists. Same threading rules as GetCandleByTime.
|
| |
|
| Action< ICandleSeriesSubscription >? | Reloaded |
| | Raised every time the series content is rebuilt: after the initial history load AND after automatic reloads (source reset on reconnect/rollover/replay transitions, deeper history). Consumers should re-read ICandleCreator.Candles and recalculate - the Loaded task instance is replaced on reloads, so a one-shot continuation on it misses them. When a reload FAILED the series is empty and Loaded is faulted with the reason. A handler attached after the series is already loaded is invoked immediately (replay-on-attach), so this event alone is sufficient to drive a consumer. Threading: fires on background/data threads, and on the attaching thread for the replay-on-attach delivery - never assume the UI thread.
|
| |
Events inherited from ATAS.Indicators.ICandleCreator |
| Action< IndicatorCandle > | OnNewCandle |
| | Event raised when a new IndicatorCandle is created.
|
| |
| Action< IndicatorCandle > | OnRemoveCandle |
| | Event raised when an IndicatorCandle is removed.
|
| |
| Action< IndicatorCandle > | OnCandleChanged |
| | Event raised when an IndicatorCandle is changed.
|
| |
A live candle series: history plus live updates. Implements ICandleCreator, so it plugs directly into CandlePartSeries (and through it into nested indicators' SourceDataSeries). Dispose to release.
The per-candle events cover LIVE updates only: history snapshots (initial load, reloads) are applied silently to ICandleCreator.Candles and signalled by Reloaded - re-read the list there instead of expecting ICandleCreator.OnNewCandle per historical candle.
Threading: ICandleCreator.OnNewCandle, ICandleCreator.OnRemoveCandle and ICandleCreator.OnCandleChanged fire on the SOURCE instrument's data-processing thread — for another instrument this is a different thread than the chart's own callbacks. Handlers must be fast (a slow handler stalls that instrument's data pipeline); use IIndicatorDataProvider.DoActionInGuiThread for UI work. Loaded continuations run by normal task-scheduling rules (thread pool), not on the source thread. Read ICandleCreator.Candles from the candle events (or copy a snapshot there) — the list is appended on the source thread.
The last candle that had started at or before the given time, or null when the series has no such candle. Binary search; call from a candle event or the chart's calculation callbacks (the list is appended on the source instrument's data thread).
LOOKAHEAD WARNING: the returned candle may still have been FORMING at time - on historical data its OHLCV are the final values, which were not known at that moment. An indicator that reads them for historical chart bars looks into the future and will repaint (its historical and live values diverge). For historical calculations use GetClosedCandleByTime; use this method for the live forming value only.