Package deltix.qsrv.hf.blocks
Class BarGenerator
- java.lang.Object
-
- deltix.qsrv.hf.blocks.BarGenerator
-
public class BarGenerator extends java.lang.Object
Standard component for generating a stream ofBarMessage
.
-
-
Constructor Summary
Constructors Constructor Description BarGenerator(long inBarSize, deltix.data.stream.MessageChannel<? super deltix.timebase.api.messages.BarMessage> out)
Constructs a new instance of the bar generator.BarGenerator(deltix.util.time.Interval barSize, deltix.data.stream.MessageChannel<? super deltix.timebase.api.messages.BarMessage> out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush(long time)
Send all bars with timestamp in the past (less than specified) to the output.void
flushAll()
Send all bars to the output.long
getBarEndTime(long time)
Returns the end time of a bar which includes the specified time instant.deltix.timebase.api.messages.BarMessage
getOrCreateBar(deltix.qsrv.hf.pub.InstrumentType type, java.lang.CharSequence symbol)
void
process(long time, deltix.qsrv.hf.pub.InstrumentType type, java.lang.CharSequence symbol, double value, double size, long exchangeCode, short currencyCode)
Main method for generating a bar.void
process(deltix.qsrv.hf.pub.InstrumentMessage msg)
void
process(deltix.timebase.api.messages.BarMessage barMessage)
void
process(deltix.timebase.api.messages.BestBidOfferMessage message)
void
process(deltix.timebase.api.messages.TradeMessage tradeMessage)
void
process(deltix.timebase.api.messages.universal.PackageHeader msg)
void
setBarSize(long size)
void
setReuseBarInstances(boolean flag)
-
-
-
Constructor Detail
-
BarGenerator
public BarGenerator(deltix.util.time.Interval barSize, deltix.data.stream.MessageChannel<? super deltix.timebase.api.messages.BarMessage> out)
-
BarGenerator
public BarGenerator(long inBarSize, deltix.data.stream.MessageChannel<? super deltix.timebase.api.messages.BarMessage> out)
Constructs a new instance of the bar generator.- Parameters:
inBarSize
- Bar size in milliseconds.out
- Output channel for sending bars
-
-
Method Detail
-
setReuseBarInstances
public void setReuseBarInstances(boolean flag)
-
flushAll
public void flushAll()
Send all bars to the output.
-
setBarSize
public void setBarSize(long size)
-
flush
public void flush(long time)
Send all bars with timestamp in the past (less than specified) to the output.- Parameters:
time
- Time threshold.
-
getOrCreateBar
public deltix.timebase.api.messages.BarMessage getOrCreateBar(deltix.qsrv.hf.pub.InstrumentType type, java.lang.CharSequence symbol)
-
getBarEndTime
public long getBarEndTime(long time)
Returns the end time of a bar which includes the specified time instant.- Parameters:
time
- The closing time in question.- Returns:
- The end time of a bar which includes t.
-
process
public void process(long time, deltix.qsrv.hf.pub.InstrumentType type, java.lang.CharSequence symbol, double value, double size, long exchangeCode, short currencyCode)
Main method for generating a bar.- Parameters:
time
- Time stamp of the data point.type
- Instrument type.symbol
- Instrument symbol.value
- Data value to track.size
- Optional size (used with trades).
-
process
public void process(deltix.qsrv.hf.pub.InstrumentMessage msg)
-
process
public void process(deltix.timebase.api.messages.TradeMessage tradeMessage)
-
process
public void process(deltix.timebase.api.messages.BestBidOfferMessage message)
-
process
public void process(deltix.timebase.api.messages.BarMessage barMessage)
-
process
public void process(deltix.timebase.api.messages.universal.PackageHeader msg)
-
-