data fixes; indicator=>workspace sync
This commit is contained in:
@@ -180,15 +180,20 @@ export class KafkaProducer {
|
||||
status: metadata.status || 'OK',
|
||||
errorMessage: metadata.error_message
|
||||
},
|
||||
rows: ohlcData.map(candle => ({
|
||||
timestamp: candle.timestamp,
|
||||
ticker: candle.ticker,
|
||||
open: candle.open,
|
||||
high: candle.high,
|
||||
low: candle.low,
|
||||
close: candle.close,
|
||||
volume: candle.volume
|
||||
}))
|
||||
rows: ohlcData.map(candle => {
|
||||
// null open/high/low/close signals a gap bar (no trades that period).
|
||||
// Omit fields from the protobuf message when null so hasOpen() etc. return false.
|
||||
const row = {
|
||||
timestamp: candle.timestamp,
|
||||
ticker: candle.ticker,
|
||||
};
|
||||
if (candle.open != null) row.open = candle.open;
|
||||
if (candle.high != null) row.high = candle.high;
|
||||
if (candle.low != null) row.low = candle.low;
|
||||
if (candle.close != null) row.close = candle.close;
|
||||
if (candle.volume != null) row.volume = candle.volume;
|
||||
return row;
|
||||
})
|
||||
};
|
||||
|
||||
// Encode as protobuf OHLCBatch with ZMQ envelope
|
||||
|
||||
Reference in New Issue
Block a user