-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
result.h
55 lines (43 loc) · 1.11 KB
/
result.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef RESULT_H
#define RESULT_H
#include <time.h>
#include <string>
#include <vector>
// structure that represents the result of a complete long/short trade (i.e. 2 trades IN, 2 trades OUT)
// some information is filled after the first two trades IN
struct Result {
unsigned id;
unsigned idExchLong;
unsigned idExchShort;
double exposure;
double feesLong;
double feesShort;
time_t entryTime;
time_t exitTime;
std::string exchNameLong;
std::string exchNameShort;
double priceLongIn;
double priceShortIn;
double priceLongOut;
double priceShortOut;
double spreadIn;
double spreadOut;
double minSpread[8][8]; // FIXME size
double maxSpread[8][8]; // FIXME size
double befBalUsd;
double aftBalUsd;
// return the *target* performance
// including exchange fees
double perfLong();
double perfShort();
double totPerf();
// get the length of the trade in minutes
double getLength();
// print to the console thr Entry/Exit trades information
void printEntry();
void printExit();
// clears the structure
// i.e. all the variables at 0
void clear();
};
#endif