AccountInfoInteger

対応する口座のプロパティの値を返します。

long  AccountInfoInteger(
  ENUM_ACCOUNT_INFO_INTEGER  property_id      // プロパティ識別子
  );

パラメータ

property_id

[in]  プロパティの識別子。可能な値は ENUM_ACCOUNT_INFO_INTEGER の値のいずれかになります。

戻り値

long型の値

注意事項

このプロパティは boolint または long 型に限られています。

例:

void OnStart()
 {
//--- AccountInfoInteger() 関数で使用可能な情報を全て表示する
  printf("ACCOUNT_LOGIN =  %d",AccountInfoInteger(ACCOUNT_LOGIN));
  printf("ACCOUNT_LEVERAGE =  %d",AccountInfoInteger(ACCOUNT_LEVERAGE));
  bool thisAccountTradeAllowed=AccountInfoInteger(ACCOUNT_TRADE_ALLOWED);
  bool EATradeAllowed=AccountInfoInteger(ACCOUNT_TRADE_EXPERT);
  ENUM_ACCOUNT_TRADE_MODE tradeMode=(ENUM_ACCOUNT_TRADE_MODE)AccountInfoInteger(ACCOUNT_TRADE_MODE);
  ENUM_ACCOUNT_STOPOUT_MODE stopOutMode=(ENUM_ACCOUNT_STOPOUT_MODE)AccountInfoInteger(ACCOUNT_MARGIN_SO_MODE);
 
//--- 取引操作を実行する可能性について通知する
  if(thisAccountTradeAllowed)
    Print("Trade for this account is permitted");
  else
    Print("Trade for this account is prohibited!");
 
//--- この口座でエキスパートアドバイザーを使用しての取引が出来るかどうかをみる
  if(EATradeAllowed)
    Print("Trade by Expert Advisors is permitted for this account");
  else
    Print("Trade by Expert Advisors is prohibited for this account!");
 
//--- 口座の種類を検出する
  switch(tradeMode)
    {
    case(ACCOUNT_TRADE_MODE_DEMO):
        Print("This is a demo account");
        break;
    case(ACCOUNT_TRADE_MODE_CONTEST):
        Print("This is a competition account");
        break;
    default:Print("This is a real account!");
    }
 
//--- StopOut レベル設定モードを検出する
  switch(stopOutMode)
    {
    case(ACCOUNT_STOPOUT_MODE_PERCENT):
        Print("The StopOut level is specified percentage");
        break;
    default:Print("The StopOut level is specified in monetary terms");
    }
 }

参照

口座情報