5.4 Account information账户信息
访问活动账户信息的一组函数。
5.4.1 AccountBalance( )账户余额
double AccountBalance()
返回账户余额(多数是用美元计量)。
【示例】
Print( "账户余额”,AccountBalance( ) ) ;
5.4.2 AccountCredit()账户信用点数
double AccountCredit()
返回账户信用点数。
【示例】
Print ( "账户点数' ,AccountCredit( ) ) ;
5.4.3 AccountCompany( )账户公司名
string AccountCompany()
返回账户公司名。
【示例】
Print( "账户公司名”,AccountCompany( ) ) ;
5.4.4 AccountCurrency()基本货币
string AccountCurrency()
返回账户所用的通货名称。
【示例】
Print(”账户基本货币”,AccountCurrency( ) ) ;
5.4.5 AccountEquity()账户资产净值
double AccountEquity()
对于当前账户返回资产净值。资产净值取决于交易服务器的设置。
【示例】
Print( "账户净值=' ,AccountEquity() ;
5.4.6 AccountFreeMargin()账户免费保证金
double AccountFreeMargin()
返回当前账户的免费保证金价格值。
【示例】
Print(”账户免费保证金=' ,AccountFreeMargin( ) ) ;
5.4.7 AccountFreeMarginCheck()账户当前价格自由保证金
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;
5.4.8 AccountFreeMarginMode()账户免费保证金模式
double AccountFreeMarginMode()
在当前开仓位置的账户上计算免费保证金的模式。计算方式可能采取以下价格值:
0—浮动profit/loss不使用。
1—两个浮动赢利和损失在开仓位置上使用计算自由保证金。
2—只有赢利值被使用计算,不考虑当前开仓的亏损。
3—只有亏损值被使用计算,不考虑当前开仓的亏损。
【示例】
if( AccountFreeMarginMode()==0)
Print(”浮点赢利/亏损不使用”);
5.4.9 AccountLeverage()账户杠杆
int AccountLeverage()
返回当前账户杠杆比率。
【示例】
Print( "账户#', , AccountNumber( ) ,”杠杆比率”,AccountLeverage( ) ) ;
5.4.10 AccountMargin()账户保证金
double AccountMargin()
返回当前账户的保证金。
【示例】
Print( "账户保证金”,AccountMargin() ;
5.4.11 AccountName()账户名称
string AccountName)
返回当前账户名称。
【示例】
Print( "账户名称”,AccountlVame( ) ;
5.4.12 AccountNumber()账户数字
int AccountNumber()
返回当前账户的数字。
【示例】
Print( "账户数字”,AccountNumber( ) ;
5.4.13 AccountProfit()账户利润
double AccountProfit)
返回账户利润。
【示例】
Print( "账户利润”,AccountProfit( ) ;
5.4.14 AccountServer()账户连接服务器
string AccountServer()
返回连接服务器的名称。
【示例】
Print(”服务器名称’' ,AccountServer( ) ) ;
5.4.15 AccountStopoutLevel()账户停止水平值
int AccountStopoutLevel()
返回停止水平值。
[示例】
Print(”停止水平=' ,AccountStopoutLevel( ) ) ;
5.4.16 AccountStopoutMode()账户停止返回模式
int AccountStopoutMode()
对于停止水平返回的运算方式。运算方式值如下:
0—计算保证金和净值之间的百分比;
1—比较自由保证金水平和绝对值。
【示例】
int level=AccountStopoutLevel();
f( AccountStopoutMode()=
Print”停止水平==0)水平”%”
else
Print(”停止水平=”,水平,”' ,AccountCurrency( )) ;