MT5APIReport.h 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. //+------------------------------------------------------------------+
  2. //| MetaTrader 5 API Report |
  3. //| Copyright 2000-2019, MetaQuotes Software Corp. |
  4. //| http://www.metaquotes.net |
  5. //+------------------------------------------------------------------+
  6. #pragma once
  7. #include "MT5APIConstants.h"
  8. #include "MT5APILogger.h"
  9. #include "MT5APITools.h"
  10. #include "Config\MT5APIConfigReport.h"
  11. #include "Config\MT5APIConfigCommon.h"
  12. #include "Config\MT5APIConfigTime.h"
  13. #include "Config\MT5APIConfigHoliday.h"
  14. #include "Config\MT5APIConfigSymbol.h"
  15. #include "Config\MT5APIConfigGroup.h"
  16. #include "Config\MT5APIConfigManager.h"
  17. #include "Config\MT5APIConfigNetwork.h"
  18. #include "Config\MT5APIConfigPlugin.h"
  19. #include "Config\MT5APIConfigFeeder.h"
  20. #include "Config\MT5APIConfigGateway.h"
  21. #include "Config\MT5APIConfigFund.h"
  22. #include "Config\MT5APIConfigParam.h"
  23. #include "Bases\MT5APIUser.h"
  24. #include "Bases\MT5APIAccount.h"
  25. #include "Bases\MT5APIDeal.h"
  26. #include "Bases\MT5APIOrder.h"
  27. #include "Bases\MT5APIPosition.h"
  28. #include "Bases\MT5APIDaily.h"
  29. #include "Bases\MT5APITick.h"
  30. #include "Bases\MT5APIChart.h"
  31. #include "Bases\MT5APIDataset.h"
  32. #include "Bases\MT5APIClient.h"
  33. //+------------------------------------------------------------------+
  34. //| Report API version |
  35. //+------------------------------------------------------------------+
  36. #define MTReportAPIVersion 2190
  37. #define MTReportAPIDate L"18 Oct 2019"
  38. //+------------------------------------------------------------------+
  39. //| Report constants |
  40. //+------------------------------------------------------------------+
  41. //+------------------------------------------------------------------+
  42. //| Standard report parameter names |
  43. //+------------------------------------------------------------------+
  44. #define MTAPI_PARAM_GROUPS L"Groups" // Groups list
  45. #define MTAPI_PARAM_SYMBOLS L"Symbols" // Symbols list
  46. #define MTAPI_PARAM_FROM L"From" // From
  47. #define MTAPI_PARAM_TO L"To" // To
  48. #define MTAPI_PARAM_LEAD_SOURCE L"Lead Source" // Lead Source
  49. #define MTAPI_PARAM_LEAD_CAMPAIGN L"Lead Campaign" // Lead Campaign
  50. #define MTAPI_PARAM_IE_VERSION L"IE_Version" // IE version
  51. #define MTAPI_PARAM_SCR_WIDTH L"Screen_Width" // Screen width
  52. #define MTAPI_PARAM_SCR_HEIGHT L"Screen_Height" // Screen height
  53. //+------------------------------------------------------------------+
  54. //| Standard report colors of accounts |
  55. //+------------------------------------------------------------------+
  56. #define MTAPI_COLOR_ACOUNTS_REAL 0xCC4748 // Color of real accounts
  57. #define MTAPI_COLOR_ACOUNTS_PRELIMINARY 0x84B761 // Color of preliminary accounts
  58. #define MTAPI_COLOR_ACOUNTS_DEMO 0xB7B83F // Color of demo accounts
  59. #define MTAPI_COLOR_ACOUNTS_CONTEST 0x67B7DC // Color of contest accounts
  60. #define MTAPI_COLOR_ACOUNTS_COVERAGE 0xF9A825 // Color of coverage accounts
  61. #define MTAPI_COLOR_ACOUNTS_MANAGER 0xB9783F // Color of manager accounts
  62. #define MTAPI_COLOR_ACOUNTS_OTHER 0x607D8B // Color of other accounts
  63. //+------------------------------------------------------------------+
  64. //| Standard report colors of profit and loss |
  65. //+------------------------------------------------------------------+
  66. #define MTAPI_COLOR_PROFIT 0x84B761 // Color of profit
  67. #define MTAPI_COLOR_LOSS 0xCC4748 // Color of loss
  68. #define MTAPI_COLOR_NET_PROFIT 0x67B7DC // Color of net profit
  69. //+------------------------------------------------------------------+
  70. //| Standard report colors of terminal types |
  71. //+------------------------------------------------------------------+
  72. #define MTAPI_COLOR_TERMINAL_CLIENT 0x67B7DC // Color of Client terminal
  73. #define MTAPI_COLOR_TERMINAL_IPHONE 0x84B761 // Color of IPhone terminal
  74. #define MTAPI_COLOR_TERMINAL_ANDROID 0xFDD400 // Color of Android terminal
  75. //+------------------------------------------------------------------+
  76. //| Common colors to draw charts and graphs |
  77. //+------------------------------------------------------------------+
  78. static UINT ExtChartColors[]= {
  79. 0x2196F3,
  80. 0x2F4074,
  81. 0xFDD400,
  82. 0xCD82AD,
  83. 0xCC4748,
  84. 0x967BDC,
  85. 0xB7B83F,
  86. 0x67B7DC,
  87. 0x84B761,
  88. 0x607D8B,
  89. 0xF9A825
  90. };
  91. //+------------------------------------------------------------------+
  92. //| Structures |
  93. //+------------------------------------------------------------------+
  94. //+------------------------------------------------------------------+
  95. //| Report parameter structure |
  96. //+------------------------------------------------------------------+
  97. #pragma pack(push,1)
  98. struct MTReportParam
  99. {
  100. //--- parameter types
  101. enum ParamType
  102. {
  103. TYPE_STRING =0, // string
  104. TYPE_INT =1, // integer
  105. TYPE_FLOAT =2, // floating
  106. TYPE_TIME =3, // time only
  107. TYPE_DATE =4, // date only
  108. TYPE_DATETIME =5, // date & time
  109. TYPE_GROUPS =6, // groups list
  110. TYPE_SYMBOLS =7, // symbols list
  111. //--- enumeration borders
  112. TYPE_FIRST =TYPE_STRING,
  113. TYPE_LAST =TYPE_SYMBOLS
  114. };
  115. //---
  116. UINT type; // type
  117. wchar_t name[64]; // name
  118. wchar_t defvalue[256]; // default value
  119. UINT reserved[16]; // reserved
  120. };
  121. #pragma pack(pop)
  122. //+------------------------------------------------------------------+
  123. //| Report about structure |
  124. //+------------------------------------------------------------------+
  125. #pragma pack(push,1)
  126. struct MTReportInfo
  127. {
  128. //--- snapshot mode flags
  129. enum EnSnapshots
  130. {
  131. SNAPSHOT_NONE =0x0, // without snapshots
  132. SNAPSHOT_USERS =0x1, // users database snapshot for request
  133. SNAPSHOT_USERS_FULL =0x2, // full users database snapshot
  134. SNAPSHOT_ACCOUNTS =0x4, // trade account states snapshot
  135. SNAPSHOT_ACCOUNTS_FULL =0x8, // trade account states snapshot for request
  136. SNAPSHOT_ORDERS =0x10, // orders database snapshot
  137. SNAPSHOT_ORDERS_FULL =0x20, // orders database snapshot for request
  138. SNAPSHOT_POSITIONS =0x40, // positions database snapshot
  139. SNAPSHOT_POSITIONS_FULL=0x80, // positions database snapshot for request
  140. //--- enumeration borders
  141. SNAPSHOT_ALL =SNAPSHOT_USERS|SNAPSHOT_ACCOUNTS|SNAPSHOT_ORDERS|SNAPSHOT_POSITIONS,
  142. SNAPSHOT_ALL_FULL =SNAPSHOT_USERS_FULL|SNAPSHOT_ACCOUNTS_FULL|SNAPSHOT_ORDERS_FULL|SNAPSHOT_POSITIONS_FULL,
  143. };
  144. //--- types reports
  145. enum EnTypes
  146. {
  147. TYPE_NONE =0x0, // no support
  148. TYPE_HTML =0x1, // hypertext
  149. TYPE_TABLE =0x2, // binary table
  150. TYPE_DASHBOARD =0x4, // dashboard
  151. //--- enumeration borders
  152. TYPE_ALL =TYPE_HTML|TYPE_TABLE|TYPE_DASHBOARD
  153. };
  154. //--- minimal IE version
  155. enum EnIEVersion
  156. {
  157. IE_VERSION_ANY =0x0000, // any IE version
  158. IE_VERSION_9 =0x0900, // IE 9 required
  159. //--- enumeration borders
  160. IE_VERSION_FIRST =IE_VERSION_ANY,
  161. IE_VERSION_LAST =IE_VERSION_9,
  162. };
  163. //--- information
  164. UINT version; // report version
  165. UINT version_api; // report API version
  166. UINT version_ie; // minimal IE version
  167. wchar_t name[64]; // report name
  168. wchar_t copyright[128]; // copyright
  169. wchar_t description[256]; // description
  170. UINT snapshots; // snapshot modes
  171. UINT types; // report types
  172. wchar_t category[64]; // report category
  173. MTReportParam params[64]; // request parameters
  174. UINT params_total; // request parameters total
  175. MTReportParam config[64]; // config parameters
  176. UINT config_total; // config parameters total
  177. UINT reserved[64]; // reserved
  178. };
  179. #pragma pack(pop)
  180. //+------------------------------------------------------------------+
  181. //| Server description structure |
  182. //+------------------------------------------------------------------+
  183. #pragma pack(push,1)
  184. struct MTReportServerInfo
  185. {
  186. wchar_t platform_name[64]; // platform name
  187. wchar_t platform_owner[128]; // platform owner
  188. UINT server_version; // server version
  189. UINT server_build; // server build
  190. UINT server_type; // server type
  191. UINT64 server_id; // server id
  192. UINT reserved[32]; // reserved
  193. };
  194. #pragma pack(pop)
  195. //+------------------------------------------------------------------+
  196. //| Report chart series interface |
  197. //+------------------------------------------------------------------+
  198. class IMTReportSeries
  199. {
  200. public:
  201. //--- series type
  202. enum EnSeriesType
  203. {
  204. TYPE_TITLE =0, // title
  205. //---
  206. TYPE_LINE =100, // line
  207. TYPE_HISTOGRAM =101, // histogram
  208. TYPE_BAR =102, // bar
  209. TYPE_AREA =103, // area
  210. TYPE_PIECE =104, // piece for pie
  211. //--- enumeration borders
  212. TYPE_FIRST =TYPE_TITLE,
  213. TYPE_LAST =TYPE_PIECE
  214. };
  215. //--- flags
  216. enum EnSeriesFlags
  217. {
  218. FLAG_NONE =0x0000000,
  219. FLAG_SHOW_VALUES =0x0000001, // show series values on chart
  220. //--- enumeration borders
  221. FLAG_ALL =FLAG_SHOW_VALUES
  222. };
  223. public:
  224. //--- common methods
  225. virtual void Release(void)=0;
  226. virtual MTAPIRES Assign(const IMTReportSeries *series)=0;
  227. virtual MTAPIRES Clear(void)=0;
  228. //--- title
  229. virtual LPCWSTR Title(void) const=0;
  230. virtual MTAPIRES Title(LPCWSTR title)=0;
  231. //--- type
  232. virtual UINT Type(void) const=0;
  233. virtual MTAPIRES Type(const UINT type)=0;
  234. //--- flags IMTReportSeries::EnSeriesFlags
  235. virtual UINT64 Flags(void) const=0;
  236. virtual MTAPIRES Flags(const UINT64 flags)=0;
  237. //--- color
  238. virtual UINT Color(void) const=0;
  239. virtual MTAPIRES Color(const UINT color)=0;
  240. //--- tooltip format
  241. virtual LPCWSTR Tooltip(void) const=0;
  242. virtual MTAPIRES Tooltip(LPCWSTR tooltip)=0;
  243. //--- values management
  244. virtual MTAPIRES ValueClear(void)=0;
  245. virtual UINT ValueTotal(void) const=0;
  246. virtual MTAPIRES ValueAdd(LPCWSTR value)=0;
  247. virtual MTAPIRES ValueAddInt(const INT64 value)=0;
  248. virtual MTAPIRES ValueAddDouble(const double value)=0;
  249. virtual MTAPIRES ValueUpdate(const UINT pos,LPCWSTR value)=0;
  250. virtual MTAPIRES ValueUpdateInt(const UINT pos,const INT64 value)=0;
  251. virtual MTAPIRES ValueUpdateDouble(const UINT pos,const double value)=0;
  252. virtual LPCWSTR ValueNext(const UINT pos) const=0;
  253. virtual MTAPIRES ValueNextInt(const UINT pos,INT64& value) const=0;
  254. virtual MTAPIRES ValueNextDouble(const UINT pos,double& value) const=0;
  255. virtual MTAPIRES ValueShift(const UINT pos,const int shift)=0;
  256. virtual MTAPIRES ValueDelete(const UINT pos)=0;
  257. virtual MTAPIRES ValueDescription(const UINT pos,LPCWSTR descr)=0;
  258. virtual LPCWSTR ValueDescription(const UINT pos) const=0;
  259. };
  260. //+------------------------------------------------------------------+
  261. //| Report chart interface |
  262. //+------------------------------------------------------------------+
  263. class IMTReportChart
  264. {
  265. public:
  266. //--- chart type
  267. enum EnChartType
  268. {
  269. TYPE_GRAPH =0, // classical chart
  270. TYPE_GRAPH_ACCUMULATION =1, // classical chart with accumulation
  271. TYPE_GRAPH_NORMALIZED =2, // classical chart with normalization
  272. TYPE_GRAPH_STACKED =3, // classical chart with stack
  273. //---
  274. TYPE_BAR =100, // line bar chart
  275. TYPE_BAR_ACCUMULATION =101, // line bar chart with accumulation
  276. TYPE_BAR_NORMALIZED =102, // line bar chart with normalization
  277. TYPE_BAR_STACKED =103, // line bar chart with stack
  278. //---
  279. TYPE_PIE =200, // pie chart
  280. //--- enumeration borders
  281. TYPE_FIRST =TYPE_GRAPH,
  282. TYPE_LAST =TYPE_PIE
  283. };
  284. //--- flags
  285. enum EnChartFlags
  286. {
  287. FLAG_NONE =0x00000000,
  288. FLAG_ACCUMULATED_VALUES =0x00000001, // show accumulated values
  289. FLAG_SHOW_TABLE =0x00000002, // show value table
  290. //--- enumeration borders
  291. FLAG_ALL =FLAG_ACCUMULATED_VALUES|FLAG_SHOW_TABLE
  292. };
  293. //--- common methods
  294. virtual void Release(void)=0;
  295. virtual MTAPIRES Assign(const IMTReportChart *chart)=0;
  296. virtual MTAPIRES Clear(void)=0;
  297. //--- title
  298. virtual LPCWSTR Title(void) const=0;
  299. virtual MTAPIRES Title(LPCWSTR title)=0;
  300. //--- type
  301. virtual UINT Type(void) const=0;
  302. virtual MTAPIRES Type(const UINT type)=0;
  303. //--- digits
  304. virtual UINT Digits(void) const=0;
  305. virtual MTAPIRES Digits(const UINT digits)=0;
  306. //--- flags
  307. virtual UINT64 Flags(void) const=0;
  308. virtual MTAPIRES Flags(const UINT64 flags)=0;
  309. //--- bar height
  310. virtual UINT BarHeight(void) const=0;
  311. virtual MTAPIRES BarHeight(const UINT height)=0;
  312. //--- piece tooltip format
  313. virtual LPCWSTR PieceTooltip(void)=0;
  314. virtual MTAPIRES PieceTooltip(LPCWSTR tooltip)=0;
  315. //--- piece description format
  316. virtual LPCWSTR PieceDescription(void)=0;
  317. virtual MTAPIRES PieceDescription(LPCWSTR description)=0;
  318. //--- series management
  319. virtual MTAPIRES SeriesClear(void)=0;
  320. virtual MTAPIRES SeriesAdd(IMTReportSeries *series)=0;
  321. virtual MTAPIRES SeriesAddCopy(const IMTReportSeries *series)=0;
  322. virtual MTAPIRES SeriesDelete(const UINT pos)=0;
  323. virtual IMTReportSeries* SeriesDetach(const UINT pos)=0;
  324. virtual MTAPIRES SeriesUpdate(const UINT pos,IMTReportSeries* series)=0;
  325. virtual MTAPIRES SeriesShift(const UINT pos,const int shift)=0;
  326. virtual UINT SeriesTotal(void) const=0;
  327. virtual IMTReportSeries* SeriesNext(const UINT pos)=0;
  328. };
  329. //+------------------------------------------------------------------+
  330. //| Report HTML interface |
  331. //+------------------------------------------------------------------+
  332. class IMTReportDashboardHtml
  333. {
  334. public:
  335. //--- common methods
  336. virtual MTAPIRES Assign(const IMTReportDashboardHtml *html)=0;
  337. virtual MTAPIRES Clear(void)=0;
  338. //--- HTML management
  339. virtual MTAPIRES Write(LPCWSTR format,...)=0;
  340. virtual MTAPIRES WriteSafe(LPCWSTR html,const UINT flags)=0;
  341. virtual MTAPIRES WriteChart(const IMTReportChart *chart)=0;
  342. virtual MTAPIRES WriteReserved1(void)=0;
  343. virtual MTAPIRES WriteReserved2(void)=0;
  344. //--- html template processing
  345. virtual MTAPIRES TplLoad(LPCWSTR templstr)=0;
  346. virtual MTAPIRES TplLoadFile(LPCWSTR templname)=0;
  347. virtual MTAPIRES TplLoadResource(const UINT resid,LPCWSTR restype)=0;
  348. virtual MTAPIRES TplNext(MTAPISTR& tag,UINT *counter)=0;
  349. virtual MTAPIRES TplProcess(const UINT flags)=0;
  350. virtual MTAPIRES TplReserved1(void)=0;
  351. virtual MTAPIRES TplReserved2(void)=0;
  352. };
  353. //+------------------------------------------------------------------+
  354. //| Report widget interface |
  355. //+------------------------------------------------------------------+
  356. class IMTReportDashboardWidget
  357. {
  358. public:
  359. //--- chart type
  360. enum EnWidgetType
  361. {
  362. //--- charts
  363. WIDGET_TYPE_CHART_BAR =0, // bar chart
  364. WIDGET_TYPE_CHART_LINE =1, // line chart
  365. WIDGET_TYPE_CHART_AREA =2, // area chart
  366. WIDGET_TYPE_CHART_PIE =3, // pie chart
  367. WIDGET_TYPE_CHART_SPLINE=4, // spline chart
  368. WIDGET_TYPE_CHART_AREA_SPLINE=5, // area spline chart
  369. //---
  370. WIDGET_TYPE_VALUE =100, // single value
  371. WIDGET_TYPE_TABLE =101, // table
  372. WIDGET_TYPE_HTML =102, // HTML
  373. //--- enumeration borders
  374. WIDGET_TYPE_FIRST =WIDGET_TYPE_CHART_BAR,
  375. WIDGET_TYPE_LAST =WIDGET_TYPE_HTML
  376. };
  377. //--- chart stack type
  378. enum EnChartStackType
  379. {
  380. CHART_STACK_NONE =0, // no stack chart
  381. CHART_STACK_SIMPLE =1, // simple stack chart
  382. CHART_STACK_ACCUMULATION=2, // accumulation stack chart
  383. CHART_STACK_NORMALIZED =3, // normalized stack chart
  384. //--- enumeration borders
  385. CHART_STACK_FIRST =CHART_STACK_NONE,
  386. CHART_STACK_LAST =CHART_STACK_NORMALIZED
  387. };
  388. //--- chart value axis type
  389. enum EnChartValueAxis
  390. {
  391. CHART_VALUE_AXIS_ABSOLUTE=0, // absolute value axis
  392. CHART_VALUE_AXIS_RELATIVE=1, // relative value axis
  393. //--- enumeration borders
  394. CHART_VALUE_AXIS_FIRST =CHART_VALUE_AXIS_ABSOLUTE,
  395. CHART_VALUE_AXIS_LAST =CHART_VALUE_AXIS_RELATIVE
  396. };
  397. //--- flags
  398. enum EnWidgetFlags
  399. {
  400. WIDGET_FLAG_NONE =0x00000000, // no flags
  401. WIDGET_FLAG_AUTO_WIDTH =0x00000001, // auto width
  402. WIDGET_FLAG_AUTO_HEIGHT =0x00000002, // auto height
  403. WIDGET_FLAG_AUTO_TOP =0x00000004, // auto top
  404. WIDGET_FLAG_AUTO_LEFT =0x00000008, // auto left
  405. //--- enumeration borders
  406. WIDGET_FLAG_DEFAULT =WIDGET_FLAG_AUTO_WIDTH|WIDGET_FLAG_AUTO_HEIGHT|WIDGET_FLAG_AUTO_TOP|WIDGET_FLAG_AUTO_LEFT,
  407. WIDGET_FLAG_ALL =WIDGET_FLAG_AUTO_WIDTH|WIDGET_FLAG_AUTO_HEIGHT|WIDGET_FLAG_AUTO_TOP|WIDGET_FLAG_AUTO_LEFT
  408. };
  409. //--- common methods
  410. virtual MTAPIRES Assign(const IMTReportDashboardWidget *widget)=0;
  411. virtual MTAPIRES Clear(void)=0;
  412. //--- title
  413. virtual LPCWSTR Title(void) const=0;
  414. virtual MTAPIRES Title(LPCWSTR title)=0;
  415. //--- type
  416. virtual UINT Type(void) const=0;
  417. virtual MTAPIRES Type(const UINT type)=0;
  418. //--- chart stack type
  419. virtual UINT ChartStackType(void) const=0;
  420. virtual MTAPIRES ChartStackType(const UINT stack_type)=0;
  421. //--- flags
  422. virtual UINT64 Flags(void) const=0;
  423. virtual MTAPIRES Flags(const UINT64 flags)=0;
  424. //--- widget width
  425. virtual UINT Width(void) const=0;
  426. virtual MTAPIRES Width(const UINT width)=0;
  427. //--- widget height
  428. virtual UINT Height(void) const=0;
  429. virtual MTAPIRES Height(const UINT height)=0;
  430. //--- widget left edge position
  431. virtual UINT Left(void) const=0;
  432. virtual MTAPIRES Left(const UINT left)=0;
  433. //--- widget top edge position
  434. virtual UINT Top(void) const=0;
  435. virtual MTAPIRES Top(const UINT top)=0;
  436. //--- description
  437. virtual LPCWSTR Description(void) const=0;
  438. virtual MTAPIRES Description(LPCWSTR description)=0;
  439. //--- chart value axis
  440. virtual UINT ChartValueAxis(void) const=0;
  441. virtual MTAPIRES ChartValueAxis(const UINT value_axis)=0;
  442. //--- HTML
  443. virtual IMTReportDashboardHtml* Html(void)=0;
  444. virtual MTAPIRES Html(IMTReportDashboardHtml *html)=0;
  445. //--- dataset
  446. virtual IMTDataset* Data(void)=0;
  447. virtual MTAPIRES Data(IMTDataset *data_set)=0;
  448. //--- title column
  449. virtual UINT DataColumnTitle(void) const=0;
  450. virtual MTAPIRES DataColumnTitle(const UINT column_id)=0;
  451. //--- data set column management
  452. virtual MTAPIRES DataColumnClear(void)=0;
  453. virtual MTAPIRES DataColumnAdd(const UINT column_id)=0;
  454. virtual MTAPIRES DataColumnDelete(const UINT pos)=0;
  455. virtual MTAPIRES DataColumnShift(const UINT pos,const int shift)=0;
  456. virtual UINT DataColumnTotal(void) const=0;
  457. virtual const UINT* DataColumnNext(const UINT pos) const=0;
  458. };
  459. //+------------------------------------------------------------------+
  460. //| Report cache key set interface |
  461. //+------------------------------------------------------------------+
  462. class IMTReportCacheKeySet
  463. {
  464. public:
  465. //--- common methods
  466. virtual void Release(void)=0;
  467. virtual MTAPIRES Assign(const IMTReportCacheKeySet *keyset)=0;
  468. virtual MTAPIRES Clear(void)=0;
  469. //--- swap with keyset
  470. virtual MTAPIRES Swap(IMTReportCacheKeySet *keyset)=0;
  471. //--- total keys in set
  472. virtual UINT Total(void) const=0;
  473. //--- pointer to keys sorted array
  474. virtual const UINT64* Array(void) const=0;
  475. //--- iterate sorted keys in array
  476. virtual const UINT64* Next(const UINT64 *key) const=0;
  477. //--- search key
  478. virtual const UINT64* Search(const UINT64 key) const=0;
  479. //--- check all keys from passed set present
  480. virtual MTAPIRES ContainsSet(const IMTReportCacheKeySet *keyset) const=0;
  481. //--- reserve memory for keys
  482. virtual MTAPIRES Reserve(const UINT total)=0;
  483. //--- insert keys
  484. virtual MTAPIRES Insert(const UINT64 key)=0;
  485. virtual MTAPIRES InsertArray(const UINT64 *keys,const UINT total)=0;
  486. virtual MTAPIRES InsertSet(const IMTReportCacheKeySet *keyset)=0;
  487. //--- remove keys
  488. virtual MTAPIRES Remove(const UINT64 key)=0;
  489. virtual MTAPIRES RemoveArray(const UINT64 *keys,const UINT total)=0;
  490. virtual MTAPIRES RemoveSet(const IMTReportCacheKeySet *keyset)=0;
  491. };
  492. //+------------------------------------------------------------------+
  493. //| Report cache value interface |
  494. //| Contains valid key and data until next calls: |
  495. //| IMTReportCache::Release() |
  496. //| IMTReportCache::ReadEnd() |
  497. //| IMTReportCache::WriteEnd() |
  498. //+------------------------------------------------------------------+
  499. class IMTReportCacheValue
  500. {
  501. public:
  502. //--- release interface
  503. virtual void Release(void)=0;
  504. //--- key
  505. virtual UINT64 Key(void) const=0;
  506. //--- data
  507. virtual const void* Data(void) const=0;
  508. virtual UINT Size(void) const=0;
  509. //--- iterate to next value
  510. virtual MTAPIRES Next(void)=0;
  511. };
  512. //+------------------------------------------------------------------+
  513. //| Report cache interface |
  514. //+------------------------------------------------------------------+
  515. class IMTReportCache
  516. {
  517. public:
  518. //--- release interface
  519. virtual void Release(void)=0;
  520. //--- name
  521. virtual LPCWSTR Name(void) const=0;
  522. //--- last generation time
  523. virtual INT64 TimeLastWrite(void) const=0;
  524. //--- create value object
  525. virtual IMTReportCacheValue* ValueCreate(void) const=0;
  526. //--- read begin/end
  527. virtual MTAPIRES ReadBegin(void)=0;
  528. virtual MTAPIRES ReadEnd(void)=0;
  529. //--- read parameters
  530. virtual INT64 ReadParamFrom(void) const=0;
  531. virtual INT64 ReadParamTo(void) const=0;
  532. virtual LPCWSTR ReadParamString(void) const=0;
  533. virtual const void* ReadParamData(UINT &size) const=0;
  534. virtual MTAPIRES ReadParamKeySet(IMTReportCacheKeySet *keys) const=0;
  535. //--- read value by key
  536. virtual MTAPIRES ReadValue(const UINT64 key,IMTReportCacheValue *value) const=0;
  537. //--- read multiple values by key set
  538. virtual MTAPIRES ReadValues(const IMTReportCacheKeySet *keys,IMTReportCacheValue *value) const=0;
  539. //--- get keys from set that missing in cache
  540. virtual MTAPIRES ReadMissingKeys(const IMTReportCacheKeySet *keys,IMTReportCacheKeySet *missing_keys) const=0;
  541. //--- get string position in dictionary
  542. virtual MTAPIRES ReadDictionaryPos(const UINT dictionary_id,LPCWSTR string,UINT &pos) const=0;
  543. //--- get string from dictionary by position
  544. virtual MTAPIRES ReadDictionaryString(const UINT dictionary_id,const UINT pos,LPCWSTR &string) const=0;
  545. //--- write begin/end
  546. virtual MTAPIRES WriteBegin(void)=0;
  547. virtual MTAPIRES WriteEnd(bool apply)=0;
  548. //--- write parameters
  549. virtual MTAPIRES WriteParamFrom(const INT64 from)=0;
  550. virtual MTAPIRES WriteParamTo(const INT64 to)=0;
  551. virtual MTAPIRES WriteParamString(LPCWSTR param)=0;
  552. virtual MTAPIRES WriteParamData(const void *data,const UINT size)=0;
  553. virtual MTAPIRES WriteParamKeySet(const IMTReportCacheKeySet *keys,const bool merge)=0;
  554. //--- write value by key
  555. virtual MTAPIRES WriteValue(const UINT64 key,const void *value,const UINT size)=0;
  556. //--- write empty value for keys from set that missing in cache
  557. virtual MTAPIRES WriteMissingKeys(const IMTReportCacheKeySet *keys)=0;
  558. //--- write new string to dictionary or get existing string position
  559. virtual MTAPIRES WriteDictionaryString(const UINT dictionary_id,LPCWSTR string,UINT &pos)=0;
  560. };
  561. //+------------------------------------------------------------------+
  562. //| Report API interface |
  563. //+------------------------------------------------------------------+
  564. class IMTReportAPI
  565. {
  566. public:
  567. //--- HtmlWriteSafe flags
  568. enum EnHtmlSafeFlags
  569. {
  570. HTML_SAFE_NONE =0x0, // no flags
  571. HTML_SAFE_USENOBSP =0x1, // replace blank to  
  572. };
  573. //--- HtmlTplProcess flags
  574. enum EnTplProcessFlags
  575. {
  576. TPL_PROCESS_NONE =0x0, // no flags
  577. };
  578. //--- Dashboard flags
  579. enum EnDashboardFlags
  580. {
  581. DASHBOARD_FLAG_NONE =0x0, // no flags
  582. };
  583. public:
  584. //--- server description
  585. virtual MTAPIRES About(MTReportServerInfo& info)=0;
  586. //--- license check
  587. virtual MTAPIRES LicenseCheck(LPCWSTR license_name)=0;
  588. //--- memory management
  589. virtual void* Allocate(const UINT size)=0;
  590. virtual void Free(void* ptr)=0;
  591. //--- clear result
  592. virtual MTAPIRES Clear(void)=0;
  593. virtual MTAPIRES FunctionReserved1(void)=0;
  594. virtual MTAPIRES FunctionReserved2(void)=0;
  595. virtual MTAPIRES FunctionReserved3(void)=0;
  596. virtual MTAPIRES FunctionReserved4(void)=0;
  597. virtual MTAPIRES FunctionReserved5(void)=0;
  598. virtual MTAPIRES FunctionReserved6(void)=0;
  599. //--- common flags functions
  600. virtual MTAPIRES IsStopped(void)=0;
  601. virtual MTAPIRES IsReserved1(void)=0;
  602. virtual MTAPIRES IsReserved2(void)=0;
  603. virtual MTAPIRES IsReserved3(void)=0;
  604. virtual MTAPIRES IsReserved4(void)=0;
  605. virtual MTAPIRES IsReserved5(void)=0;
  606. virtual MTAPIRES IsReserved6(void)=0;
  607. //--- server log functions
  608. virtual MTAPIRES LoggerOut(const UINT code,LPCWSTR msg,...)=0;
  609. virtual MTAPIRES LoggerRequest(const UINT mode,const UINT type,const INT64 from,const INT64 to,LPCWSTR filter,MTLogRecord*& records,UINT& records_total)=0;
  610. virtual void LoggerFlush(void)=0;
  611. virtual MTAPIRES LoggerReserved1(void)=0;
  612. virtual MTAPIRES LoggerReserved2(void)=0;
  613. virtual MTAPIRES LoggerReserved3(void)=0;
  614. virtual MTAPIRES LoggerReserved4(void)=0;
  615. //--- report parameters
  616. virtual IMTConParam* ParamCreate(void)=0;
  617. virtual UINT ParamTotal(void)=0;
  618. virtual MTAPIRES ParamGet(LPCWSTR name,IMTConParam *param)=0;
  619. virtual MTAPIRES ParamNext(const UINT pos,IMTConParam *param)=0;
  620. virtual MTAPIRES ParamReserved1(void)=0;
  621. virtual MTAPIRES ParamReserved2(void)=0;
  622. virtual MTAPIRES ParamReserved3(void)=0;
  623. virtual MTAPIRES ParamReserved4(void)=0;
  624. //--- report parameters helpers
  625. virtual MTAPIRES ParamLogins(UINT64*& logins,UINT& total)=0;
  626. virtual INT64 ParamFrom(void)=0;
  627. virtual INT64 ParamTo(void)=0;
  628. virtual LPCWSTR ParamGroups(void)=0;
  629. virtual LPCWSTR ParamSymbols(void)=0;
  630. virtual UINT ParamIEVersion(void)=0;
  631. virtual UINT ParamScreenWidth(void)=0;
  632. virtual UINT ParamScreenHeight(void)=0;
  633. virtual MTAPIRES ParamHelperReserved1(void)=0;
  634. virtual MTAPIRES ParamHelperReserved2(void)=0;
  635. virtual MTAPIRES ParamHelperReserved3(void)=0;
  636. virtual MTAPIRES ParamHelperReserved4(void)=0;
  637. //--- HTML management
  638. virtual MTAPIRES HtmlWrite(LPCWSTR format,...)=0;
  639. virtual MTAPIRES HtmlWriteSafe(LPCWSTR html,const UINT flags)=0;
  640. virtual MTAPIRES HtmlWriteReserved1(void)=0;
  641. virtual MTAPIRES HtmlWriteReserved2(void)=0;
  642. virtual MTAPIRES HtmlTplLoad(LPCWSTR templstr)=0;
  643. virtual MTAPIRES HtmlTplLoadFile(LPCWSTR templname)=0;
  644. virtual MTAPIRES HtmlTplLoadResource(const UINT resid,LPCWSTR restype)=0;
  645. virtual MTAPIRES HtmlTplNext(MTAPISTR& tag,UINT *counter)=0;
  646. virtual MTAPIRES HtmlTplProcess(const UINT flags)=0;
  647. virtual MTAPIRES HtmlTplReserved1(void)=0;
  648. virtual MTAPIRES HtmlTplReserved2(void)=0;
  649. virtual MTAPIRES HtmlReserved1(void)=0;
  650. virtual MTAPIRES HtmlReserved2(void)=0;
  651. virtual MTAPIRES HtmlReserved3(void)=0;
  652. virtual MTAPIRES HtmlReserved4(void)=0;
  653. //--- table column management
  654. virtual IMTDatasetColumn* TableColumnCreate(void)=0;
  655. virtual MTAPIRES TableColumnClear(void)=0;
  656. virtual MTAPIRES TableColumnAdd(const IMTDatasetColumn *column)=0;
  657. virtual MTAPIRES TableColumnDelete(const UINT pos)=0;
  658. virtual UINT TableColumnTotal(void)=0;
  659. virtual UINT TableColumnSize(void)=0;
  660. virtual MTAPIRES TableColumnNext(const UINT pos,IMTDatasetColumn *column)=0;
  661. virtual MTAPIRES TableColumnReserved1(void)=0;
  662. virtual MTAPIRES TableColumnReserved2(void)=0;
  663. //--- table row management
  664. virtual MTAPIRES TableRowClear(void)=0;
  665. virtual MTAPIRES TableRowWrite(const void *data,const UINT size)=0;
  666. virtual UINT TableRowTotal(void)=0;
  667. virtual MTAPIRES TableRowReserved1(void)=0;
  668. virtual MTAPIRES TableRowReserved2(void)=0;
  669. //--- table summary management
  670. virtual IMTDatasetSummary* TableSummaryCreate(void)=0;
  671. virtual MTAPIRES TableSummaryClear(void)=0;
  672. virtual MTAPIRES TableSummaryAdd(const IMTDatasetSummary *summary)=0;
  673. virtual MTAPIRES TableSummaryDelete(const UINT pos)=0;
  674. virtual MTAPIRES TableSummaryNext(const UINT pos,IMTDatasetSummary *summary)=0;
  675. virtual UINT TableSummaryTotal(void)=0;
  676. virtual MTAPIRES TableSummaryReserved1(void)=0;
  677. virtual MTAPIRES TableSummaryReserved2(void)=0;
  678. virtual MTAPIRES TableSummaryReserved3(void)=0;
  679. //--- table reserved functions
  680. virtual MTAPIRES TableReserved1(void)=0;
  681. virtual MTAPIRES TableReserved2(void)=0;
  682. virtual MTAPIRES TableReserved3(void)=0;
  683. virtual MTAPIRES TableReserved4(void)=0;
  684. virtual MTAPIRES TableReserved5(void)=0;
  685. virtual MTAPIRES TableReserved6(void)=0;
  686. //--- chart management
  687. virtual IMTReportChart* ChartCreate(void)=0;
  688. virtual IMTReportSeries* ChartCreateSeries(void)=0;
  689. virtual MTAPIRES ChartWriteHtml(const IMTReportChart *chart)=0;
  690. virtual MTAPIRES ChartReserved1(void)=0;
  691. virtual MTAPIRES ChartReserved2(void)=0;
  692. virtual MTAPIRES ChartReserved3(void)=0;
  693. virtual MTAPIRES ChartReserved4(void)=0;
  694. //--- report configuration
  695. virtual IMTConReport* ReportCreate(void)=0;
  696. virtual MTAPIRES ReportCurrent(IMTConReport *report)=0;
  697. virtual MTAPIRES ReportReserved1(void)=0;
  698. virtual MTAPIRES ReportReserved2(void)=0;
  699. virtual MTAPIRES ReportReserved3(void)=0;
  700. virtual MTAPIRES ReportReserved4(void)=0;
  701. //--- common configuration
  702. virtual IMTConCommon* CommonCreate(void)=0;
  703. virtual MTAPIRES CommonGet(IMTConCommon* common)=0;
  704. virtual MTAPIRES CommonReserved1(void)=0;
  705. virtual MTAPIRES CommonReserved2(void)=0;
  706. virtual MTAPIRES CommonReserved3(void)=0;
  707. virtual MTAPIRES CommonReserved4(void)=0;
  708. //--- network configuration
  709. virtual IMTConServer* NetServerCreate(void)=0;
  710. virtual IMTConServerRange* NetServerRangeCreate(void)=0;
  711. virtual UINT NetServerTotal(void)=0;
  712. virtual MTAPIRES NetServerNext(const UINT pos,IMTConServer *server)=0;
  713. virtual MTAPIRES NetServerGet(const UINT64 id,IMTConServer *server)=0;
  714. virtual MTAPIRES NetServerReserved1(void)=0;
  715. virtual MTAPIRES NetServerReserved2(void)=0;
  716. virtual MTAPIRES NetServerReserved3(void)=0;
  717. virtual MTAPIRES NetServerReserved4(void)=0;
  718. //--- time configuration
  719. virtual IMTConTime* TimeCreate(void)=0;
  720. virtual INT64 TimeCurrent(void)=0;
  721. virtual INT64 TimeGeneration(void)=0;
  722. virtual MTAPIRES TimeGet(IMTConTime *time)=0;
  723. virtual MTAPIRES TimeReserved1(void)=0;
  724. virtual MTAPIRES TimeReserved2(void)=0;
  725. virtual MTAPIRES TimeReserved3(void)=0;
  726. virtual MTAPIRES TimeReserved4(void)=0;
  727. //--- holiday configuration
  728. virtual IMTConHoliday* HolidayCreate()=0;
  729. virtual UINT HolidayTotal(void)=0;
  730. virtual MTAPIRES HolidayNext(const UINT pos,IMTConHoliday *holiday)=0;
  731. virtual MTAPIRES HolidayReserved1(void)=0;
  732. virtual MTAPIRES HolidayReserved2(void)=0;
  733. virtual MTAPIRES HolidayReserved3(void)=0;
  734. virtual MTAPIRES HolidayReserved4(void)=0;
  735. //--- clients group configuration
  736. virtual IMTConGroup* GroupCreate(void)=0;
  737. virtual IMTConGroupSymbol* GroupSymbolCreate(void)=0;
  738. virtual IMTConCommission* GroupCommissionCreate(void)=0;
  739. virtual IMTConCommTier* GroupTierCreate(void)=0;
  740. virtual UINT GroupTotal(void)=0;
  741. virtual MTAPIRES GroupNext(const UINT pos,IMTConGroup *group)=0;
  742. virtual MTAPIRES GroupGet(LPCWSTR name,IMTConGroup *group)=0;
  743. virtual MTAPIRES GroupGetLight(LPCWSTR name,IMTConGroup *group)=0;
  744. virtual MTAPIRES GroupReserved1(void)=0;
  745. virtual MTAPIRES GroupReserved2(void)=0;
  746. virtual MTAPIRES GroupReserved3(void)=0;
  747. virtual MTAPIRES GroupReserved4(void)=0;
  748. //--- symbols configuration
  749. virtual IMTConSymbol* SymbolCreate(void)=0;
  750. virtual IMTConSymbolSession* SymbolSessionCreate(void)=0;
  751. virtual UINT SymbolTotal(void)=0;
  752. virtual MTAPIRES SymbolNext(const UINT pos,IMTConSymbol *symbol)=0;
  753. virtual MTAPIRES SymbolGet(LPCWSTR name,IMTConSymbol *symbol)=0;
  754. virtual MTAPIRES SymbolGetLight(LPCWSTR name,IMTConSymbol *symbol)=0;
  755. virtual MTAPIRES SymbolGet(LPCWSTR name,const IMTConGroup *group,IMTConSymbol *symbol)=0;
  756. virtual MTAPIRES SymbolExist(const IMTConSymbol* symbol,const IMTConGroup* group)=0;
  757. virtual MTAPIRES SymbolReserved1(void)=0;
  758. virtual MTAPIRES SymbolReserved2(void)=0;
  759. virtual MTAPIRES SymbolReserved3(void)=0;
  760. virtual MTAPIRES SymbolReserved4(void)=0;
  761. //--- managers configuration
  762. virtual IMTConManager* ManagerCreate(void)=0;
  763. virtual IMTConManagerAccess* ManagerAccessCreate(void)=0;
  764. virtual MTAPIRES ManagerCurrent(IMTConManager *manager)=0;
  765. virtual UINT ManagerTotal(void)=0;
  766. virtual MTAPIRES ManagerNext(const UINT pos,IMTConManager *manager)=0;
  767. virtual MTAPIRES ManagerGet(const UINT64 login,IMTConManager *manager)=0;
  768. virtual MTAPIRES ManagerReserved1(void)=0;
  769. virtual MTAPIRES ManagerReserved2(void)=0;
  770. virtual MTAPIRES ManagerReserved3(void)=0;
  771. virtual MTAPIRES ManagerReserved4(void)=0;
  772. //--- clients database
  773. virtual IMTUser* UserCreate(void)=0;
  774. virtual IMTAccount* UserCreateAccount(void)=0;
  775. virtual MTAPIRES UserGet(const UINT64 login,IMTUser *user)=0;
  776. virtual MTAPIRES UserGetLight(const UINT64 login,IMTUser *user)=0;
  777. virtual MTAPIRES UserLogins(LPCWSTR group,UINT64*& logins,UINT &total)=0;
  778. virtual MTAPIRES UserAccountGet(const UINT64 login,IMTAccount *account)=0;
  779. virtual MTAPIRES UserSelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  780. virtual MTAPIRES UserReserved2(void)=0;
  781. virtual MTAPIRES UserReserved3(void)=0;
  782. virtual MTAPIRES UserReserved4(void)=0;
  783. //--- trade orders database
  784. virtual IMTOrder* OrderCreate(void)=0;
  785. virtual IMTOrderArray* OrderCreateArray(void)=0;
  786. virtual MTAPIRES OrderGet(const UINT64 ticket,IMTOrder *order)=0;
  787. virtual MTAPIRES OrderGet(const UINT64 login,IMTOrderArray *orders)=0;
  788. virtual MTAPIRES OrderSelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  789. virtual MTAPIRES OrderReserved2(void)=0;
  790. virtual MTAPIRES OrderReserved3(void)=0;
  791. virtual MTAPIRES OrderReserved4(void)=0;
  792. //--- trade history orders databases
  793. virtual MTAPIRES HistoryGet(const UINT64 ticket,IMTOrder *order)=0;
  794. virtual MTAPIRES HistoryGet(const UINT64 login,const INT64 from,const INT64 to,IMTOrderArray *orders)=0;
  795. virtual MTAPIRES HistorySelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  796. virtual MTAPIRES HistoryReserved2(void)=0;
  797. virtual MTAPIRES HistoryReserved3(void)=0;
  798. virtual MTAPIRES HistoryReserved4(void)=0;
  799. //--- trade deals database
  800. virtual IMTDeal* DealCreate(void)=0;
  801. virtual IMTDealArray* DealCreateArray(void)=0;
  802. virtual MTAPIRES DealGet(const UINT64 ticket,IMTDeal *deal)=0;
  803. virtual MTAPIRES DealGet(const UINT64 login,const INT64 from,const INT64 to,IMTDealArray *deals)=0;
  804. virtual MTAPIRES DealSelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  805. virtual MTAPIRES DealReserved2(void)=0;
  806. virtual MTAPIRES DealReserved3(void)=0;
  807. virtual MTAPIRES DealReserved4(void)=0;
  808. //--- trade positions database
  809. virtual IMTPosition* PositionCreate(void)=0;
  810. virtual IMTPositionArray* PositionCreateArray(void)=0;
  811. virtual MTAPIRES PositionGet(const UINT64 login,LPCWSTR symbol,IMTPosition *position)=0;
  812. virtual MTAPIRES PositionGet(const UINT64 login,IMTPositionArray *positions)=0;
  813. virtual MTAPIRES PositionGetByTicket(const UINT64 ticket,IMTPosition *position)=0;
  814. virtual MTAPIRES PositionSelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  815. virtual MTAPIRES PositionReserved2(void)=0;
  816. virtual MTAPIRES PositionReserved3(void)=0;
  817. //--- trade daily database
  818. virtual IMTDaily* DailyCreate(void)=0;
  819. virtual IMTDailyArray* DailyCreateArray(void)=0;
  820. virtual MTAPIRES DailyGet(const UINT64 login,const INT64 datetime,IMTDaily *daily)=0;
  821. virtual MTAPIRES DailyGetLight(const UINT64 login,const INT64 datetime,IMTDaily *daily)=0;
  822. virtual MTAPIRES DailyGet(const UINT64 login,const INT64 from,const INT64 to,IMTDailyArray *daily)=0;
  823. virtual MTAPIRES DailyGetLight(const UINT64 login,const INT64 from,const INT64 to,IMTDailyArray *daily)=0;
  824. virtual MTAPIRES DailySelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  825. virtual MTAPIRES DailyReserved2(void)=0;
  826. virtual MTAPIRES DailyReserved3(void)=0;
  827. virtual MTAPIRES DailyReserved4(void)=0;
  828. //--- trade methods
  829. virtual MTAPIRES TradeProfit(LPCWSTR group,LPCWSTR symbol,const UINT type,const UINT64 volume,const double price_open,const double price_close,double& profit,double& profit_rate)=0;
  830. virtual MTAPIRES TradeRateBuy(LPCWSTR base,LPCWSTR currency,double& rate,LPCWSTR group=NULL,LPCWSTR symbol=NULL,const double price=0)=0;
  831. virtual MTAPIRES TradeRateSell(LPCWSTR base,LPCWSTR currency,double& rate,LPCWSTR group=NULL,LPCWSTR symbol=NULL,const double price=0)=0;
  832. virtual MTAPIRES TradeProfitExt(LPCWSTR group,LPCWSTR symbol,const UINT type,const UINT64 volume,const double price_open,const double price_close,double& profit,double& profit_rate)=0;
  833. virtual MTAPIRES TradeReserved2(void)=0;
  834. virtual MTAPIRES TradeReserved3(void)=0;
  835. virtual MTAPIRES TradeReserved4(void)=0;
  836. //--- plugins configuration
  837. virtual IMTConPlugin* PluginCreate(void)=0;
  838. virtual IMTConPluginModule* PluginModuleCreate(void)=0;
  839. virtual IMTConParam* PluginParamCreate(void)=0;
  840. virtual UINT PluginTotal(void)=0;
  841. virtual MTAPIRES PluginNext(const UINT pos,IMTConPlugin *plugin)=0;
  842. virtual MTAPIRES PluginGet(const UINT64 server,LPCWSTR name,IMTConPlugin *plugin)=0;
  843. virtual UINT PluginModuleTotal(void)=0;
  844. virtual MTAPIRES PluginModuleNext(const UINT pos,IMTConPluginModule *module)=0;
  845. virtual MTAPIRES PluginModuleGet(const UINT64 server,LPCWSTR name,IMTConPluginModule *module)=0;
  846. virtual MTAPIRES PluginReserved1(void)=0;
  847. virtual MTAPIRES PluginReserved2(void)=0;
  848. virtual MTAPIRES PluginReserved3(void)=0;
  849. virtual MTAPIRES PluginReserved4(void)=0;
  850. //--- datafeeds configuration
  851. virtual IMTConFeeder* FeederCreate(void)=0;
  852. virtual IMTConFeederModule* FeederModuleCreate(void)=0;
  853. virtual IMTConParam* FeederParamCreate(void)=0;
  854. virtual IMTConFeederTranslate* FeederTranslateCreate(void)=0;
  855. virtual UINT FeederTotal(void)=0;
  856. virtual MTAPIRES FeederNext(const UINT pos,IMTConFeeder *feeder)=0;
  857. virtual MTAPIRES FeederGet(LPCWSTR name,IMTConFeeder *feeder)=0;
  858. virtual UINT FeederModuleTotal(void)=0;
  859. virtual MTAPIRES FeederModuleNext(const UINT pos,IMTConFeederModule *module)=0;
  860. virtual MTAPIRES FeederModuleGet(LPCWSTR name,IMTConFeederModule *module)=0;
  861. virtual MTAPIRES FeederReserved1(void)=0;
  862. virtual MTAPIRES FeederReserved2(void)=0;
  863. virtual MTAPIRES FeederReserved3(void)=0;
  864. virtual MTAPIRES FeederReserved4(void)=0;
  865. //--- gateways configuration
  866. virtual IMTConGateway* GatewayCreate(void)=0;
  867. virtual IMTConGatewayModule* GatewayModuleCreate(void)=0;
  868. virtual IMTConParam* GatewayParamCreate(void)=0;
  869. virtual IMTConGatewayTranslate* GatewayTranslateCreate(void)=0;
  870. virtual UINT GatewayTotal(void)=0;
  871. virtual MTAPIRES GatewayNext(const UINT pos,IMTConGateway *gateway)=0;
  872. virtual MTAPIRES GatewayGet(LPCWSTR name,IMTConGateway *gateway)=0;
  873. virtual UINT GatewayModuleTotal(void)=0;
  874. virtual MTAPIRES GatewayModuleNext(const UINT pos,IMTConGatewayModule *module)=0;
  875. virtual MTAPIRES GatewayModuleGet(LPCWSTR name,IMTConGatewayModule *module)=0;
  876. virtual MTAPIRES GatewayReserved1(void)=0;
  877. virtual MTAPIRES GatewayReserved2(void)=0;
  878. virtual MTAPIRES GatewayReserved3(void)=0;
  879. virtual MTAPIRES GatewayReserved4(void)=0;
  880. //--- ticks
  881. virtual MTAPIRES TickHistoryGet(LPCWSTR symbol,const INT64 from,const INT64 to,MTTickShort*& ticks,UINT& ticks_total)=0;
  882. virtual MTAPIRES TickHistoryGetRaw(LPCWSTR symbol,const INT64 from,const INT64 to,MTTickShort*& ticks,UINT& ticks_total)=0;
  883. virtual MTAPIRES TickLast(LPCWSTR symbol,MTTickShort& tick)=0;
  884. virtual MTAPIRES TickLast(const IMTConSymbol* symbol,MTTickShort& tick)=0;
  885. virtual MTAPIRES TickStat(LPCWSTR symbol,MTTickStat& stat)=0;
  886. virtual MTAPIRES TickReserved4(void)=0;
  887. //--- chart methods
  888. virtual MTAPIRES ChartHistoryGet(LPCWSTR symbol,const INT64 from,const INT64 to,MTChartBar*& bars,UINT& bars_total)=0;
  889. virtual MTAPIRES ChartHistoryReserved1(void)=0;
  890. virtual MTAPIRES ChartHistoryReserved2(void)=0;
  891. virtual MTAPIRES ChartHistoryReserved3(void)=0;
  892. virtual MTAPIRES ChartHistoryReserved4(void)=0;
  893. //--- dashboard width
  894. virtual UINT DashboardWidth(void)=0;
  895. virtual MTAPIRES DashboardWidth(const UINT width)=0;
  896. //--- dashboard height
  897. virtual UINT DashboardHeight(void)=0;
  898. virtual MTAPIRES DashboardHeight(const UINT height)=0;
  899. //--- dashboard title
  900. virtual LPCWSTR DashboardTitle(void)=0;
  901. virtual MTAPIRES DashboardTitle(LPCWSTR title)=0;
  902. //--- dashboard flags
  903. virtual UINT64 DashboardFlags(void)=0;
  904. virtual MTAPIRES DashboardFlags(const UINT64 flags)=0;
  905. //--- reserved dashboard properties
  906. virtual MTAPIRES DashboardReserved1(void)=0;
  907. virtual MTAPIRES DashboardReserved2(void)=0;
  908. virtual MTAPIRES DashboardReserved3(void)=0;
  909. virtual MTAPIRES DashboardReserved4(void)=0;
  910. //--- dataset management
  911. virtual IMTDataset* DatasetAppend(void)=0;
  912. virtual MTAPIRES DatasetClear(void)=0;
  913. virtual MTAPIRES DatasetDelete(const UINT pos)=0;
  914. virtual UINT DatasetTotal(void) const=0;
  915. virtual IMTDataset* DatasetNext(const UINT pos)=0;
  916. virtual IMTDatasetRequest* DatasetRequestCreate(void)=0;
  917. virtual MTAPIRES DatasetReserved2(void)=0;
  918. virtual MTAPIRES DatasetReserved3(void)=0;
  919. virtual MTAPIRES DatasetReserved4(void)=0;
  920. //--- dashboard HTML management
  921. virtual IMTReportDashboardHtml* DashboardHtmlAppend(void)=0;
  922. virtual MTAPIRES DashboardHtmlClear(void)=0;
  923. virtual MTAPIRES DashboardHtmlDelete(const UINT pos)=0;
  924. virtual UINT DashboardHtmlTotal(void) const=0;
  925. virtual IMTReportDashboardHtml* DashboardHtmlNext(const UINT pos)=0;
  926. virtual MTAPIRES DashboardHtmlReserved1(void)=0;
  927. virtual MTAPIRES DashboardHtmlReserved2(void)=0;
  928. virtual MTAPIRES DashboardHtmlReserved3(void)=0;
  929. virtual MTAPIRES DashboardHtmlReserved4(void)=0;
  930. //--- dashboard widget management
  931. virtual IMTReportDashboardWidget* DashboardWidgetAppend(void)=0;
  932. virtual MTAPIRES DashboardWidgetClear(void)=0;
  933. virtual MTAPIRES DashboardWidgetDelete(const UINT pos)=0;
  934. virtual UINT DashboardWidgetTotal(void) const=0;
  935. virtual IMTReportDashboardWidget* DashboardWidgetNext(const UINT pos)=0;
  936. virtual MTAPIRES DashboardWidgetReserved1(void)=0;
  937. virtual MTAPIRES DashboardWidgetReserved2(void)=0;
  938. virtual MTAPIRES DashboardWidgetReserved3(void)=0;
  939. virtual MTAPIRES DashboardWidgetReserved4(void)=0;
  940. //--- key set management
  941. virtual IMTReportCacheKeySet* KeySetCreate(void) const=0;
  942. virtual MTAPIRES KeySetParamLogins(IMTReportCacheKeySet *keyset) const=0;
  943. virtual MTAPIRES KeySetReserved1(void)=0;
  944. virtual MTAPIRES KeySetReserved2(void)=0;
  945. virtual MTAPIRES KeySetReserved3(void)=0;
  946. virtual MTAPIRES KeySetReserved4(void)=0;
  947. //--- report cache management
  948. virtual IMTReportCache* ReportCacheCreate(void) const=0;
  949. virtual MTAPIRES ReportCacheGet(LPCWSTR name,const UINT version,IMTReportCache *report_cache)=0;
  950. virtual MTAPIRES ReportCacheGetTemporary(LPCWSTR name,const UINT version,const UINT64 key_time_to_live,IMTReportCache *report_cache)=0;
  951. virtual MTAPIRES ReportCacheReserved1(void)=0;
  952. virtual MTAPIRES ReportCacheReserved2(void)=0;
  953. virtual MTAPIRES ReportCacheReserved3(void)=0;
  954. virtual MTAPIRES ReportCacheReserved4(void)=0;
  955. //--- clients database
  956. virtual MTAPIRES ClientSelect(const IMTDatasetRequest *request,IMTDataset *dataset)=0;
  957. virtual IMTClient *ClientCreate(void)=0;
  958. virtual IMTClientArray *ClientCreateArray(void)=0;
  959. virtual MTAPIRES ClientGet(const UINT64 client_id,IMTClient *client)=0;
  960. virtual MTAPIRES ClientGetHistory(const UINT64 client_id,const UINT64 author,const INT64 from,const INT64 to,IMTClientArray *history)=0;
  961. virtual MTAPIRES ClientIdsAll(UINT64*& ids,UINT& ids_total)=0;
  962. virtual MTAPIRES ClientIdsByGroup(const LPCWSTR groups,UINT64*& ids,UINT& ids_total)=0;
  963. virtual MTAPIRES ClientUserLogins(const UINT64 client_id,UINT64*& logins,UINT& logins_total)=0;
  964. virtual MTAPIRES ClientReserved8(void)=0;
  965. virtual MTAPIRES ClientReserved9(void)=0;
  966. //--- funds configuration
  967. virtual IMTConFund* FundCreate(void)=0;
  968. virtual IMTConFundAccount* FundAccountCreate(void)=0;
  969. virtual IMTConFundInvestor* FundInvestorCreate(void)=0;
  970. virtual UINT FundTotal(void)=0;
  971. virtual MTAPIRES FundNext(const UINT pos,IMTConFund *fund)=0;
  972. virtual MTAPIRES FundGet(LPCWSTR name,IMTConFund *fund)=0;
  973. virtual MTAPIRES FundReserved1(void)=0;
  974. virtual MTAPIRES FundReserved2(void)=0;
  975. virtual MTAPIRES FundReserved3(void)=0;
  976. virtual MTAPIRES FundReserved4(void)=0;
  977. //--- ticks
  978. virtual MTAPIRES TickGet(LPCWSTR symbol,const INT64 from,const INT64 to,MTTickShort*& ticks,UINT& ticks_total)=0;
  979. virtual MTAPIRES TickGet(const IMTConSymbol* symbol,const INT64 from,const INT64 to,MTTickShort*& ticks,UINT& ticks_total)=0;
  980. virtual MTAPIRES TickReserved5(void)=0;
  981. virtual MTAPIRES TickReserved6(void)=0;
  982. virtual MTAPIRES TickReserved7(void)=0;
  983. virtual MTAPIRES TickReserved8(void)=0;
  984. };
  985. //+------------------------------------------------------------------+
  986. //| Report context interface |
  987. //+------------------------------------------------------------------+
  988. class IMTReportContext
  989. {
  990. public:
  991. virtual void Release(void)=0;
  992. //--- report generation method
  993. virtual MTAPIRES Generate(const UINT type,IMTReportAPI *api)=0;
  994. };
  995. //+------------------------------------------------------------------+
  996. //| Report DLL entry points |
  997. //+------------------------------------------------------------------+
  998. MTAPIENTRY MTAPIRES MTReportAbout(const UINT index,MTReportInfo& info);
  999. MTAPIENTRY MTAPIRES MTReportCreate(const UINT index,const UINT apiversion,IMTReportContext **context);
  1000. //+------------------------------------------------------------------+