-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathPlatform.extern.h
172 lines (114 loc) · 6.41 KB
/
Platform.extern.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//+------------------------------------------------------------------+
//| EA31337 framework |
//| Copyright 2016-2021, EA31337 Ltd |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+
/*
* This file is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
// Includes.
#include "Account/Account.enum.h"
#include "Data.define.h"
#include "Deal.enum.h"
#include "Object.extern.h"
#include "Order.define.h"
#include "Terminal.enum.h"
// Forward declarations.
struct MqlTradeRequest;
struct MqlTradeResult;
struct MqlTradeCheckResult;
template <typename... Args>
double iCustom(string symbol, int timeframe, string name, Args... args) {
Alert(__FUNCSIG__, " it not implemented!");
return 0;
}
/**
* Returns number of candles for a given symbol and time-frame.
*/
extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf);
/**
* Returns the number of calculated data for the specified indicator.
*/
extern int BarsCalculated(int indicator_handle);
/**
* Gets data of a specified buffer of a certain indicator in the necessary quantity.
*/
extern int CopyBuffer(int indicator_handle, int buffer_num, int start_pos, int count, ARRAY_REF(double, buffer));
extern int CopyOpen(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(double, close_array));
extern int CopyHigh(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(double, close_array));
extern int CopyLow(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(double, close_array));
extern int CopyClose(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(double, close_array));
extern unsigned int64 PositionGetTicket(int _index);
extern int64 PositionGetInteger(ENUM_POSITION_PROPERTY_INTEGER property_id);
extern double PositionGetDouble(ENUM_POSITION_PROPERTY_DOUBLE property_id);
extern string PositionGetString(ENUM_POSITION_PROPERTY_STRING property_id);
extern int HistoryDealsTotal();
extern unsigned int64 HistoryDealGetTicket(int index);
extern int64 HistoryDealGetInteger(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_INTEGER property_id);
extern double HistoryDealGetDouble(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_DOUBLE property_id);
extern string HistoryDealGetString(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_STRING property_id);
extern bool OrderSelect(int index);
extern bool PositionSelectByTicket(int index);
extern bool HistoryOrderSelect(int index);
extern bool OrderSend(const MqlTradeRequest& request, MqlTradeResult& result);
extern bool OrderCheck(const MqlTradeRequest& request, MqlTradeCheckResult& result);
extern unsigned int64 OrderGetTicket(int index);
extern unsigned int64 HistoryOrderGetTicket(int index);
extern bool HistorySelectByPosition(int64 position_id);
extern bool HistoryDealSelect(unsigned int64 ticket);
extern int64 OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id);
extern int64 HistoryOrderGetInteger(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_INTEGER property_id);
extern double OrderGetDouble(ENUM_ORDER_PROPERTY_DOUBLE property_id);
extern double HistoryOrderGetDouble(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_DOUBLE property_id);
string OrderGetString(ENUM_ORDER_PROPERTY_STRING property_id);
string HistoryOrderGetString(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_STRING property_id);
extern int PositionsTotal();
extern bool HistorySelect(datetime from_date, datetime to_date);
extern int HistoryOrdersTotal();
extern int OrdersTotal();
extern int CopyTickVolume(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(int64, arr));
extern int CopyRealVolume(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count,
ARRAY_REF(int64, arr));
extern int ChartID();
extern bool OrderCalcMargin(ENUM_ORDER_TYPE _action, string _symbol, double _volume, double _price, double& _margin);
extern double AccountInfoDouble(ENUM_ACCOUNT_INFO_DOUBLE property_id);
extern int64 AccountInfoInteger(ENUM_ACCOUNT_INFO_INTEGER property_id);
extern string AccountInfoInteger(ENUM_ACCOUNT_INFO_STRING property_id);
extern string Symbol();
extern string ObjectName(int64 _chart_id, int _pos, int _sub_window = -1, int _type = -1);
extern int ObjectsTotal(int64 chart_id, int type = EMPTY, int window = -1);
extern bool PlotIndexSetString(int plot_index, int prop_id, string prop_value);
extern bool PlotIndexSetInteger(int plot_index, int prop_id, int prop_value);
extern bool ObjectSetInteger(int64 chart_id, string name, ENUM_OBJECT_PROPERTY_INTEGER prop_id, int64 prop_value);
extern bool ObjectSetInteger(int64 chart_id, string name, ENUM_OBJECT_PROPERTY_INTEGER prop_id, int prop_modifier,
int64 prop_value);
extern bool ObjectSetDouble(int64 chart_id, string name, ENUM_OBJECT_PROPERTY_DOUBLE prop_id, double prop_value);
extern bool ObjectSetDouble(int64 chart_id, string name, ENUM_OBJECT_PROPERTY_DOUBLE prop_id, int prop_modifier,
double prop_value);
extern bool ObjectCreate(int64 _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1);
extern bool ObjectCreate(int64 _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1,
datetime _t2, double _p2);
extern bool ObjectMove(int64 chart_id, string name, int point_index, datetime time, double price);
extern bool ObjectDelete(int64 chart_id, string name);
extern int ObjectFind(int64 chart_id, string name);
#endif