Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1909

 
EVGENII SHELIPOV #:

Yes you are an ostyak??????

Seems to me that's the only possible response to such a question from a developer on published code.

 
JRandomTrader #:

To me, that seems to be the only possible response to such a question from a developer on published code.

And the resolution has nothing to do with YOURSELF

 
EVGENII SHELIPOV #:

And the permission here has nothing to do with YOU.

Not mine, but obviously nothing else could have had anything to do with it. It's not a simple request to correct some elementary code. Such a request could come from a beginner seeing the code for the first time, not from a developer with published products.

 
EVGENII SHELIPOV #:

And your permission has nothing to do with it.

Whatever the question, that's the answer. You asked "Can I...", you were told you could, we don't mind.

 
JRandomTrader #:

Not mine, but obviously nothing else could have been meant. It's not a simple request to fix elementary code. Such a request could come from a newbie seeing the code for the first time, not from a developer with published products.

Listen weirdo, I came to this forum on this thread to fix the code. I don't care if I'm a developer or not. If I'm asking, it means I need it.

 
EVGENII SHELIPOV #:

Good afternoon!!!!

Here is the Profit calculation function for a grid of orders

Can you please tell us if you can calculate separately

Calculation of orders with profit

Calculate orders with a loss

Thank you

//+----------------------------------------------------------------------------+
//| Калькуляция сетки ордеров                                                  |
//+----------------------------------------------------------------------------+
double CalculiteProfit()
  {
   double oProfit = 0;
   for(int i = OrdersTotal()-1; i>=0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)
           {
            if(OrderType() == OP_BUY || OrderType() == OP_SELL)
              {
               if(OrderProfit()>0)
                 {
                  oProfit += OrderProfit();
                 }
              }
           }
        }
     }
   return(oProfit);
  }

Same for loss

 
Tretyakov Rostyslav #:

Similarly for the loss

Thank you

 
Guys, a word of advice please! I have an account in MT5. How do I know if it's real? ( The problem is that my father opened it himself through unknown persons. And now I can't withdraw from it... On the balance is money, and not a little (( How to be do not know(( Will be very grateful for any help!
 
rriaz #:
Guys, can you give me a hint? I have an account in MT5. How do I know if it's real? ( The problem is that my father independently opened it through unknown persons. And now I can't withdraw from it... On the balance is money, and not a little (( How to be do not know(( Will be very grateful for any help!

Look at the top of the programme window, it says.

Screenshot

 
rriaz #:
Guys, a tip please! There is an account in MT5. How do I know if it's real? ( The problem is that my father opened it by himself through unknown persons. And now I can't withdraw from it... On the balance is money, and not a little (( How to be do not know(( Will be very grateful for any help!

Script:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart() 
  { 
//--- выведем всю информацию, доступную из функции AccountInfoString() 
   Print("Имя брокера = ",AccountInfoString(ACCOUNT_COMPANY)); 
   Print("Валюта депозита = ",AccountInfoString(ACCOUNT_CURRENCY)); 
   Print("Имя клиента = ",AccountInfoString(ACCOUNT_NAME)); 
   Print("Название торгового сервера = ",AccountInfoString(ACCOUNT_SERVER)); 
 
 
 ENUM_ACCOUNT_TRADE_MODE tradeMode=(ENUM_ACCOUNT_TRADE_MODE)AccountInfoInteger(ACCOUNT_TRADE_MODE);   
   //--- выясним тип счета 
   switch(tradeMode) 
     { 
      case(ACCOUNT_TRADE_MODE_DEMO): 
         Print("Это демо счет"); 
         break; 
      case(ACCOUNT_TRADE_MODE_CONTEST): 
         Print("Это конкурсный счет"); 
         break; 
      default:Print("Это реальный счет!"); 
     } 
  
  }
//+------------------------------------------------------------------+
Reason: