1 #ifndef SHAREDSTRUTURES_H 2 #define SHAREDSTRUTURES_H 3 #include "sharedEnums.h" 10 #include "../../api2/api_includes/apiConstants.h" 11 #include "../../api2/api_includes/apiDataTypes.h" 12 #include "../../api2/api_includes/sharedResponse.h" 13 #define ResponseCategory_ORDER_CONFIRMATION 2 15 #include "../../api2/headers/apiConstants.h" 17 #define STRATEGY_TYPE_MAX 16 23 QComboBox *instrument;
24 QVBoxLayout *symbolLayout;
26 QComboBox *optionType;
27 QComboBox *strikePrice;
30 QRadioButton *radioButtonClient;
31 QRadioButton *radioButtonPro;
32 QComboBox *clientProCombo;
34 QComboBox *accountDetailCombo;
46 QRadioButton *radioBtnClient,
47 QRadioButton *radioBtnPro,
49 QComboBox *actDetailCombo)
57 strikePrice(stkPrice),
60 radioButtonClient(radioBtnClient),
61 radioButtonPro(radioBtnPro),
64 accountDetailCombo(actDetailCombo)
79 QComboBox *clientProComboBox,
81 QComboBox *actDetailCombo)
89 strikePrice(stkPrice),
92 radioButtonClient(NULL),
94 clientProCombo(clientProComboBox),
96 accountDetailCombo(actDetailCombo)
112 orderMode = API2::DllCMD::OrderMode_MAX;
114 strategyType=STRATEGY_TYPE_MAX;
119 qlonglong tempQuantity,
120 short tempStrategyType)
121 :symbolId(tempSymbolId),
122 orderMode(tempOrderMode),
123 quantity(tempQuantity),
124 strategyType(tempStrategyType)
130 qlonglong underlyingSymbolID;
134 bool contains(qlonglong symId)
136 return symId == symbolId ? true :
false;
144 int adminTokenIdIndex;
146 int strategyLegIndex;
148 int strategyCommentIndex;
149 int portFolioIdIndex;
150 int portFolioNameIndex;
159 int dmDeltaPercentage;
165 strategyIdIndex(-1),stateIndex(-1),
166 strategyCommentIndex(-1),portFolioIdIndex(-1),
167 portFolioNameIndex(-1),orderMode(-1),symbolIdLeg1(-1),
168 futurePrice(-1),dmDeltaPercentage(-1),spreadType(-1),strategyLegIndex(-1)
191 if(hitSpread!=detail.hitSpread)
194 hitSpread==detail.hitSpread;
204 SymbolDetail():market(
""), source(
""), securityId(0), symbol(
"") , scripName(
""), groupName(
""),
205 instrType(
"C") , maturityDay(0), maturityYearMon(0),
206 optType(
""), optAttribute(
""), strikePrice(0), symbolType(
""),
207 lotSize(1), tickSize(1), precision(2), multiplier(100), flag(
false), symbolId(0),
208 contractType(
""), maturityDay2(0), maturityYearMon2(0), securityId1(0), securityId2(0), tradeValue(1.00),tradeUnit(
""),upperCktLimit(0),lowerCktLimit(0),
209 symbolBaseCurrency(
""){}
216 qlonglong securityId;
225 QString optAttribute;
226 qlonglong strikePrice;
227 QString strikePriceStr;
234 QString contractType;
236 int maturityYearMon2;
237 qlonglong securityId1;
238 qlonglong securityId2;
243 QString symbolBaseCurrency;
245 qlonglong lowerCktLimit;
246 qlonglong upperCktLimit;
250 if(securityId < r.securityId)
252 else if(securityId > r.securityId)
256 return market < r.market;
262 return (securityId == r.securityId && market == r.market);
270 convRevStrategyType(-1), symbolId(0),maxPrecision(-1), lotSize(1), orderQty(1), minSpread(0), time(0),
271 minQty(1), isSquareOff(
false), strikePrice(0),strikeDiff(0),execSpread(0),isSpreadInBps(
false),
272 dividend(0.00),orderModeBps(API2::DllCMD::OrderMode_MAX),strategyName(
""),
273 isSpreadAlreadyCalculated(
false),
275 execSprdExcludingCost(0)
278 orderModeList.clear();
279 avgPriceList.clear();
280 OrderQtyRatio.clear();
284 QString strategyName;
285 qlonglong orderSeqNumber;
286 qlonglong strategyId;
287 short twoLeg3LegStrategyType;
288 short convRevStrategyType;
290 QList<API2::DllCMD::OrderMode> orderModeList;
294 QList<double> avgPriceList;
297 QString OrderQtyRatio;
299 qlonglong strikePrice;
300 qlonglong strikeDiff;
301 qlonglong execSpread;
302 qlonglong tradingCost;
303 qlonglong execSprdExcludingCost;
306 API2::DllCMD::OrderMode orderModeBps;
308 bool isSpreadAlreadyCalculated;
317 qlonglong orderPrice;
322 #ifndef MUTRADE_CLIENT 333 API2::DATA_TYPES::CLORDER_ID &clientOrderId,
334 API2::DATA_TYPES::SYMBOL_ID &symbolId,
335 API2::DATA_TYPES::STRATEGY_ID &strategyId,
336 API2::DATA_TYPES::CLIENT_ID &clientId,
337 API2::DATA_TYPES::OrderStatus &orderStatus,
338 API2::DATA_TYPES::OrderMode &orderMode,
339 API2::DATA_TYPES::OrderType &orderType,
340 API2::DATA_TYPES::QTY &orderQty,
341 API2::DATA_TYPES::PRICE &orderPrice,
342 API2::DATA_TYPES::CLORDER_ID &origClOrdId,
343 const API2::DATA_TYPES::PRICE &stopPrice,
344 const API2::DATA_TYPES::ProductType &productType,
345 const API2::DATA_TYPES::PlatformType &platformType,
346 const API2::ExchangeAdapterDetails &exchangeAdapterDetails);
349 UNSIGNED_LONG getConfirmationTimeSeconds()
const {
return _confirmationTimeSeconds; }
350 UNSIGNED_LONG getConfirmationTimeMicroSeconds()
const {
return _confirmationTimeMicroSeconds; }
351 UNSIGNED_CHARACTER getIsOffline()
const {
return _isOffline;}
352 UNSIGNED_LONG getSequenceNumber()
const {
return _sequenceNumber;}
353 const char* getTradeId()
const {
return getTradeIdCharPtr();}
354 const char* getExchangeOrderId()
const {
return getExchangeOrderIdCharPtr();}
355 UNSIGNED_INTEGER getReasonText()
const {
return _reasonText;}
356 UNSIGNED_CHARACTER getUnknownOrder()
const{
return _unknownOrder;}
358 void setConfirmationTimeSeconds(UNSIGNED_LONG seconds) ;
359 void setConfirmationTimeMicroSeconds(UNSIGNED_LONG microSeconds) ;
360 void setIsOffline(UNSIGNED_CHARACTER isOffline);
361 void setSequenceNumber(UNSIGNED_LONG sequenceNumber);
362 void setReasonText(UNSIGNED_INTEGER reasonText);
363 void setUnknownOrder(UNSIGNED_CHARACTER unknownOrder);
364 void dumpCSV(std::ofstream &csvFile);
366 std::string getString()
const;
367 bool isVersionValid(){
return true;}
368 #ifndef FRONTEND_COMPILATION 369 void dumpCSVTrades(std::ofstream &csvFile,
370 SG::SymbolStaticData &symbolData,
373 const std::string& accountId,
374 const std::string& settler,
375 const std::string& branchId,
376 const std::string& userId
379 void dumpCSVDetailed(std::ofstream &csvFile,
380 SG::SymbolStaticData &symbolData,
383 const std::string& accountId,
384 const std::string& settler,
385 const std::string& branchId,
386 const std::string& userId
390 std::string convertEpochToString(time_t rawtime);
391 std::string convertEpochToDate(time_t rawtime);
392 std::string convertEpochToTime(time_t rawtime);
393 int serialize(
char* buf,
short rc = ResponseCategory_ORDER_CONFIRMATION );
394 std::string getMonthFromNumber(
int number);
397 void serializeAll(
char* buf,
int &bytes);
398 void serializeConfirmAndReplace(
char* buf,
int &bytes);
399 void serializeTrade(
char* buf,
int &bytes);
400 void serializeTradeModify(
char* buf,
int &bytes);
401 void serializeCancelAndCancelOfIoc(
char* buf,
int &bytes);
402 void serializeRejected(
char* buf,
int &bytes);
403 void serializeMktToLimitAndTriggered(
char* buf,
int &bytes);
404 void serializeRelay(
char* buf,
int &bytes);
406 void deSerializeAll(
const char* buf,
int &offset);
407 void deSerializeConfirmAndReplace(
const char* buf,
int &offset);
408 void deSerializeTrade(
const char* buf,
int &offset);
409 void deSerializeTradeModify(
const char* buf,
int &offset);
410 void deSerializeCancelAndCancelOfIoc(
const char* buf,
int &offset);
411 void deSerializeRejected(
const char* buf,
int &offset);
412 void deSerializeMktToLimitAndTriggered(
const char* buf,
int &offset);
413 void deSerializeRelay(
const char* buf,
int &offset);
416 UNSIGNED_LONG _confirmationTimeSeconds;
417 UNSIGNED_LONG _confirmationTimeMicroSeconds;
418 UNSIGNED_CHARACTER _isOffline;
419 UNSIGNED_LONG _sequenceNumber;
420 UNSIGNED_INTEGER _reasonText;
421 UNSIGNED_CHARACTER _unknownOrder;
423 CREATE_FIELD(UNSIGNED_CHARACTER,GiveupFlag);
425 #ifdef FRONTEND_COMPILATION 426 CREATE_FIELD(UNSIGNED_LONG,TotalFillQuantity);
430 #ifndef FRONTEND_COMPILATION 431 CREATE_FIELD(SIGNED_LONG, Price1);
432 CREATE_FIELD(SIGNED_LONG, Price2);
435 #ifdef FRONTEND_COMPILATION 445 #endif // SHAREDSTRUTURES_H Definition: sharedStrutures.h:142
Definition: sharedStrutures.h:267
Definition: sharedStrutures.h:312
Definition: sharedStrutures.h:177
Definition: sharedStrutures.h:18
Definition: sharedStrutures.h:105
Definition: sharedStrutures.h:202
Definition: sharedStrutures.h:325