- Open any java IDE (IntelliJ)
- Direct into src folder
- Run StockApp
Action: BUY SNAP LMT $30 100
You have placed a limit buy order for 100 SNAP shares at $30.00 each.
Action: VIEW ORDERS
- SNAP LMT BUY $30.00 0/100 PENDING
Action: BUY FB MKT 20
You have placed a market order for 20 FB shares.
Action: VIEW ORDERS
- SNAP LMT BUY $30.00 0/100 PENDING
- FB MKT BUY 0/20 PENDING
Action: SELL FB LMT $20.00 20
You have placed a limit sell order for 20 FB shares at $20.00 each
Action: VIEW ORDERS
- SNAP LMT BUY $30.00 0/100 PENDING
- FB MKT BUY $20.00 20/20 FILLED
- FB LMT SELL $20.00 20/20 FILLED
Action: SELL SNAP MKT 20
You have placed a market sell order for 20 SNAP shares at $30.00 each
Action: VIEW ORDERS
- SNAP LMT BUY $30.00 20/100 PARTIAL
- FB MKT BUY $20.00 20/20 FILLED
- FB LMT SELL $20.00 20/20 FILLED
- SNAP MKT SELL $30.0 20/20 FILLED
Action: SELL SNAP LMT $31.00 10
You have placed a limit sell order for 10 SNAP shares at $31.00 each
Action: VIEW ORDERS
- SNAP LMT BUY $30.00 20/100 PARTIAL
- FB MKT BUY $20.00 20/20 FILLED
- FB LMT SELL $20.00 20/20 FILLED
- SNAP MKT SELL $30.0 20/20 FILLED
- SNAP LMT SELL $31.0 0/10 PENDING
Action: QUOTE SNAP
SNAP BID: $30.00 ASK: $31.00 LAST: $30.00
Action: SELL SNAP LMT $30.00 100
You have placed a limit sell order for 100 SNAP shares at $30.0 each.
Action: VIEW ORDERS
- SNAP LMT BUY $30.0 100/100 FILLED
- FB MKT BUY $20.0 20/20 FILLED
- FB LMT SELL $20.0 20/20 FILLED
- SNAP MKT SELL $30.0 20/20 FILLED
- SNAP LMT SELL $31.0 0/10 PENDING
- SNAP LMT SELL $30.0 80/100 PARTIAL
Action: BUY SNAP LMT $32.00 10
You have placed a limit buy order for 10 SNAP shares at $32.0 each.
Action: VIEW ORDERS
- SNAP LMT BUY $30.0 100/100 FILLED
- FB MKT BUY $20.0 20/20 FILLED
- FB LMT SELL $20.0 20/20 FILLED
- SNAP MKT SELL $30.0 20/20 FILLED
- SNAP LMT SELL $31.0 10/10 FILLED
- SNAP LMT SELL $30.0 80/100 PARTIAL
- SNAP LMT BUY $31.0 10/10 FILLED
Action: QUIT
Quiting...
- When placing order, limit order will be resolved.
- Limit order has limitPrice(The price user enter when placing order) & triggerPrice(The price order is placed).
- Market order has only triggerPrice.
- TriggerPrice will be recalculated everytime position is filled.
- For Limit Order, if no position is filled, when view order, limitPrice will be shown.
- For Market Order, if no position is filled, when view order, no price will be shown.
-
Order
- orderId
- action
- symbol
- type
- limitPrice
- triggerPrice
- amount
- notFilled
- status
-
OrderList
- orderArray
- Order
- Order(String action, String symbol, String type, double limitPrice, int amount)
- Order(String action, String symbol, String type, int amount)
- getOrderId()
- setOrderId(int orderId)
- getAction()
- setAction(String action)
- getSymbol()
- setSymbol(String symbol)
- getType()
- setType(String type)
- getLimitPrice()
- setLimitPrice(double limitPrice)
- getTriggerPrice()
- setTriggerPrice(double triggerPrice)
- getAmount()
- setAmount(int amount)
- getNotFilled()
- setNotFilled(int filled)
- getStatus()
- setStatus(String status)
- printOrder()
- OrderList
- OrderList()
- processLmtBuyOrders(Order order)
- processLmtSellOrders(Order order)
- processMktBuyOrders(Order order)
- processMktSellOrders(Order order)
- viewOrders()
- quote(String symbol)