/
IQFeedSymbol.h
96 lines (78 loc) · 3.32 KB
/
IQFeedSymbol.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
/************************************************************************
* Copyright(c) 2009, One Unified. All rights reserved. *
* *
* 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 <vector>
#include <string>
#include "LibCommon\Delegate.h"
#include "LibTrading\Symbol.h"
#include "IQFeedMessages.h"
class CIQFeedProvider;
class CIQFeedSymbol : public CSymbol<CIQFeedSymbol> {
friend class CIQFeedProvider;
public:
typedef CSymbol<CIQFeedSymbol> inherited_t;
typedef inherited_t::pInstrument_t pInstrument_t;
typedef std::string symbol_id_t;
// Public for RowKeyValues. Pass in a structure sometime.
// Public for CVuChartArmsIntraDay. Pass in structure sometime.
// Fundamentals
std::string m_sOptionRoots;
int m_AverageVolume;
std::string m_sCompanyName;
int m_Precision;
double m_dblHistoricalVolatility;
double m_dblStrikePrice;
// Update/Summary
ptime m_dtLastTrade;
double m_dblTrade;
double m_dblChange; // last - close
int m_nTotalVolume;
int m_nTradeSize;
double m_dblHigh;
double m_dblLow;
double m_dblBid;
double m_dblAsk;
int m_nBidSize;
int m_nAskSize;
int m_nOpenInterest;
double m_dblOpen;
double m_dblClose;
int m_cntTrades;
bool m_bNewTrade;
bool m_bNewQuote;
bool m_bNewOpen;
CIQFeedSymbol(const std::string &symbol, pInstrument_t pInstrument);
~CIQFeedSymbol(void);
ou::Delegate<CIQFeedSymbol*> OnFundamentalMessage;
ou::Delegate<CIQFeedSymbol*> OnUpdateMessage;
ou::Delegate<CIQFeedSymbol*> OnSummaryMessage;
ou::Delegate<CIQFeedSymbol*> OnNewsMessage;
protected:
unsigned short m_cnt; // used for watch/unwatch
enum enumQStatus { qUnknown, qFound, qNotFound } m_QStatus;
void SetQuoteTradeWatchInProgress( void ) { m_bQuoteTradeWatchInProgress = true; };
void ResetQuoteTradeWatchInProgress( void ) { m_bQuoteTradeWatchInProgress = false; };
bool GetQuoteTradeWatchInProgress( void ) { return m_bQuoteTradeWatchInProgress; };
bool m_bQuoteTradeWatchInProgress;
void SetDepthWatchInProgress( void ) { m_bDepthWatchInProgress = true; };
void ResetDepthWatchInProgress( void ) { m_bDepthWatchInProgress = false; };
bool GetDepthWatchInProgress( void ) { return m_bDepthWatchInProgress; };
bool m_bDepthWatchInProgress;
void HandleFundamentalMessage( CIQFFundamentalMessage *pMsg );
void HandleUpdateMessage( CIQFUpdateMessage *pMsg );
void HandleSummaryMessage( CIQFSummaryMessage *pMsg );
void HandleNewsMessage( CIQFNewsMessage *pMsg );
template <typename T>
void DecodePricingMessage( CIQFPricingMessage<T> *pMsg );
private:
};