-
Notifications
You must be signed in to change notification settings - Fork 7
/
Export.mqh
57 lines (51 loc) · 5.13 KB
/
Export.mqh
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
//+------------------------------------------------------------------+
//| Export.mqh |
//| Copyright 2021, Feng Hui Software Corp. |
//| https://www.fenghui.hk |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, Feng Hui Software Corp."
#property link "https://www.fenghui.hk"
#property version "1.00"
#property strict
#include "Config.mqh"
class CExport
{
private:
protected:
public:
string AccountInfo();
};
//+------------------------------------------------------------------+
//| 交易账户信息 |
//+------------------------------------------------------------------+
string CExport::AccountInfo()
{
// 交易账户信息
string content = "{"
+ "\"ea_running_time\":\"" + day_time.FormatDatetime(TimeLocal()) + "\","
+ "\"ea_name\":\"" + mql.ProgramName() + "\","
+ "\"name\":\"" + account.Name() + "\","
+ "\"account_number\":\"" + IntegerToString(account.Login()) + "\","
+ "\"server\":\"" + account.Server() + "\","
+ "\"server_time\":\"" + day_time.FormatDatetime(day_time.NowTime()) + "\","
+ "\"connect\":\"" + IntegerToString(terminal.Connected()) + "\","
+ "\"company\":\"" + account.Company() + "\","
+ "\"balance\":\"" + DoubleToString(account.Balance(),2) + "\","
+ "\"currency\":\"" + account.Currency() + "\","
+ "\"credit\":\"" + DoubleToString(account.Credit(),2) + "\","
+ "\"equity\":\"" + DoubleToString(account.Equity(),2) + "\","
+ "\"margin_free\":\"" + DoubleToString(account.MarginFree(),2) + "\","
+ "\"leverage\":\"" + DoubleToString(account.Leverage(),2) + "\","
+ "\"margin\":\"" + DoubleToString(account.Margin(),2) + "\","
+ "\"profit\":\"" + DoubleToString(account.Profit(),2) + "\","
+ "\"stop_out_level\":\"" + DoubleToString(account.StopOutLevel(),0) + "\","
+ "\"margin_level\":\"" + DoubleToString(account.MarginLevel(),2) + "\","
+ "\"limit_orders\":\"" + IntegerToString(account.LimitOrders()) + "\","
+ "\"trade_allowed\":\"" + IntegerToString(account.TradeAllowed()) + "\","
+ "\"ea_trade_allowed\":\"" + IntegerToString(account.TradeExpert()) + "\","
+ "\"account_type\":\"" + IntegerToString(account.TradeMode()) + "\","
+ "\"margin_so_call\":\"" + DoubleToString(account.MarginSoCall(),0) + "\","
+ "\"margin_so_so\":\"" + DoubleToString(account.MarginSoSo(),0) + "\""
+ "}";
return content;
}