|
| std::shared_ptr< Builder > | withFeed (std::shared_ptr< DXFeed > feed) |
| | Sets the DXFeed for the model being created.
|
| std::shared_ptr< Builder > | withSymbol (const SymbolWrapper &symbol) |
| | Sets the subscription symbol for the model being created.
|
| std::shared_ptr< Builder > | withListener (std::shared_ptr< MarketDepthModelListener< O > > listener) |
| | Sets the listener for transaction notifications.
|
| std::shared_ptr< Builder > | withListener (std::function< void(const std::vector< std::shared_ptr< O > > &, const std::vector< std::shared_ptr< O > > &)> onEventsReceived) |
| | Creates and sets the listener for transaction notifications.
|
| template<typename EventSourceIt> |
| std::shared_ptr< Builder > | withSources (EventSourceIt begin, EventSourceIt end) |
| | Sets the sources from which to subscribe for indexed events.
|
| template<ConvertibleToEventSourceWrapperCollection EventSourceCollection> |
| std::shared_ptr< Builder > | withSources (EventSourceCollection &&sources) |
| | Sets the sources from which to subscribe for indexed events.
|
| std::shared_ptr< Builder > | withSources (std::initializer_list< EventSourceWrapper > sources) |
| | Sets the sources from which to subscribe for indexed events.
|
| std::shared_ptr< Builder > | withDepthLimit (std::size_t depthLimit) |
| | Sets the depth limit.
|
| std::shared_ptr< Builder > | withAggregationPeriod (std::int64_t aggregationPeriodMillis) |
| | Sets the aggregation period.
|
| std::shared_ptr< Builder > | withAggregationPeriod (std::chrono::milliseconds aggregationPeriod) |
| | Sets the aggregation period.
|
| std::shared_ptr< Builder > | withCrossedBookWarning (bool enabled, std::chrono::milliseconds period=std::chrono::minutes{1}) |
| | Enables or disables the warning on a crossed book (see Crossed book).
|
| std::shared_ptr< MarketDepthModel > | build () |
| | Builds an instance of MarketDepthModel based on the provided parameters.
|
| template<typename T> |
| bool | is () const noexcept |
| | Checks that the object is of type T: its dynamic type is T or derived from T.
|
| template<typename T> |
| std::shared_ptr< T > | sharedAs () noexcept |
| | Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
|
| template<typename T> |
| std::shared_ptr< T > | sharedAs () const noexcept |
| | Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
|
| virtual std::string | toString () const |
| | Returns a string representation of the current object.
|
|
virtual | ~Entity () noexcept |
| | The default virtual d-tor.
|
template<Derived<
OrderBase > O>
struct MarketDepthModel< O >::Builder
A builder class for creating an instance of MarketDepthModel.
| std::shared_ptr< Builder > MarketDepthModel< O >::Builder::withCrossedBookWarning |
( |
bool | enabled, |
|
|
std::chrono::milliseconds | period = std::chrono::minutes{1} ) |
|
inline |
Enables or disables the warning on a crossed book (see Crossed book).
When the check is enabled, the model compares the best buy order with the best sell order of the whole book after each transaction, whatever the depth limit. If the price of the best buy order is above the price of the best sell order, the model reports a warning with ErrorManager::reportWarning() (the component MarketDepthModel): the symbol, the source and the price of both orders. Equal prices are not reported. The first crossing is reported at once, the next ones at most once per period, with the number of the transactions with a crossed book since the previous warning.
- Parameters
-
| enabled | true to enable the check. |
| period | The minimum time between two warnings of this model (1 minute by default); 0 reports every crossing. |
- Returns
- The builder instance.