Skip to content

Commit

Permalink
Combined typedefinitions and enums into utility.h
Browse files Browse the repository at this point in the history
  • Loading branch information
evanwporter committed Sep 24, 2023
1 parent 1004be5 commit fc80a1a
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 22 deletions.
5 changes: 2 additions & 3 deletions DataHandler/dh.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@

#include "../Libraries/simdjson.h"

#include "../utility.h"


namespace sd = simdjson;
using namespace Eigen;

// Milliseconds
typedef unsigned long long datetime64;

typedef long cents;

class DataHandler {
private:
Expand Down
2 changes: 1 addition & 1 deletion Portfolio/cash.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "cash.h"
#include "../direction.h"
#include "../utility.h"

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion Portfolio/cash.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CASH_H
#define CASH_H

#include "../direction.h"
#include "../utility.h"

class CASH {
public:
Expand Down
2 changes: 1 addition & 1 deletion Portfolio/portfolio.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "trade.h"
#include "position.h"
#include "cash.h"
#include "../direction.h"
#include "../utility.h"
#include "../DataHandler/dh.h"

#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion Portfolio/position.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "position.h"
#include "trade.h"
#include "../direction.h"
#include "../utility.h"


#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion Portfolio/trade.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define TRADE_H

#include <string>
#include "../direction.h"
#include "../utility.h"


// For space efficiency, each trade is a node in a linked list.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ https://eigen.tuxfamily.org/dox/AsciiQuickReference.txt
* Convert strings to string_view for memory efficiency
* More strategies
* Abstract Base Strategy Class
* Put direction in enum file/folder
* ~~Put direction in enum file/folder~~
* Use native chrono or roll my own timestamp manager
* Add optimization function
2 changes: 1 addition & 1 deletion RiskHandler/risk.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "risk.h"
#include "../Direction.h"
#include "../utility.h"
#include "../DataHandler/dh.h"

#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion Strategy/strategy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "strategy.h"
#include "../direction.h"
#include "../utility.h"

Strategy::Strategy() {};

Expand Down
10 changes: 0 additions & 10 deletions direction.h

This file was deleted.

2 changes: 1 addition & 1 deletion engine.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Portfolio/ticker.h"
#include "Portfolio/position.h"
#include "direction.h"
#include "utility.h"
#include "DataHandler/dh.h"
#include "Strategy/strategy.h"
#include "Metrics/metrics.h"
Expand Down
15 changes: 15 additions & 0 deletions utility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef UTILITY_H
#define UTILITY_H

enum Direction
{
LONG = 1,
SHORT = -1
};

// Milliseconds
typedef unsigned long long datetime64;

typedef long cents;

#endif

0 comments on commit fc80a1a

Please sign in to comment.