文章目录 [显示]
激活账户信息的一组函数。
7.1 AccountBalance(账户余额)
double AccountBalance()
返回账户余额(账户中相当数量的价格值金钱) .
示例:
Print(“账户余额= “,AccountBalance());
7.2 AccountCredit(账户信用点数)
double AccountCredit()
返回账户信用点数.
示例:
Print(“账户点数 “, AccountCredit());
7.3 AccountCompany(账户公司名)
String AccountCompany()
返回账户公司名。
示例:
Print(“账户公司名”, AccountCompany());
7.4 AccountCurrency(账户使用的货币名称)
String AccountCurrency()
返回账户所用的通货名称。
示例:
Print(“账户货币名称”, AccountCurrency());
7.5 AccountEquity(账户净值)
Double AccountEquity()
对于当前账户返回资产净值。资产净值取决于交易服务器的设置。
示例:
Print(“账户净值 = “,AccountEquity());
7.6 AccountFreeMargin(账户可用保证金)
double AccountFreeMargin()
返回当前帐户的免费保证金价格值。
示例:
Print(“账户免费保证金 = “,AccountFreeMargin());
7.7 AccountFreeMarginCheck(可用保证金检查)
double AccountFreeMarginCheck()
当前账户的当前价格上在指定开仓的仓位返回可用保证金。如果可用保证金不够,将会生成错误134(ERR_NOT_ENOUGH_MONEY) 。
参量:
symbol – 交易业务货币对。
cmd – 交易类型。可能是OP_BUY或者 OP_SELL。
volume – 份额数。
示例:
if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)<=0 || GetLastError()==134) return;
7.8 AccountFreeMarginMode(可用保证金计算模式)
double AccountFreeMarginMode()
在当前开仓位置的账户上计算可用保证金的模式。计算方式可能采取以下价格值:
0 – 浮动profit/loss 不使用
1 – 两个浮动赢利和损失在开仓位置上使用计算自由保证金;
2 – 只有赢利值被使用计算,不考虑当前开仓的亏损;
3 – 只有亏损值被使用计算, 不考虑当前开仓的亏损。
示例:
if(AccountFreeMarginMode()==0)
Print(“浮点盈利/亏损不使用。”);
7.9 AccountLeverage(账户杠杆比率)
int AccountLeverage()
返回当前账户杠杆比率。
示例:
Print(“账户#”,AccountNumber(), ” 杠杆比率”, AccountLeverage());
7.10 AccountMargin(账户保证金)
double AccountMargin()
返回当前帐户的保证金。
示例:
Print(“账户保证金 “, AccountMargin());
7.11AccountName(账户名称)
String AccountName()
返回当前帐户名称。
示例:
Print(“账户名称”, AccountName());
7.12 AccountNumber(账户的账号)
int AccountNumber()
返回当前帐户的账号。
示例:
Print(“账户数字”, AccountNumber());
7.13 AccountProfit(账户利润)
double AccountProfit()
返回账户利润。
示例:
Print(“账户利润”, AccountProfit());
7.14 AccountServer(服务器名字)
String AccountServer()
返回连接服务器的名称。
示例:
Print(“服务器名称”, AccountServer());
7.15 AccountStopoutLevel(账户强制平仓位置)
int AccountStopoutLevel()
返回停止水平值。
示例:
Print(“停止水平 = “, AccountStopoutLevel());
7.16 AccountStopoutMode(账户强制平仓计算模式)
int AccountStopoutMode()
对于停止水平返回的的运算方式。运算方式值如下:
0 – 计算保证金和净值之间的百分比;
1 – 比较自由保证金水平和绝对值。
示例:
int level=AccountStopoutLevel();
if(AccountStopoutMode()==0)
Print(“停止水平= “,水平, “%”);
else
Print(“停止水平= “, 水平, ” “, AccountCurrency());