Download MetaTrader 5

Function call that returns account type (standard, mini, micro)

To add comments, please log in or register
wulidancing
273
wulidancing  

I know this is probably easy but I can't find it. 

Is there any way for an EA to determine the current account type (Standard, Mini, Micro) automatically?

An EA would seem to need to know that 1 lot in a standard account is very different from 1 lot in a mini account.

Something like:

CAccountInfo cMyAccount;

CString cMyString; 

cMyString.Assign(cMyAccount.Type());

where 'Type()' returns a string like 'standard', 'mini' or 'micro' 

 

makes sense to me but I don't see anything like that.  Any help?

 

Thanks

 

-d 

wulidancing
273
wulidancing  
wulidancing:

I know this is probably easy but I can't find it. 

Is there any way for an EA to determine the current account type (Standard, Mini, Micro) automatically?

An EA would seem to need to know that 1 lot in a standard account is very different from 1 lot in a mini account.

Something like:

CAccountInfo cMyAccount;

CString cMyString; 

cMyString.Assign(cMyAccount.Type());

where 'Type()' returns a string like 'standard', 'mini' or 'micro' 

 

makes sense to me but I don't see anything like that.  Any help?

 

Thanks

 

-d 

Ok, never mind, I'll answer my own question for anyone else.  The information is in the class CSymbolInfo

CSymbolInfo cMySymbol;

double dContractSize = cMySymbol.ContractSize();

 

Sorry to be a dummy. 

To add comments, please log in or register