MT5APIConfigSymbol.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. //+------------------------------------------------------------------+
  2. //| MetaTrader 5 API |
  3. //| Copyright 2000-2019, MetaQuotes Software Corp. |
  4. //| http://www.metaquotes.net |
  5. //+------------------------------------------------------------------+
  6. #pragma once
  7. //+------------------------------------------------------------------+
  8. //| Symbol trade and quotes sessions config |
  9. //+------------------------------------------------------------------+
  10. class IMTConSymbolSession
  11. {
  12. public:
  13. //--- common methods
  14. virtual void Release(void)=0;
  15. virtual MTAPIRES Assign(const IMTConSymbolSession* symbol)=0;
  16. virtual MTAPIRES Clear(void)=0;
  17. //--- session start in minutes (60 = 01:00)
  18. virtual UINT Open(void) const=0;
  19. virtual MTAPIRES Open(const UINT open)=0;
  20. //--- session start hours and minutes
  21. virtual UINT OpenHours(void) const=0;
  22. virtual UINT OpenMinutes(void) const=0;
  23. //--- session end in minutes (60 = 01:00)
  24. virtual UINT Close(void) const=0;
  25. virtual MTAPIRES Close(const UINT close)=0;
  26. //--- session end hours and minutes
  27. virtual UINT CloseHours(void) const=0;
  28. virtual UINT CloseMinutes(void) const=0;
  29. };
  30. //+------------------------------------------------------------------+
  31. //| Symbol config |
  32. //+------------------------------------------------------------------+
  33. class IMTConSymbol
  34. {
  35. public:
  36. //--- allowed filling modes flags
  37. enum EnFillingFlags
  38. {
  39. FILL_FLAGS_NONE =0, // none
  40. FILL_FLAGS_FOK =1, // allowed FOK
  41. FILL_FLAGS_IOC =2, // allowed IOC
  42. //--- flags borders
  43. FILL_FLAGS_FIRST =FILL_FLAGS_FOK,
  44. FILL_FLAGS_ALL =FILL_FLAGS_FOK|FILL_FLAGS_IOC
  45. };
  46. //--- allowed order expiration modes flags
  47. enum EnExpirationFlags
  48. {
  49. TIME_FLAGS_NONE =0, // none
  50. TIME_FLAGS_GTC =1, // allowed Good Till Cancel
  51. TIME_FLAGS_DAY =2, // allowed Good Till Day
  52. TIME_FLAGS_SPECIFIED =4, // allowed specified expiration date
  53. TIME_FLAGS_SPECIFIED_DAY=8, // allowed specified expiration date as day
  54. //--- flags borders
  55. TIME_FLAGS_FIRST =TIME_FLAGS_GTC,
  56. TIME_FLAGS_ALL =TIME_FLAGS_GTC|TIME_FLAGS_DAY|TIME_FLAGS_SPECIFIED|TIME_FLAGS_SPECIFIED_DAY
  57. };
  58. //--- allowed order flags
  59. enum EnOrderFlags
  60. {
  61. ORDER_FLAGS_NONE =0, // none
  62. ORDER_FLAGS_MARKET =1, // market orders
  63. ORDER_FLAGS_LIMIT =2, // limit orders
  64. ORDER_FLAGS_STOP =4, // stop orders
  65. ORDER_FLAGS_STOP_LIMIT =8, // stop limit orders
  66. ORDER_FLAGS_SL =16, // sl orders
  67. ORDER_FLAGS_TP =32, // tp orders
  68. ORDER_FLAGS_CLOSEBY =64, // close-by orders
  69. //--- flags borders
  70. ORDER_FLAGS_FIRST =ORDER_FLAGS_MARKET,
  71. ORDER_FLAGS_ALL =ORDER_FLAGS_MARKET|ORDER_FLAGS_LIMIT|ORDER_FLAGS_STOP|ORDER_FLAGS_STOP_LIMIT|ORDER_FLAGS_SL|ORDER_FLAGS_TP|ORDER_FLAGS_CLOSEBY
  72. };
  73. //--- allowed trade modes
  74. enum EnTradeMode
  75. {
  76. TRADE_DISABLED =0, // trade disabled
  77. TRADE_LONGONLY =1, // only long positions allowed
  78. TRADE_SHORTONLY =2, // only short positions allowed
  79. TRADE_CLOSEONLY =3, // only position closure
  80. TRADE_FULL =4, // all trade operations are allowed
  81. //--- enumeration borders
  82. TRADE_FIRST =TRADE_DISABLED,
  83. TRADE_LAST =TRADE_FULL
  84. };
  85. //--- order execution modes
  86. enum EnExecutionMode
  87. {
  88. EXECUTION_REQUEST =0, // Request Execution
  89. EXECUTION_INSTANT =1, // Instant Execution
  90. EXECUTION_MARKET =2, // Market Execution
  91. EXECUTION_EXCHANGE =3, // Exchange Execution
  92. //--- enumeration borders
  93. EXECUTION_FIRST =EXECUTION_REQUEST,
  94. EXECUTION_LAST =EXECUTION_EXCHANGE
  95. };
  96. //--- profit and margin calculation modes
  97. enum EnCalcMode
  98. {
  99. //--- market maker modes
  100. TRADE_MODE_FOREX =0,
  101. TRADE_MODE_FUTURES =1,
  102. TRADE_MODE_CFD =2,
  103. TRADE_MODE_CFDINDEX =3,
  104. TRADE_MODE_CFDLEVERAGE =4,
  105. TRADE_MODE_FOREX_NO_LEVERAGE =5,
  106. //--- market makers enumerations
  107. TRADE_MODE_MM_FIRST =TRADE_MODE_FOREX,
  108. TRADE_MODE_MM_LAST =TRADE_MODE_FOREX_NO_LEVERAGE,
  109. //--- exchange modes
  110. TRADE_MODE_EXCH_STOCKS =32,
  111. TRADE_MODE_EXCH_FUTURES =33,
  112. TRADE_MODE_EXCH_FUTURES_FORTS =34,
  113. TRADE_MODE_EXCH_OPTIONS =35,
  114. TRADE_MODE_EXCH_OPTIONS_MARGIN=36,
  115. TRADE_MODE_EXCH_BONDS =37,
  116. TRADE_MODE_EXCH_STOCKS_MOEX =38,
  117. TRADE_MODE_EXCH_BONDS_MOEX =39,
  118. //--- exchange enumerations
  119. TRADE_MODE_EXCH_FIRST =TRADE_MODE_EXCH_STOCKS,
  120. TRADE_MODE_EXCH_LAST =TRADE_MODE_EXCH_BONDS_MOEX,
  121. //--- service modes
  122. TRADE_MODE_SERV_COLLATERAL =64,
  123. //--- service enumerations
  124. TRADE_MODE_SERV_FIRST =TRADE_MODE_SERV_COLLATERAL,
  125. TRADE_MODE_SERV_LAST =TRADE_MODE_SERV_COLLATERAL,
  126. //--- enumeration borders
  127. TRADE_MODE_FIRST =TRADE_MODE_FOREX,
  128. TRADE_MODE_LAST =TRADE_MODE_SERV_COLLATERAL
  129. };
  130. //--- orders expiration modes
  131. enum EnGTCMode
  132. {
  133. ORDERS_GTC =0,
  134. ORDERS_DAILY =1,
  135. ORDERS_DAILY_NO_STOPS =2,
  136. //--- enumeration borders
  137. ORDERS_FIRST =ORDERS_GTC,
  138. ORDERS_LAST =ORDERS_DAILY_NO_STOPS
  139. };
  140. //--- tick collection flags
  141. enum EnTickFlags
  142. {
  143. TICK_REALTIME =1, // allow realtime tick apply
  144. TICK_COLLECTRAW =2, // allow to collect raw ticks
  145. TICK_FEED_STATS =4, // allow to receive price statisticks from datafeeds
  146. //--- flags borders
  147. TICK_NONE =0,
  148. TICK_ALL =TICK_REALTIME|TICK_COLLECTRAW|TICK_FEED_STATS
  149. };
  150. //--- chart mode
  151. enum EnChartMode
  152. {
  153. CHART_MODE_BID_PRICE =0,
  154. CHART_MODE_LAST_PRICE =1,
  155. CHART_MODE_OLD =255,
  156. //--- enumeration borders
  157. CHART_MODE_FIRST =CHART_MODE_BID_PRICE,
  158. CHART_MODE_LAST =CHART_MODE_OLD
  159. };
  160. //--- margin check modes
  161. enum EnMarginFlags
  162. {
  163. MARGIN_FLAGS_NONE =0, // none
  164. MARGIN_FLAGS_CHECK_PROCESS =1, // check margin after dealer confirmation
  165. MARGIN_FLAGS_CHECK_SLTP =2, // check margin on SL-TP trigger
  166. MARGIN_FLAGS_HEDGE_LARGE_LEG =4, // check margin for hedged positions using large leg
  167. //--- flags borders
  168. MARGIN_FLAGS_FIRST =MARGIN_FLAGS_NONE,
  169. MARGIN_FLAGS_LAST =MARGIN_FLAGS_HEDGE_LARGE_LEG
  170. };
  171. //--- swaps calculation modes
  172. enum EnSwapMode
  173. {
  174. SWAP_DISABLED =0,
  175. SWAP_BY_POINTS =1,
  176. SWAP_BY_SYMBOL_CURRENCY =2,
  177. SWAP_BY_MARGIN_CURRENCY =3,
  178. SWAP_BY_GROUP_CURRENCY =4,
  179. SWAP_BY_INTEREST_CURRENT=5,
  180. SWAP_BY_INTEREST_OPEN =6,
  181. SWAP_REOPEN_BY_CLOSE_PRICE=7,
  182. SWAP_REOPEN_BY_BID =8,
  183. SWAP_BY_PROFIT_CURRENCY =9,
  184. //--- enumeration borders
  185. SWAP_FIRST =SWAP_DISABLED,
  186. SWAP_LAST =SWAP_BY_PROFIT_CURRENCY
  187. };
  188. //--- swaps days
  189. enum EnSwapDays
  190. {
  191. SWAP_DAY_SUNDAY =0,
  192. SWAP_DAY_MONDAY =1,
  193. SWAP_DAY_TUESDAY =2,
  194. SWAP_DAY_WEDNESDAY =3,
  195. SWAP_DAY_THURSDAY =4,
  196. SWAP_DAY_FRIDAY =5,
  197. SWAP_DAY_SATURDAY =6,
  198. SWAP_DAY_DISABLED =7,
  199. //--- enumeration borders
  200. SWAP_DAY_FIRST =SWAP_DAY_SUNDAY,
  201. SWAP_DAY_LAST =SWAP_DAY_DISABLED
  202. };
  203. //--- Instant Execution Flags
  204. enum EnInstantFlags
  205. {
  206. INSTANT_FLAGS_NONE =0,
  207. INSTANT_FLAGS_FAST_CONFIRMATION=1,
  208. //--- enumeration borders
  209. INSTANT_FLAGS_ALL =INSTANT_FLAGS_FAST_CONFIRMATION
  210. };
  211. //--- Instant Execution Modes
  212. enum EnInstantMode
  213. {
  214. INSTANT_CHECK_NORMAL =0,
  215. //--- enumeration borders
  216. INSTANT_CHECK_FIRST =INSTANT_CHECK_NORMAL,
  217. INSTANT_CHECK_LAST =INSTANT_CHECK_NORMAL
  218. };
  219. //--- Request Execution Flags
  220. enum EnRequestFlags
  221. {
  222. REQUEST_FLAGS_NONE =0, // node
  223. REQUEST_FLAGS_ORDER =1, // trade orders should be additional confirmed after quotation
  224. //--- flags borders
  225. REQUEST_FLAGS_ALL =REQUEST_FLAGS_ORDER
  226. };
  227. //--- Common Trade Flags
  228. enum EnTradeFlags
  229. {
  230. TRADE_FLAGS_NONE =0, // none
  231. TRADE_FLAGS_PROFIT_BY_MARKET=1, // convert fx profit using market prices
  232. TRADE_FLAGS_ALLOW_SIGNALS =2, // allow trade signals for symbol
  233. //--- flags borders
  234. TRADE_FLAGS_ALL =TRADE_FLAGS_PROFIT_BY_MARKET|TRADE_FLAGS_ALLOW_SIGNALS,
  235. TRADE_FLAGS_DEFAULT =TRADE_FLAGS_ALLOW_SIGNALS
  236. };
  237. //--- Margin Rate Types
  238. enum EnMarginRateTypes
  239. {
  240. MARGIN_RATE_BUY =0,
  241. MARGIN_RATE_SELL =1,
  242. MARGIN_RATE_BUY_LIMIT =2,
  243. MARGIN_RATE_SELL_LIMIT =3,
  244. MARGIN_RATE_BUY_STOP =4,
  245. MARGIN_RATE_SELL_STOP =5,
  246. MARGIN_RATE_BUY_STOP_LIMIT =6,
  247. MARGIN_RATE_SELL_STOP_LIMIT=7,
  248. //--- enumeration borders
  249. MARGIN_RATE_FIRST =MARGIN_RATE_BUY,
  250. MARGIN_RATE_LAST =MARGIN_RATE_SELL_STOP_LIMIT
  251. };
  252. //--- Options Mode
  253. enum EnOptionMode
  254. {
  255. OPTION_MODE_EUROPEAN_CALL=0,
  256. OPTION_MODE_EUROPEAN_PUT =1,
  257. OPTION_MODE_AMERICAN_CALL=2,
  258. OPTION_MODE_AMERICAN_PUT =3,
  259. //--- enumeration borders
  260. OPTION_MODE_FIRST =OPTION_MODE_EUROPEAN_CALL,
  261. OPTION_MODE_LAST =OPTION_MODE_AMERICAN_PUT
  262. };
  263. //--- Splice Type
  264. enum EnSpliceType
  265. {
  266. SPLICE_NONE =0,
  267. SPLICE_UNADJUSTED =1,
  268. SPLICE_ADJUSTED =2,
  269. //--- enumeration borders
  270. SPLICE_FIRST =SPLICE_NONE,
  271. SPLICE_LAST =SPLICE_ADJUSTED
  272. };
  273. //--- Splice Time Type
  274. enum EnSpliceTimeType
  275. {
  276. SPLICE_TIME_EXPIRATION =0,
  277. //--- enumeration borders
  278. SPLICE_TIME_FIRST =SPLICE_TIME_EXPIRATION,
  279. SPLICE_TIME_LAST =SPLICE_TIME_EXPIRATION
  280. };
  281. //--- common methods
  282. virtual void Release(void)=0;
  283. virtual MTAPIRES Assign(const IMTConSymbol* symbol)=0;
  284. virtual MTAPIRES Clear(void)=0;
  285. //--- name
  286. virtual LPCWSTR Symbol(void) const=0;
  287. virtual MTAPIRES Symbol(LPCWSTR symbol)=0;
  288. //--- hierarchical symbol path (including symbol name)
  289. virtual LPCWSTR Path(void) const=0;
  290. virtual MTAPIRES Path(LPCWSTR path)=0;
  291. //--- ISIN
  292. virtual LPCWSTR ISIN(void) const=0;
  293. virtual MTAPIRES ISIN(LPCWSTR isin)=0;
  294. //--- local description
  295. virtual LPCWSTR Description(void) const=0;
  296. virtual MTAPIRES Description(LPCWSTR descr)=0;
  297. //--- internation description
  298. virtual LPCWSTR International(void) const=0;
  299. virtual MTAPIRES International(LPCWSTR intern)=0;
  300. //--- basic symbol name
  301. virtual LPCWSTR Basis(void) const=0;
  302. virtual MTAPIRES Basis(LPCWSTR basis)=0;
  303. //--- source symbol name
  304. virtual LPCWSTR Source(void) const=0;
  305. virtual MTAPIRES Source(LPCWSTR source)=0;
  306. //--- symbol specification page URL
  307. virtual LPCWSTR Page(void) const=0;
  308. virtual MTAPIRES Page(LPCWSTR page)=0;
  309. //--- symbol base currency
  310. virtual LPCWSTR CurrencyBase(void) const=0;
  311. virtual MTAPIRES CurrencyBase(LPCWSTR currency)=0;
  312. virtual UINT CurrencyBaseDigits(void) const=0;
  313. //--- symbol profit currency
  314. virtual LPCWSTR CurrencyProfit(void) const=0;
  315. virtual MTAPIRES CurrencyProfit(LPCWSTR currency)=0;
  316. virtual UINT CurrencyProfitDigits(void) const=0;
  317. //--- symbol margin currency
  318. virtual LPCWSTR CurrencyMargin(void) const=0;
  319. virtual MTAPIRES CurrencyMargin(LPCWSTR currency)=0;
  320. virtual UINT CurrencyMarginDigits(void) const=0;
  321. //--- symbol color
  322. virtual COLORREF Color(void) const=0;
  323. virtual MTAPIRES Color(const COLORREF color)=0;
  324. //--- symbol background color
  325. virtual COLORREF ColorBackground(void) const=0;
  326. virtual MTAPIRES ColorBackground(const COLORREF color)=0;
  327. //--- symbol digits
  328. virtual UINT Digits(void) const=0;
  329. virtual MTAPIRES Digits(const UINT digits)=0;
  330. //--- symbol digits derivation (1/10^digits & 10^digits)
  331. virtual double Point(void) const=0;
  332. virtual double Multiply(void) const=0;
  333. //--- EnTickFlags
  334. virtual UINT64 TickFlags(void) const=0;
  335. virtual MTAPIRES TickFlags(const UINT64 flags)=0;
  336. //--- Depth of Market depth (both legs)
  337. virtual UINT TickBookDepth(void) const=0;
  338. virtual MTAPIRES TickBookDepth(const UINT depth)=0;
  339. //--- filtration soft level
  340. virtual UINT FilterSoft(void) const=0;
  341. virtual MTAPIRES FilterSoft(const UINT filter)=0;
  342. //--- filtration soft level counter
  343. virtual UINT FilterSoftTicks(void) const=0;
  344. virtual MTAPIRES FilterSoftTicks(const UINT ticks)=0;
  345. //--- filtration hard level
  346. virtual UINT FilterHard(void) const=0;
  347. virtual MTAPIRES FilterHard(const UINT filter)=0;
  348. //--- filtration hard level counter
  349. virtual UINT FilterHardTicks(void) const=0;
  350. virtual MTAPIRES FilterHardTicks(const UINT ticks)=0;
  351. //--- filtration discard level
  352. virtual UINT FilterDiscard(void) const=0;
  353. virtual MTAPIRES FilterDiscard(const UINT ticks)=0;
  354. //--- spread max value
  355. virtual UINT FilterSpreadMax(void) const=0;
  356. virtual MTAPIRES FilterSpreadMax(const UINT spread)=0;
  357. //--- spread min value
  358. virtual UINT FilterSpreadMin(void) const=0;
  359. virtual MTAPIRES FilterSpreadMin(const UINT spread)=0;
  360. //--- EnTradeMode
  361. virtual UINT TradeMode(void) const=0;
  362. virtual MTAPIRES TradeMode(const UINT mode)=0;
  363. //--- EnCalcMode
  364. virtual UINT CalcMode(void) const=0;
  365. virtual MTAPIRES CalcMode(const UINT mode)=0;
  366. //--- EnExecutionMode
  367. virtual UINT ExecMode(void) const=0;
  368. virtual MTAPIRES ExecMode(const UINT mode)=0;
  369. //--- EnGTCMode
  370. virtual UINT GTCMode(void) const=0;
  371. virtual MTAPIRES GTCMode(const UINT mode)=0;
  372. //--- EnFillingFlags
  373. virtual UINT FillFlags(void) const=0;
  374. virtual MTAPIRES FillFlags(const UINT flags)=0;
  375. //--- EnExpirationFlags
  376. virtual UINT ExpirFlags(void) const=0;
  377. virtual MTAPIRES ExpirFlags(const UINT flags)=0;
  378. //--- symbol spread (0-floating)
  379. virtual UINT Spread(void) const=0;
  380. virtual MTAPIRES Spread(const UINT spread)=0;
  381. //--- spread balance
  382. virtual INT SpreadBalance(void) const=0;
  383. virtual MTAPIRES SpreadBalance(const INT spread)=0;
  384. //--- spread difference
  385. virtual INT SpreadDiff(void) const=0;
  386. virtual MTAPIRES SpreadDiff(const INT diff)=0;
  387. //--- spread difference balance
  388. virtual INT SpreadDiffBalance(void) const=0;
  389. virtual MTAPIRES SpreadDiffBalance(const INT spread)=0;
  390. //--- tick value
  391. virtual double TickValue(void) const=0;
  392. virtual MTAPIRES TickValue(const double value)=0;
  393. //--- tick size
  394. virtual double TickSize(void) const=0;
  395. virtual MTAPIRES TickSize(const double size)=0;
  396. //--- contract size
  397. virtual double ContractSize(void) const=0;
  398. virtual MTAPIRES ContractSize(const double size)=0;
  399. //--- stops level
  400. virtual INT StopsLevel(void) const=0;
  401. virtual MTAPIRES StopsLevel(const INT level)=0;
  402. //--- freeze level
  403. virtual INT FreezeLevel(void) const=0;
  404. virtual MTAPIRES FreezeLevel(const INT level)=0;
  405. //--- quotes timeout
  406. virtual UINT QuotesTimeout(void) const=0;
  407. virtual MTAPIRES QuotesTimeout(const UINT timeout)=0;
  408. //--- minimal volume
  409. virtual UINT64 VolumeMin(void) const=0;
  410. virtual MTAPIRES VolumeMin(const UINT64 volume)=0;
  411. //--- maximal volume
  412. virtual UINT64 VolumeMax(void) const=0;
  413. virtual MTAPIRES VolumeMax(const UINT64 volume)=0;
  414. //--- volume step
  415. virtual UINT64 VolumeStep(void) const=0;
  416. virtual MTAPIRES VolumeStep(const UINT64 volume)=0;
  417. //--- cumulative positions and orders limit
  418. virtual UINT64 VolumeLimit(void) const=0;
  419. virtual MTAPIRES VolumeLimit(const UINT64 volume)=0;
  420. //--- EnMarginFlags
  421. virtual UINT MarginFlags(void) const=0;
  422. virtual MTAPIRES MarginFlags(const UINT mode)=0;
  423. //--- initial margin
  424. virtual double MarginInitial(void) const=0;
  425. virtual MTAPIRES MarginInitial(const double margin)=0;
  426. //--- maintenance margin
  427. virtual double MarginMaintenance(void) const=0;
  428. virtual MTAPIRES MarginMaintenance(const double margin)=0;
  429. //--- long orders and positions margin rate
  430. virtual double MarginLong(void) const=0;
  431. virtual MTAPIRES MarginLong(const double margin)=0;
  432. //--- short orders and positions margin rate
  433. virtual double MarginShort(void) const=0;
  434. virtual MTAPIRES MarginShort(const double margin)=0;
  435. //--- limit orders and positions margin rate
  436. virtual double MarginLimit(void) const=0;
  437. virtual MTAPIRES MarginLimit(const double margin)=0;
  438. //--- stop orders and positions margin rate
  439. virtual double MarginStop(void) const=0;
  440. virtual MTAPIRES MarginStop(const double margin)=0;
  441. //--- stop-limit orders and positions margin rate
  442. virtual double MarginStopLimit(void) const=0;
  443. virtual MTAPIRES MarginStopLimit(const double margin)=0;
  444. //--- EnSwapMode
  445. virtual UINT SwapMode(void) const=0;
  446. virtual MTAPIRES SwapMode(const UINT mode)=0;
  447. //--- long positions swaps rate
  448. virtual double SwapLong(void) const=0;
  449. virtual MTAPIRES SwapLong(const double swap)=0;
  450. //--- short positions swaps rate
  451. virtual double SwapShort(void) const=0;
  452. virtual MTAPIRES SwapShort(const double swap)=0;
  453. //--- 3 time swaps day, EnSwapDay
  454. virtual UINT Swap3Day(void) const=0;
  455. virtual MTAPIRES Swap3Day(const UINT day)=0;
  456. //--- trade start date
  457. virtual INT64 TimeStart(void) const=0;
  458. virtual MTAPIRES TimeStart(const INT64 start)=0;
  459. //--- trade end date
  460. virtual INT64 TimeExpiration(void) const=0;
  461. virtual MTAPIRES TimeExpiration(const INT64 expiration)=0;
  462. //--- quote sessions
  463. virtual MTAPIRES SessionQuoteAdd(const UINT wday,IMTConSymbolSession* symbol)=0;
  464. virtual MTAPIRES SessionQuoteUpdate(const UINT wday,const UINT pos,const IMTConSymbolSession* session)=0;
  465. virtual MTAPIRES SessionQuoteDelete(const UINT wday,const UINT pos)=0;
  466. virtual MTAPIRES SessionQuoteClear(const UINT wday)=0;
  467. virtual MTAPIRES SessionQuoteShift(const UINT wday,const UINT pos,const int shift)=0;
  468. virtual UINT SessionQuoteTotal(const UINT wday) const=0;
  469. virtual MTAPIRES SessionQuoteNext(const UINT wday,const UINT pos,IMTConSymbolSession* session) const=0;
  470. //--- trade sessions
  471. virtual MTAPIRES SessionTradeAdd(const UINT wday,IMTConSymbolSession* symbol)=0;
  472. virtual MTAPIRES SessionTradeUpdate(const UINT wday,const UINT pos,const IMTConSymbolSession* session)=0;
  473. virtual MTAPIRES SessionTradeDelete(const UINT wday,const UINT pos)=0;
  474. virtual MTAPIRES SessionTradeClear(const UINT wday)=0;
  475. virtual MTAPIRES SessionTradeShift(const UINT wday,const UINT pos,const int shift)=0;
  476. virtual UINT SessionTradeTotal(const UINT wday) const=0;
  477. virtual MTAPIRES SessionTradeNext(const UINT wday,const UINT pos,IMTConSymbolSession* session) const=0;
  478. //--- request execution flags
  479. virtual UINT REFlags(void) const=0;
  480. virtual MTAPIRES REFlags(const UINT flags)=0;
  481. //--- request execution timeout
  482. virtual UINT RETimeout(void) const=0;
  483. virtual MTAPIRES RETimeout(const UINT timeout)=0;
  484. //--- instant execution check mode
  485. virtual UINT IECheckMode(void) const=0;
  486. virtual MTAPIRES IECheckMode(const UINT mode)=0;
  487. //--- instant execution timeout
  488. virtual UINT IETimeout(void) const=0;
  489. virtual MTAPIRES IETimeout(const UINT timeout)=0;
  490. //--- instant execution profit slippage
  491. virtual UINT IESlipProfit(void) const=0;
  492. virtual MTAPIRES IESlipProfit(const UINT slippage)=0;
  493. //--- instant execution losing slippage
  494. virtual UINT IESlipLosing(void) const=0;
  495. virtual MTAPIRES IESlipLosing(const UINT slippage)=0;
  496. //--- instant execution max volume
  497. virtual UINT64 IEVolumeMax(void) const=0;
  498. virtual MTAPIRES IEVolumeMax(const UINT64 volume)=0;
  499. //--- settle price (for futures)
  500. virtual double PriceSettle(void) const=0;
  501. virtual MTAPIRES PriceSettle(const double price)=0;
  502. //--- price limit max (for futures)
  503. virtual double PriceLimitMax(void) const=0;
  504. virtual MTAPIRES PriceLimitMax(const double price)=0;
  505. //--- price limit min (for futures)
  506. virtual double PriceLimitMin(void) const=0;
  507. virtual MTAPIRES PriceLimitMin(const double price)=0;
  508. //--- EnTradeFlags
  509. virtual UINT64 TradeFlags(void) const=0;
  510. virtual MTAPIRES TradeFlags(const UINT64 flags)=0;
  511. //--- EnOrderFlags
  512. virtual UINT OrderFlags(void) const=0;
  513. virtual MTAPIRES OrderFlags(const UINT flags)=0;
  514. //--- orders and positions margin rates
  515. virtual double MarginRateInitial(const UINT type) const=0;
  516. virtual MTAPIRES MarginRateInitial(const UINT type,const double margin_rate)=0;
  517. //--- orders and positions margin rates
  518. virtual double MarginRateMaintenance(const UINT type) const=0;
  519. virtual MTAPIRES MarginRateMaintenance(const UINT type,const double margin_rate)=0;
  520. //--- options mode EnOptionMode
  521. virtual UINT OptionsMode(void) const=0;
  522. virtual MTAPIRES OptionsMode(const UINT mode)=0;
  523. //--- option strike price value
  524. virtual double PriceStrike(void) const=0;
  525. virtual MTAPIRES PriceStrike(const double price)=0;
  526. //--- liqudity rate
  527. virtual double MarginRateLiqudity(void) const=0;
  528. virtual MTAPIRES MarginRateLiqudity(const double margin_rate)=0;
  529. //--- bond face value
  530. virtual double FaceValue(void) const=0;
  531. virtual MTAPIRES FaceValue(const double value)=0;
  532. //--- bond accrued interest
  533. virtual double AccruedInterest(void) const=0;
  534. virtual MTAPIRES AccruedInterest(const double interest)=0;
  535. //--- futures splice type EnSpliceType
  536. virtual UINT SpliceType(void) const=0;
  537. virtual MTAPIRES SpliceType(const UINT type)=0;
  538. //--- futures splice time type EnSpliceType
  539. virtual UINT SpliceTimeType(void) const=0;
  540. virtual MTAPIRES SpliceTimeType(const UINT time_type)=0;
  541. //--- options splice point in days
  542. virtual UINT SpliceTimeDays(void) const=0;
  543. virtual MTAPIRES SpliceTimeDays(const UINT days)=0;
  544. //--- hedged positions margin rate
  545. virtual double MarginHedged(void) const=0;
  546. virtual MTAPIRES MarginHedged(const double margin)=0;
  547. //--- currency rate
  548. virtual double MarginRateCurrency(void) const=0;
  549. virtual MTAPIRES MarginRateCurrency(const double margin_rate)=0;
  550. //--- gap level
  551. virtual UINT FilterGap(void) const=0;
  552. virtual MTAPIRES FilterGap(const UINT gap)=0;
  553. //--- gap level ticks
  554. virtual UINT FilterGapTicks(void) const=0;
  555. virtual MTAPIRES FilterGapTicks(const UINT ticks)=0;
  556. //--- chart mode
  557. virtual UINT ChartMode(void) const=0;
  558. virtual MTAPIRES ChartMode(const UINT mode)=0;
  559. //--- currency digits
  560. virtual MTAPIRES CurrencyBaseDigitsSet(const UINT digits)=0;
  561. virtual MTAPIRES CurrencyProfitDigitsSet(const UINT digits)=0;
  562. virtual MTAPIRES CurrencyMarginDigitsSet(const UINT digits)=0;
  563. //--- instant execution flags with extended accuracy
  564. virtual UINT IEFlags(void) const=0;
  565. virtual MTAPIRES IEFlags(const UINT flags)=0;
  566. //--- minimal volume with extended accuracy
  567. virtual UINT64 VolumeMinExt(void) const=0;
  568. virtual MTAPIRES VolumeMinExt(const UINT64 volume)=0;
  569. //--- maximal volume with extended accuracy
  570. virtual UINT64 VolumeMaxExt(void) const=0;
  571. virtual MTAPIRES VolumeMaxExt(const UINT64 volume)=0;
  572. //--- volume step with extended accuracy
  573. virtual UINT64 VolumeStepExt(void) const=0;
  574. virtual MTAPIRES VolumeStepExt(const UINT64 volume)=0;
  575. //--- cumulative positions and orders limit with extended accuracy
  576. virtual UINT64 VolumeLimitExt(void) const=0;
  577. virtual MTAPIRES VolumeLimitExt(const UINT64 volume)=0;
  578. //--- instant execution max volume with extended accuracy
  579. virtual UINT64 IEVolumeMaxExt(void) const=0;
  580. virtual MTAPIRES IEVolumeMaxExt(const UINT64 volume)=0;
  581. //--- category
  582. virtual LPCWSTR Category(void) const=0;
  583. virtual MTAPIRES Category(LPCWSTR category)=0;
  584. //--- exchange
  585. virtual LPCWSTR Exchange(void) const=0;
  586. virtual MTAPIRES Exchange(LPCWSTR exchange)=0;
  587. //--- CFI
  588. virtual LPCWSTR CFI(void) const=0;
  589. virtual MTAPIRES CFI(LPCWSTR cfi)=0;
  590. };
  591. //+------------------------------------------------------------------+
  592. //| Symbol config events notification interface |
  593. //+------------------------------------------------------------------+
  594. class IMTConSymbolSink
  595. {
  596. public:
  597. virtual void OnSymbolAdd(const IMTConSymbol* /*config*/) { }
  598. virtual void OnSymbolUpdate(const IMTConSymbol* /*config*/) { }
  599. virtual void OnSymbolDelete(const IMTConSymbol* /*config*/) { }
  600. virtual void OnSymbolSync(void) { }
  601. };
  602. //+------------------------------------------------------------------+