Skip to content

Instantly share code, notes, and snippets.

@odeblic
Created July 28, 2017 04:34
Show Gist options
  • Save odeblic/5261ebfed166978152b34e534f45974d to your computer and use it in GitHub Desktop.
Save odeblic/5261ebfed166978152b34e534f45974d to your computer and use it in GitHub Desktop.
Draft of exchange simulator
#include <iostream>
#include <mutex>
#include <functional>
class Price
{
std::uint64_t value;
std::ratio<1, 100> value;
};
class Volume
{
std::uint64_t value;
std::ratio<1, 100> value;
};
std::map<int, >
struct OrderBook
{
void registerTransaction() noexcept
{
// price, buyer, seller, quantity, product
}
};
struct PreOrderBook
{
struct Order
{
Price price;
Quantity quantity;
enum direction;
enum type;
};
std::map<Price, >;
void onPriceUpdate(Price price)
{
}
};
struct Participant
{
std::string name;
};
struct Instrument
{
};
int main()
{
std::cout << "----------------" << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment