-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev version of protobuf market order book protobuf timed data exports
- Loading branch information
Showing
80 changed files
with
1,998 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ LICENSE | |
**/*secret.json | ||
data/log | ||
data/secret | ||
data/serialized | ||
!data/secret/secret_test.json | ||
monitoring | ||
resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#pragma once | ||
|
||
#include <compare> | ||
#include <string_view> | ||
|
||
#include "cct_string.hpp" | ||
#include "cct_type_traits.hpp" | ||
#include "market.hpp" | ||
#include "monetaryamount.hpp" | ||
#include "orderid.hpp" | ||
#include "timedef.hpp" | ||
#include "tradeside.hpp" | ||
|
||
namespace cct { | ||
|
||
class ClosedOrder { | ||
public: | ||
ClosedOrder(const char *id, MonetaryAmount matchedVolume, MonetaryAmount price, TimePoint matchedTime, TradeSide side) | ||
: ClosedOrder(OrderId(id), matchedVolume, price, matchedTime, side) {} | ||
|
||
ClosedOrder(std::string_view id, MonetaryAmount matchedVolume, MonetaryAmount price, TimePoint matchedTime, | ||
TradeSide side); | ||
|
||
ClosedOrder(OrderId &&id, MonetaryAmount matchedVolume, MonetaryAmount price, TimePoint matchedTime, TradeSide side); | ||
|
||
MonetaryAmount matchedVolume() const { return _matchedVolume; } | ||
MonetaryAmount price() const { return _price; } | ||
|
||
OrderId &id() { return _id; } | ||
const OrderId &id() const { return _id; } | ||
|
||
TimePoint matchedTime() const { return _matchedTime; } | ||
|
||
TradeSide side() const { return _side; } | ||
|
||
std::string_view sideStr() const; | ||
|
||
string matchedTimeStr() const; | ||
|
||
Market market() const { return Market(_matchedVolume.currencyCode(), _price.currencyCode()); } | ||
|
||
std::strong_ordering operator<=>(const ClosedOrder &) const noexcept = default; | ||
|
||
using trivially_relocatable = is_trivially_relocatable<OrderId>::type; | ||
|
||
private: | ||
TimePoint _matchedTime; | ||
OrderId _id; // exchange internal id, format specific to each exchange | ||
MonetaryAmount _matchedVolume; | ||
MonetaryAmount _price; | ||
TradeSide _side; | ||
}; | ||
} // namespace cct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "closed-order.hpp" | ||
|
||
#include <string_view> | ||
#include <utility> | ||
|
||
#include "cct_string.hpp" | ||
#include "monetaryamount.hpp" | ||
#include "timedef.hpp" | ||
#include "timestring.hpp" | ||
#include "tradeside.hpp" | ||
|
||
namespace cct { | ||
|
||
ClosedOrder::ClosedOrder(std::string_view id, MonetaryAmount matchedVolume, MonetaryAmount price, TimePoint matchedTime, | ||
TradeSide side) | ||
: _matchedTime(matchedTime), _id(id), _matchedVolume(matchedVolume), _price(price), _side(side) {} | ||
|
||
ClosedOrder::ClosedOrder(string &&id, MonetaryAmount matchedVolume, MonetaryAmount price, TimePoint matchedTime, | ||
TradeSide side) | ||
: _matchedTime(matchedTime), _id(std::move(id)), _matchedVolume(matchedVolume), _price(price), _side(side) {} | ||
|
||
std::string_view ClosedOrder::sideStr() const { return SideStr(_side); } | ||
|
||
string ClosedOrder::matchedTimeStr() const { return ToString(_matchedTime); } | ||
} // namespace cct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.