-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathIBSymbol.h
101 lines (74 loc) · 3.21 KB
/
IBSymbol.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/************************************************************************
* Copyright(c) 2009, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
#pragma once
#include "client/EWrapper.h"
#include <TFTimeSeries/DatedDatum.h>
#include <TFTrading/Symbol.h>
namespace ou { // One Unified
namespace tf { // TradeFrame
namespace ib { // Interactive Brokers
class Symbol : public ou::tf::Symbol<Symbol> {
friend class TWS;
public:
using inherited_t = ou::tf::Symbol<Symbol>;
using pInstrument_t = inherited_t::pInstrument_t;
using pSymbol_t = inherited_t::pSymbol_t;
//IBSymbol( TickerId id, pInstrument_t pInstrument );
Symbol( inherited_t::idSymbol_t, pInstrument_t pInstrument, TickerId id );
Symbol( pInstrument_t pInstrument, TickerId id );
virtual ~Symbol();
TickerId GetTickerId() { return m_TickerId; };
void Greeks( double optPrice, double undPrice, double pvDividend,
double impliedVol, double delta, double gamma, double vega, double theta );
double OptionPrice() { return m_dblOptionPrice; };
protected:
TickerId m_TickerId;
bool m_bAskFound;
bool m_bAskSizeFound;
bool m_bBidFound;
bool m_bBidSizeFound;
bool m_bLastTimeStampFound;
bool m_bLastFound;
bool m_bLastSizeFound;
uint32_t m_nAskSize;
uint32_t m_nBidSize;
uint32_t m_nLastSize;
uint32_t m_nVolume;
double m_dblAsk;
double m_dblBid;
double m_dblLast;
double m_dblHigh;
double m_dblLow;
double m_dblClose;
double m_dblOptionPrice;
double m_dblUnderlyingPrice;
double m_dblPvDividend;
void SetQuoteTradeWatchInProgress() { m_bQuoteTradeWatchInProgress = true; };
void ResetQuoteTradeWatchInProgress() { m_bQuoteTradeWatchInProgress = false; };
bool GetQuoteTradeWatchInProgress() { return m_bQuoteTradeWatchInProgress; };
bool m_bQuoteTradeWatchInProgress;
void SetDepthWatchInProgress() { m_bDepthWatchInProgress = true; };
void ResetDepthWatchInProgress() { m_bDepthWatchInProgress = false; };
bool GetDepthWatchInProgress() { return m_bDepthWatchInProgress; };
bool m_bDepthWatchInProgress;
void AcceptTickPrice( TickType tickType, double price );
void AcceptTickSize( TickType tickType, Decimal size );
void AcceptTickString( TickType tickType, const std::string& value );
void BuildQuote();
void BuildTrade();
private:
};
} // namespace ib
} // namespace tf
} // namespace ou