NbboAlgo

StockSharp.Algo.PositionManagement

NBBO peg - keep one resting limit order at the National Best Bid (for buys) or National Best Ask (for sells). On every top-of-book move the algo cancels the working order and re-pegs at the new best. Used to provide passive liquidity at the touch without crossing the spread. The slice size SliceVolume is constant per round-trip; after a fill (or partial fill on cancel) the algo resumes with whatever volume is left until it reaches TotalVolume. "NBBO" historically refers to the consolidated SIP feed in US markets; here it is the best price the configured market-data feed reports, so the caller is responsible for pointing the feed at the right consolidator (or single venue for non-US instruments). A crossed book (best bid above best ask) is quoted like any other: the slice goes to the best price on the side the algo works, which is the only touch it has. While the side it works carries no quote at all no new slice is sent, and an order already resting keeps its place until a best shows up again.

Implementa: IPositionModifyAlgo, IDisposable

Constructores

NbboAlgo
public NbboAlgo(Sides side, decimal totalVolume, decimal sliceVolume)
nbboAlgo = NbboAlgo(side, totalVolume, sliceVolume)

Initializes a new instance of the NbboAlgo.

side
Order side.
totalVolume
Total volume to execute.
sliceVolume
Size of a single resting slice.

Propiedades

CurrentBestPrice
public decimal? CurrentBestPrice { get; }
value = nbboAlgo.CurrentBestPrice

Best price last seen on the side the algo pegs to, or before any book arrived.

IsFinished
public bool IsFinished { get; }
value = nbboAlgo.IsFinished

Whether the algorithm has finished.

RemainingVolume
public decimal RemainingVolume { get; }
value = nbboAlgo.RemainingVolume

Remaining volume to execute.

Side
public Sides Side { get; }
value = nbboAlgo.Side

Order side.

SliceVolume
public decimal SliceVolume { get; }
value = nbboAlgo.SliceVolume

Size of a single resting slice.

TotalVolume
public decimal TotalVolume { get; }
value = nbboAlgo.TotalVolume

Total volume to execute.

Métodos

Cancel
public void Cancel()
nbboAlgo.Cancel()

Cancel the current algo execution.

Dispose
public void Dispose()
nbboAlgo.Dispose()

Disposes of items in the pool that implement IDisposable.

GetNextAction
public PositionModifyAction GetNextAction()
result = nbboAlgo.GetNextAction()

Get the next action to take. The call advances the algorithm: a returned Register counts as dispatched, so the caller places it and reports back through Decimal), OnOrderFailed or Decimal). An action that is discarded leaves the algorithm waiting for a report that never comes.

OnOrderCanceled
public void OnOrderCanceled(decimal matchedVolume)
nbboAlgo.OnOrderCanceled(matchedVolume)

Notify that an order was canceled.

matchedVolume
Volume that traded since the previous notification and before cancellation.
OnOrderFailed
public void OnOrderFailed()
nbboAlgo.OnOrderFailed()

Notify that an order failed. Nothing traded.

OnOrderMatched
public void OnOrderMatched(decimal matchedVolume)
nbboAlgo.OnOrderMatched(matchedVolume)

Notify that an order was matched.

matchedVolume
Volume that traded since the previous notification for this order: a caller reporting every partial fill passes the increment, one reporting only the end passes the whole traded volume. The same volume is never reported twice.
UpdateMarketData
public void UpdateMarketData(DateTime time, decimal? price, decimal? volume)
nbboAlgo.UpdateMarketData(time, price, volume)

Update market data.

time
Current time.
price
Last trade price.
volume
Last trade volume.
UpdateOrderBook
public void UpdateOrderBook(IOrderBookMessage depth)
nbboAlgo.UpdateOrderBook(depth)

Update order book data.

depth
Order book.