EA编程教程大全之账户函数
AccountBalance
AccountCredit
AccountCompany
AccountCurrency
AccountEquity
AccountFreeMargin
AccountFreeMarginCheck
AccountFreeMarginMode
AccountLeverage
AccountMargin
AccountName
AccountNumber
AccountProfit
AccountServer
AccountStopoutLevel
AccountStopoutMode
double AccountBalance( )
返回账户余额(账户中相当数量的价格值金钱).
示例:
Print("账户余额= ",AccountBalance());
double AccountCredit( )
返回账户信用点数.
示例:
Print("账户点数 ", AccountCredit());
string AccountCompany( )
返回账户公司名。
示例:
Print("账户公司名", AccountCompany());
string AccountCurrency( )
返回账户所用的通货名称。
示例:
Print("账户货币对", AccountCurrency());
double AccountEquity( )
对于当前账户返回资产净值。资产净值取决于交易服务器的设置。
示例:
Print("账户净值 = ",AccountEquity());
double AccountFreeMargin( )
返回当前帐户的免费保证金价格值。
示例:
Print("账户免费保证金 = ",AccountFreeMargin());
double AccountFreeMarginCheck( string symbol, int cmd, double volume)
当前账户的当前价格上在指定开仓的仓位返回自由保证金。如果免费保证金不够,将会生成错误134(ERR_NOT_ENOUGH_MONEY) 。
参量:
symbol - 交易业务货币对。
cmd - 交易类型。可能是OP_BUY或者 OP_SELL。
volume - 份额数。
示例:
if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)<=0 || GetLastError()==134) return;
double AccountFreeMarginMode( )
在当前开仓位置的账户上计算免费保证金的模式。计算方式可能采取以下价格值:
0 - 浮动profit/loss 不使用
1 - 两个浮动赢利和损失在开仓位置上使用计算自由保证金;
2 - 只有赢利值被使用计算,不考虑当前开仓的亏损;
3 - 只有亏损值被使用计算, 不考虑当前开仓的亏损。
示例:
if(AccountFreeMarginMode()==0)
Print("浮点盈利/亏损不使用。");
int AccountLeverage( )
返回当前账户杠杆比率。
示例:
Print("账户#",AccountNumber(), " 杠杆比率", AccountLeverage());
double AccountMargin( )
返回当前帐户的保证金。
示例:
Print("账户保证金 ", AccountMargin());
string AccountName( )
返回当前帐户名称。
示例:
Print("账户名称", AccountName());
int AccountNumber( )
返回当前帐户的数字。
示例:
Print("账户数字", AccountNumber());
double AccountProfit( )
返回账户利润。跟单托管
示例:
Print("账户利润", AccountProfit());
string AccountServer( )
返回连接服务器的名称。
示例:
Print("服务器名称", AccountServer());
int AccountStopoutLevel( )
返回停止水平值。
示例:
Print("停止水平 = ", AccountStopoutLevel());
int AccountStopoutMode( )
对于停止水平返回的的运算方式。运算方式值如下:
0 - 计算保证金和净值之间的百分比;
1 - 比较自由保证金水平和绝对值。
示例:
int level=AccountStopoutLevel();
if(AccountStopoutMode()==0)
Print("停止水平= ",水平, "%");
else
Print("停止水平= ", 水平, " ", AccountCurrency());
热点资讯
- 一张图:波罗的海干散货指数飙升创近两年新2026-06-26
- 外汇跟单平台:利空与利多的辩证关系解析2026-06-26
- outrade交易社区:外汇投资中耐心与2026-06-26
- 外汇跟单平台对不同操作者的忠告2026-06-25
- 霍尔木兹海峡谈判僵局 原油价格持续上涨2026-06-25
- 外汇经纪商选择误区:哪些平台需规避2026-06-25
- 美联储降息临近 美债承压 黄金受关注2026-06-24
- 美国新关税冲击贸易伙伴全球经济承压2026-06-24
- DMI动向指数与跟单社区技术分析应用指南2026-06-24
- 外汇跟单平台一致性好习惯的重要性(上)2026-06-23
- 趋势交易系统构建 从理念到实战完整指南2026-06-23
- 看涨行情升温,白银剑指50美元2026-06-23