Skip to content

This is my c++ implementation of Order-book. It executes two specific orders- Market orders and Limit orders

Notifications You must be signed in to change notification settings

rish1602/OrderBook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OrderBook

This is my c++ implementation of Order-book. It executes two specific orders- Market orders and Limit orders. I've defines two orderbooks- bids orderbook and asks orderbook. These orderbook are implemented as ordered_maps.
i.e. std::map<double, std::vector<std::unique_ptr>>.

maps snip

Some important features are-

    1) The orderbook is pre-populated with random orders.
    2) It handles Market orders and Limit orders.
    3) Displays bar chart visualization
    4) Whole and partial fills

Here there are 7 main files-

  1. enums.hpp- which stores general variables like bid, ask, buy, sell, market, limit.

  2. helpers.hpp- stores function to generate time

  3. order.hpp- defines order class that stores our very important variables- quantity, price, side and timestamp, along with getter and setter functions

  4. order.cpp- it defines all getter and setter function members that were declared in order class of order.hpp.

  5. orderbook.hpp- defines orderbook class that holds our 2 orderbooks- bids orderbook and asks orderbook.

  6. orderbook.cpp- it defines all functions members that were declared in orderbook class of orderbook.hpp i.e defines important functions like- add_order(), remove empty_order from map, execute_order() etc.

  7. main.cpp- the starting point of the entire programme.


For running the program just compile and run main.cpp

SOME SCREENSHOTS OF PROGRAM


snip1 - main option
snip2- after_selecting_option2
snip3 after_selecting_LIMIT_ORDER
snip4 after selecting buy or sell
snip5 after selecting quantity and price
snip orderbook s

For me to understand--> snip for me

About

This is my c++ implementation of Order-book. It executes two specific orders- Market orders and Limit orders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages