ArjunVachhani / order-matcher

simple, fast and feature rich order matching engine supports limit, market, stop-loss, iceberg, IOC, FOK, GTD orders
MIT License
137 stars 70 forks source link

Incorrect order deserialization #30

Closed avatar-92 closed 3 years ago

avatar-92 commented 3 years ago

In class OrderSerializerTests test Deserialize_Doesnotthrowexception I see creating order with OpenQuantity = 546 but on line 204 Assert.Equal((Quantity)2356, order.OpenQuantity);

Is it mistake in test and deserialization wrong?

avatar-92 commented 3 years ago

What is difference between TotalQuantity, OpenQuantity, TipQuantity?

ArjunVachhani commented 3 years ago

For Non Iceberg orders

You need to set only OpenQuantity for non iceberg orders. You don't need to set TipQuantity and an TotalQuantity for non iceberg orders. OpenQuantity means quantity user wants to buy/sell. Ideally you would set OpenQuantity to quantiy user wants to buy/sell. After restart suppose you want to re initialize order book, You need to set OpenQuantity as remaining quantity for the order.

For Iceberg orders

You need to set TipQuantity and an TotalQuantity for iceberg orders. You don't need to set OpenQuantity for iceberg orders. TotalQuantity means quantity user want to buy/sell. TipQuantity means quantity of each tip added to orderbook. Ideally you would set TotalQuantity to quantiy user wants to buy/sell. After restart suppose you want to re initialize order book, You need to set TotalQuantity as remaining quantity for the order.

avatar-92 commented 3 years ago

Thanks for the comment