IcebergAlgo
Iceberg - keep one resting limit order with only DisplayVolume visible. When the displayed slice fills, the algo emits the next slice at the same price (until total volume is exhausted or it is cancelled). Pure venue-agnostic implementation: the algo doesn't ask the venue for native iceberg support; it manages the slicing itself by re-registering after each fill. Native-iceberg venues stay compatible (the algo simply runs one slice end-to-end and then is finished if the venue accepted the bulk size - but most regulated venues now ban naked icebergs, so client-side slicing is the portable path).
Implementa: IPositionModifyAlgo, IDisposable
Constructores
public IcebergAlgo(Sides side, decimal totalVolume, decimal displayVolume, decimal limitPrice)
icebergAlgo = IcebergAlgo(side, totalVolume, displayVolume, limitPrice)
Initializes a new instance of the IcebergAlgo.
- side
- Order side.
- totalVolume
- Total volume to execute.
- displayVolume
- How much of the total is shown at a time.
- limitPrice
- Price every slice rests at.
Propiedades
public decimal DisplayVolume { get; }
value = icebergAlgo.DisplayVolume
How much of the total is shown at a time.
public bool IsFinished { get; }
value = icebergAlgo.IsFinished
Whether the algorithm has finished.
public decimal LimitPrice { get; }
value = icebergAlgo.LimitPrice
Price every slice rests at.
public decimal RemainingVolume { get; }
value = icebergAlgo.RemainingVolume
Remaining volume to execute.
public decimal TotalVolume { get; }
value = icebergAlgo.TotalVolume
Total volume to execute.
Métodos
public void Dispose()
icebergAlgo.Dispose()
Disposes of items in the pool that implement IDisposable.
public PositionModifyAction GetNextAction()
result = icebergAlgo.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.
public void OnOrderCanceled(decimal matchedVolume)
icebergAlgo.OnOrderCanceled(matchedVolume)
Notify that an order was canceled.
- matchedVolume
- Volume that traded since the previous notification and before cancellation.
public void OnOrderFailed()
icebergAlgo.OnOrderFailed()
Notify that an order failed. Nothing traded.
public void OnOrderMatched(decimal matchedVolume)
icebergAlgo.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.
public void UpdateMarketData(DateTime time, decimal? price, decimal? volume)
icebergAlgo.UpdateMarketData(time, price, volume)
Update market data.
- time
- Current time.
- price
- Last trade price.
- volume
- Last trade volume.
public void UpdateOrderBook(IOrderBookMessage depth)
icebergAlgo.UpdateOrderBook(depth)
Update order book data.
- depth
- Order book.