賬戶信息相關函數
- AccountBalance() – 獲取賬戶余額
- AccountCredit() – 獲取賬戶信用額度
- AccountCompany() – 獲取賬戶所在公司名稱
- AccountCurrency() – 獲取賬戶結算貨幣名稱
- AccountEquity() – 獲取賬戶凈值
- AccountFreeMargin() – 獲取賬戶可用保證金
- AccountFreeMarginCheck() – 檢查賬戶可用保證金
- AccountFreeMarginMode() – 可用保證金計算方式
- AccountLeverage() – 獲取賬戶杠桿比例
- AccountMargin() – 獲取賬戶已用保證金
- AccountName() – 獲取賬戶名
- AccountNumber() – 獲取賬戶號碼
- AccountProfit() – 獲取賬戶盈利金額
- AccountServer() – 獲取賬戶連接的服務器名稱
- AccountStopoutLevel() – 獲取賬戶的止損水平設置
- AccountStopoutMode() – 獲取賬戶止損計算方式
?
AccountBalance() – 獲取賬戶余額
double AccountBalance()
返回賬戶余額(賬戶中錢數) .
示例:
Print("賬戶余額 = ",AccountBalance());
AccountCredit() – 獲取賬戶信用額度
double AccountCredit()
返回賬戶信用額度.
示例:
Print("賬戶信用額度 = ", AccountCredit());
AccountCompany() – 獲取賬戶所在公司名稱
string AccountCompany()
返回賬戶所在公司名稱.
示例:
Print("賬戶所在公司名:", AccountCompany());
AccountCurrency() – 獲取賬戶結算貨幣名稱
string AccountCurrency()
返回賬戶結算貨幣名稱.
示例:
Print("賬戶結算貨幣:", AccountCurrency());
AccountEquity() – 獲取賬戶凈值
double AccountEquity()
返回賬戶凈值.
示例:
Print("賬戶凈值 = ", AccountEquity());
AccountFreeMargin() – 獲取賬戶可用保證金
double AccountFreeMargin()
返回賬戶可用保證金.
示例:
Print("賬戶可用保證金 = ", AccountFreeMargin());
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)AccountFreeMarginMode() – 可用保證金計算方式
double AccountFreeMarginMode()開倉時可用保證金計算方式。計算方式可能采取以下值:
- 0一浮動盈利/虧損不參與計算
- 1一浮動盈利和虧損在開倉部頭寸上參與保證金余額計算;
- 2一只有贏利參與計算,不考慮當前開倉頭寸的虧損;
- 3一只有虧損額參與計算,不考慮當前開倉頭寸的虧損。
示例:
if(AccountFreeMarginMode()==0) Print("浮動盈利/虧損不使用。");
AccountLeverage() – 獲取賬戶杠桿比例
int AccountLeverage()
返回賬戶杠桿比例.
示例:
Print("賬戶杠桿比例:", AccountLeverage());
AccountMargin() – 獲取賬戶已用保證金
double AccountMargin()
返回賬戶已用保證金金額.
示例:
Print("賬戶已用保證金:", AccountMargin());
AccountName() – 獲取賬戶名
string AccountName()
返回賬戶的賬戶名.
示例:
Print("賬戶名:", AccountName());
AccountNumber() – 獲取賬戶號碼
int AccountNumber()
返回賬戶的賬戶號碼.
示例:
Print("賬戶號碼:", AccountNumber());
AccountProfit() – 獲取賬戶盈利金額
double AccountProfit()
返回賬戶的盈利金額.
示例:
Print("賬戶盈利:", AccountProfit());
AccountServer() – 獲取賬戶連接的服務器名稱
string AccountServer()
返回賬戶連接的服務器名稱.
示例:
Print("服務器名稱:", AccountServer());
AccountStopoutLevel() – 獲取賬戶的止損水平設置
int AccountStopoutLevel()
返回賬戶止損水平設置.
示例:
Print("賬戶止損水平設置 = ", AccountStopoutLevel());
AccountStopoutMode() – 獲取賬戶止損計算方式
int AccountStopoutMode()
返回賬戶止損水平的計算方式,計算方式可以采用下列的值:
- 0一計算保證金和凈值之間的百分比;
- 1一比較剩余保證金標準和絕對值。
示例:

int level=AccountStopoutLevel();if(AccountStopoutMode()==0) Print("止損水平= ",level, "%");else Print("止損水平= ", level, " ", AccountCurrency());
來源:外匯邦
評論前必須登錄!
立即登錄 注冊