check account type - page 2

 
WHRoeder:
Again, why do you care? https://www.mql5.com/en/forum/138853


LOL ... you really nailed 'em hard there ...
 
  1. deysmacro: LOL ... you really nailed 'em hard there ...
    Excuse me?
  2. metbright: I don't understand your recommend I can't speak English very well, I will try. Thank you.

    You don't need to know how big a lot is.

    AccountBalance * percent = Risk = ( OrderOpenPrice - OrderStopLoss )*DIR * DeltaPerLot * lotsize. Solve for lotsize and normalize properly. You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support. Note that OrderOpenPrice - OrderStopLoss includes the spread.

 
Thank you, but I just want to create indicator show lot size to trade not an EA.
 
metbright:

Hi

I have a question, how to check account type(standard, mini, micro) ?

Hello there, see if the below helps out.

double tradingUnits( string symbol )
{
    return SymbolInfoDouble(symbol,  SYMBOL_TRADE_CONTRACT_SIZE);
}

string accountType( double tradingUnits )
{
      string type = "Standard Account";
      switch ( tradingUnits )
      {
           case 1000.0: type=" Micro Account ";  break;
           case 10000.0: type=" Mini Account "; break;
           default: type=" Standard Account ";break;
      }
      return type;
}

Cheers...
 
Deedy Oly:
O!..., sorry..., SymbolInfoDouble to be used, code corrected thanks.
 
Malcolm Okechukwu:
Hello there, see if the below helps out.

double tradingUnits( string symbol )
{
    return SymbolInfoDouble(symbol,  SYMBOL_TRADE_CONTRACT_SIZE);
}

string accountType( double tradingUnits )
{
      string type = "Standard Account";
      switch ( tradingUnits )
      {
           case 1000.0: type=" Micro Account ";  break;
           case 10000.0: type=" Mini Account "; break;
           default: type=" Standard Account ";break;
      }
      return type;
}

Cheers...

Hi, there are some errors in your code
1. switch ( tradingUnits )

should change to  switch ( tradingUnits(Symbol))


2. switch case cannot accept double

3. this method is not practical for some Currency pairs like gold , silver and ...


 
Malcolm Okechukwu: Hello there, see if the below helps out.

Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
          Messages Editor

Reason: