【MQL4勉強プログラミング】string型の口座情報を取得する方法

AccountInfoString()関数は、string型の口座情報を取得するために使用します。

AccountInfoString()関数は、以下のように定義されています。

string AccountInfoString(
int property_id
);

引数の意味は、以下のとおりです。

  • int property_id
    以下の表に従って、取得したい口座情報を指定します。

    指定する値
    取得する情報
    ACCOUNT_NAME 取引口座の名義
    ACCOUNT_SERVER 取引サーバーの名前
    ACCOUNT_CURRENCY 取引口座に証拠金として入金している通貨の名前
    ACCOUNT_COMPANY 使用している取引口座を開設している業者名

具体例

AccountInfoString()関数で取得できる口座情報を「ターミナルウィンドウ」に表示させたい場合は、以下のように記述します。


Print(“The name of the broker is “,
      AccountInfoStirng(ACCOUNT_COMPANY));
Print(“Deposite currency is “,
      AccountInfoString(ACCOUNT_CURRENCY));
Print(“Client name is “,
      AccountInfoString(ACCOUNT_NAME));
Print(“The name of the trade server is “,
      AccountInfoString(ACCOUNT_SERVER));
  • Print()関数の詳細については「こちら」を参照してください。