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

Market order with total price #54

Closed sc-starman closed 1 year ago

sc-starman commented 1 year ago

Hi I wonder what is the best way to add market orders with total price instead of quantity. let's say I want $2000 of something but don't care about how much I get in return.

ArjunVachhani commented 1 year ago

@sc-starman you can do this for market buy order and stop loss market buy. for sell side this feature is not available

Maket Buy Order : Order marketBuy = new Order { IsBuy = true, Price = 0, OrderId = 12345, OrderAmount = 2000 };

Stop Market Buy Order: Order stopMarketBuy = new Order { IsBuy = true, Price = 0, OrderId = 12345, StopPrice = 20900, OrderAmount = 2000 };