This commit is contained in:
2013-09-12 22:59:48 +00:00
parent c01e9cbe6b
commit 5730cec542
5 changed files with 45 additions and 35 deletions

View File

@@ -5,23 +5,14 @@
#include "EventHandler.h"
#include <string>
#include <vector>
#include <hash_map>
#include <map>
#include <fstream>
using std::vector;
using stdext::hash_map;
using std::map;
using std::string;
using std::ofstream;
struct CP_BUYINFO
{
string m_Code;
int m_iBoughtTime;
float m_fBoughtPrice;
float m_fHighestPrice;
};
struct CP_UNITINFO
{
string m_Code;
@@ -30,6 +21,8 @@ struct CP_UNITINFO
float m_fHighestPrice;
CTime m_Time;
int m_iOrderNum;
CTime m_TestCurTime;
};
struct CP_PRICEINFO
@@ -70,6 +63,10 @@ protected:
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg LRESULT OnBuy(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnSell(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnCancelOrder(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnWindUp(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
void SaveToFile(void);
@@ -101,12 +98,17 @@ private:
BOOL m_bPutOption;
BOOL m_bLookingDeal;
CTime m_DealStartT;
vector<CP_UNITINFO> m_OrderList;
vector<CP_UNITINFO> m_ConclusionList;
vector<CP_UNITINFO> m_WindUpList;
hash_map<string, CP_PRICEINFO> m_CurPriceList;
vector<CP_UNITINFO> m_BidOrderList; // 매수 요청한 리스트
//vector<CP_UNITINFO> m_BidConclusionList; // 매수 체결된 리스트
vector<CP_UNITINFO> m_AskOrderList; // 매도 요청한 리스트
map<string, CP_PRICEINFO> m_CurPriceList;
CRITICAL_SECTION m_CSBid;
CRITICAL_SECTION m_CSAsk;
CRITICAL_SECTION m_CSLog;
CpDib::IDibPtr m_pCpFConclusion;
CEventHandlerDib m_EventHandlerDib;
@@ -121,10 +123,16 @@ private:
void Unsubscribe(void);
void BuyThis(const string& Code, const float fBid1Price, const int iBid1Cnt, float afAskPrice[5]);
void SellThis(const string& Code);
void WindUp(const string& Code);
void CancelOrder(const string& Code);
void SellThis(CP_UNITINFO& AskInfo);
void WindUp(const CP_UNITINFO& Unit);
void CancelOrder(const CP_UNITINFO& Unit);
void CPLog(const string fmt, ...);
public:
afx_msg void OnBnClickedButton1();
afx_msg LRESULT OnBuyMsg(WPARAM wParam, LPARAM lParam);
};