CandleFeed#
API documentation for tradingstrategy.direct_feed.candle_feed.CandleFeed Python class in Trading Strategy framework.
- class CandleFeed[source]#
Bases:
object
Create candles for certain time frame for multiple pairs.
Takes
TradeFeed
as inputGenerates candles based on this feed
Can only generate candles of one timeframe
May contain multiple pairs in one candle feed
Methods
__init__
(pairs, timeframe)- param pairs:
apply_delta
(delta[, initial_load, label_candles])Add new candle data generated from the latest blockchain input.
get_candles_by_pair
(pair)Get overall last block number for which we have valid data.
Get candles for all pairs we are tracking.
- apply_delta(delta, initial_load=False, label_candles=True)[source]#
Add new candle data generated from the latest blockchain input.
- Parameters:
delta (TradeDelta) – New trades coming in
initial_load –
This is not an incremental snapshot, but initial buffer fill.
Ignore delta.start_ts and fill the candle buffer as long as we get data.
label_candles –
Create and update label column.
Label column contains tooltips for the visual candle viewer. This must be done before candle data is grouped by pairs.