AccountInfoInteger
Rend la valeur de la propriété correspondante du compte.
long AccountInfoInteger(
ENUM_ACCOUNT_INFO_INTEGER property_id
);
|
Paramètres
property_id
[in] L'identificateur de la propriété. La valeur peut être une des valeurs ENUM_ACCOUNT_INFO_INTEGER.
La valeur rendue
Note
Exemple:
void OnStart()
{
//--- montrons toute l'information accessible de la fonction 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);
//--- informons de la possibilité d'exécuter les opérations commerciales
if(thisAccountTradeAllowed)
Print("Le commerce pour ce compte est permis");
else
Print("Le commerce pour ce compte est interdit!");
//--- éclaircissons - s'il est possible de faire du commerce sur ce compte par les experts
if(EATradeAllowed)
Print("Le commerce par les conseillers pour ce compte est permis");
else
Print("Le commerce par les conseillers pour ce compte est interdit!");
//--- découvrons le type de compte
switch(tradeMode)
{
case(ACCOUNT_TRADE_MODE_DEMO):
Print("C'est un compte de démonstration");
break;
case(ACCOUNT_TRADE_MODE_CONTEST):
Print("C'est un compte de compétition");
break;
default:Print("C'est un compte réel!");
}
//--- déterminons la mode de la spécification du niveau StopOut
switch(stopOutMode)
{
case(ACCOUNT_STOPOUT_MODE_PERCENT):
Print("Le niveau StopOut est spécifiée en pourcentage");
break;
default:Print("Le niveau StopOut est spécifiée en moyens monétaires");
}
}
|
Voir aussi
Information sur le compte