To read if EA is running on Mini or standard account

 

Hi

Can someone help . I am using some scripts to execute trades. Is there a way for the script to see if it is a mini or standard account. My kids trade on mini accounts and I on Standard but always have to keep 2 of everything handy.

Thanks

 
int AccountNumber( )
Returns the number of the current account.
Sample:
Print("account number ", AccountNumber());
if(AccountNumber()==MyAcc#){...do my stuff...}
 
ubzen:
int AccountNumber( )
Returns the number of the current account.
Sample:
if(AccountNumber()==MyAcc#){...do my stuff...}


Hi

Thanks that will for sure work, Will do it now. But I give some of this stuff to friends also and I do not have there account numbers, so I am still looking for a way to read the account type.

Thanks

 
I cannot locate any command which returns account type. I don't think one exist but I've been wrong b4. My recommendation is to program the script to ask the user if it's a mini account or not. In my limited experience stuff like "mini-account" and "leverage" are defined on the broker's website.
 
ubzen:
I cannot locate any command which returns account type. I don't think one exist but I've been wrong b4. My recommendation is to program the script to ask the user if it's a mini account or not. In my limited experience stuff like "mini-account" and "leverage" are defined on the broker's website.


Hi

Thanks yes cant find something. But in a script is does not allow external input on execution, or is there a way to get external input on execution. In EA's it is easy, but the script just ignore the "extern" and execute it immediately

Thanks

 

There's gotta be a better way. I'll look into it. In the mean time I suggest something like the following. I know scripts like the default ordersend script which comes with the platform had a pop-up box which ask "are you sure u wanna place that order". You may try looking into that as possible solution.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extern string Setting0="Will Prompt Entry";
extern string Setting1="Enter 1 for Mini";
extern string Setting2="Enter 2 for Standard";
extern string Setting3="Enter 3 for Nano";
extern int Whats_Your_Account_Type?=0;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int start(){
//~~~~~~~~~~
    if(Whats_Your_Account_Type?>0){
        Print(Whats_Your_Account_Type?);
    }
    if(Whats_Your_Account_Type?==0){
        Alert(  "Please Enter Account Type","\n",
                "Right-Click the name of the Script","\n",
                "Left-Click Modify","\n",
                "Enter the Appropriate # to the ?","\n"
        );
    }
//~~~~~~~~~~
return(0);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
ubzen:

There's gotta be a better way. I'll look into it. In the mean time I suggest something like the following. I know scripts like the default ordersend script which comes with the platform had a pop-up box which ask "are you sure u wanna place that order". You may try looking into that as possible solution.


Thank you so much. I tried the following and it is working so far.

if(MarketInfo(Symbol(),MODE_MARGININIT)==10000) account_type="mini";

if(MarketInfo(Symbol(),MODE_MARGININIT)==100000) account_type="standard";

Scary to use stuff you do not really know on real money .....

Just your comments - Am I on the correct road.

Thanks!!!!

 
Yeah, thats a good road. That was the first thing I was gonna suggest. But it's not as reliable. Because there's no command to return mini vs standard account. The solution would pretty much come down to linking something thats unique to mini account like margin, leverage or account numbers etc. Otherwise, you may need to prompt the user to verify the account type.
 

According to the doc you should be able to see on what account you are trough the use of

MODE_MARGININIT

This should return the margin required to buy one lot. Trough this way you can find out if a lot values 100k or 10k.

Some other brokers, which for me is also a mini account, offers a minimum trading volume of 0.01lot. This you can find out trough MODE_MINLOT

 
ubzen:
Yeah, thats a good road. That was the first thing I was gonna suggest. But it's not as reliable. Because there's no command to return mini vs standard account. The solution would pretty much come down to linking something thats unique to mini account like margin, leverage or account numbers etc. Otherwise, you may need to prompt the user to verify the account type.

The reason there is no built-in function for declaring the account "mini" or standard" is because the convention itself is not all that robustly defined/upheld. It is kinda like the "pip" debacle.

My solution to this was to define all my money management algorithms to be invariant to the standard/mini/micro situation. In making them broker agnostic, it doesn't matter what broker's chart (or their account nomenclature) I drop my EA onto, the EA will correctly compute the desired lotsize programmatically.

 
johanmalan:Is there a way for the script to see if it is a mini or standard account. My kids trade on mini accounts and I on Standard
How cute!
Reason: