1 | /* |
2 | * Legal Notice |
3 | * |
4 | * This document and associated source code (the "Work") is a part of a |
5 | * benchmark specification maintained by the TPC. |
6 | * |
7 | * The TPC reserves all right, title, and interest to the Work as provided |
8 | * under U.S. and international laws, including without limitation all patent |
9 | * and trademark rights therein. |
10 | * |
11 | * No Warranty |
12 | * |
13 | * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION |
14 | * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE |
15 | * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER |
16 | * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
17 | * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, |
18 | * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR |
19 | * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF |
20 | * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE. |
21 | * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, |
22 | * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT |
23 | * WITH REGARD TO THE WORK. |
24 | * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO |
25 | * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE |
26 | * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS |
27 | * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, |
28 | * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, |
29 | * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT |
30 | * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD |
31 | * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. |
32 | * |
33 | * Contributors |
34 | * - Doug Johnson |
35 | */ |
36 | |
37 | /****************************************************************************** |
38 | * Description: This class provides price board functionality for the |
39 | * MEE. This allows for the lookup of any security's price |
40 | * at any point in time. |
41 | ******************************************************************************/ |
42 | |
43 | #ifndef MEE_PRICE_BOARD_H |
44 | #define MEE_PRICE_BOARD_H |
45 | |
46 | #include "utilities/EGenUtilities_stdafx.h" |
47 | #include "EGenTables_stdafx.h" |
48 | #include "MEESecurity.h" |
49 | |
50 | #include "input/DataFileManager.h" |
51 | |
52 | namespace TPCE { |
53 | |
54 | class CMEEPriceBoard { |
55 | |
56 | private: |
57 | // Mean delay between Pending and Submission times |
58 | // for an immediatelly triggered (in-the-money) limit order. |
59 | // |
60 | double m_fMeanInTheMoneySubmissionDelay; |
61 | CMEESecurity m_Security; |
62 | const CSecurityFile &m_SecurityFile; |
63 | |
64 | public: |
65 | TIdent m_iNumberOfSecurities; |
66 | |
67 | CMEEPriceBoard(INT32 TradingTimeSoFar, CDateTime *pBaseTime, CDateTime *pCurrentTime, const DataFileManager &dfm); |
68 | ~CMEEPriceBoard(void); |
69 | |
70 | void GetSymbol(TIdent SecurityIndex, |
71 | char *szOutput, // output buffer |
72 | size_t iOutputLen); // size of the output buffer (including null)); |
73 | |
74 | CMoney GetMinPrice(); |
75 | |
76 | CMoney GetMaxPrice(); |
77 | |
78 | CMoney GetCurrentPrice(TIdent SecurityIndex); |
79 | CMoney GetCurrentPrice(char *pSecuritySymbol); |
80 | |
81 | CMoney CalculatePrice(char *pSecuritySymbol, double fTime); |
82 | |
83 | double GetSubmissionTime(char *pSecuritySymbol, double fPendingTime, CMoney fLimitPrice, eTradeTypeID TradeType); |
84 | double GetSubmissionTime(TIdent SecurityIndex, double fPendingTime, CMoney fLimitPrice, eTradeTypeID TradeType); |
85 | double GetCompletionTime(TIdent SecurityIndex, double fSubmissionTime, |
86 | CMoney *pCompletionPrice // output param |
87 | ); |
88 | }; |
89 | |
90 | } // namespace TPCE |
91 | |
92 | #endif // MEE_PRICE_BOARD_H |
93 | |