Enum OrderBookGetMode
- Namespace
- WhalesSecret.TradeScriptLib.Entities.MarketData
- Assembly
- WhalesSecret.TradeScriptLib.dll
Options regarding obtaining OrderBook snapshots.
public enum OrderBookGetMode
- Extension Methods
Fields
FailIfNotAvailable = 0
Gets the latest order book snapshot or fails if none is available.
This option involves no waiting or delaying. Either an order book snapshot can be returned or not.
If there is no order book data to return an order book snapshot, the operation fails. This might happen if an exchange reports back that an order book update subscription was created but the exchange does not immediately send actual order book data.
This option might be considered more low-level than the remaining ones.
WaitIfNotAvailable = 1
Gets the latest order book snapshot immediately or waits until an order book snapshot can be returned.
The option makes sure that there is actually an order book snapshot to return. This means that Whale's Secret waits behind the scenes until an order book snapshot is available and returns it then. An advantage for trade scripts is that no extra error handling is necessary.
Getting the first order book snapshot might be, in rare circumstances, somewhat slower but the subsequent order book snapshot requests should be handled without any delay.
Note that this option does not guarantee that the returned consecutive order book snapshots are not the same. If you, for example, request to get order book snapshots in a loop with 50 milliseconds period, it may happen that two consecutive order book snapshots are the same as the order book has not changed in any way.
WaitUntilNew = 2
Gets the latest order book snapshot as soon as the exchange informs about order book change.
The option is more strict than WaitIfNotAvailable because it mandates that an order book snapshot can be returned only when a new order book change was reported by the corresponding exchange after our previous request.