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

 
MakarFX:

These are Windows system settings and there are many options.

I advise the mate to run " /portable" and then there will be no problems

I have already decided to drag the indicators to the Expert Advisor. Already decided to drag the indicators into the EA. For a person to be able to create a " /portable" version needs qualification. And he is an ordinary user.
 
Sergey Fionin:
Thank you. Already decided to drag the indicators into the EA. For a person to be able to create a " /portable" version needs qualification. He is an ordinary user.

No need to create anything!!! Just add in the properties of the shortcut


 
MakarFX:

No need to create anything!!! Just add in the properties of the shortcut.


There you go, selling all the secret information. They said you should have a college degree, and preferably a degree in programming...

 
Alexey Viktorov:

There you go, selling all the secret information. They said you had to have a university degree, preferably a degree in programming...

Yeah... shit, I screwed up))))
 

Hi folks!!!

There is an opportunity to buy a netbook on the processorARM WM8650 800MHz, but it is Windows CE 6.0

Or you can putandroid 2.2

My question is: will MT4 terminal run there?

Or is it really outdated? I don't want to buy it for nothing and leave it lying around.

 
Andrey Sayapin:

Hi folks!!!

There is an opportunity to buy a netbook on the processorARM WM8650 800Mhz, but it is Windows CE 6.0

Or you can putandroid 2.2

My question is: will MT4 terminal run there?

Or is it really outdated? In order not to buy it for nothing.

No, it will not.

It is not the obsolescence, it is the processor with another architecture.

 
Andrey Sayapin:

Hi folks!!!

There is an opportunity to buy a netbook on the processorARM WM8650 800MHz, but it is Windows CE 6.0

Or you can putandroid 2.2

My question is: will MT4 terminal run there?

Or is it really outdated? In order not to buy it for nothing.

And even on Android? It is a Linux, so to say.

I've always run terminals on Windows and on my phone, I don't know how it works on other operating systems.

 
Hi. Is there a script in MQL4/MQL5 for opening multiple limit orders? You may calculate their lot from the open position's lot.
What for? To close a trade in parts. Three-five stop-losses and take-profits each. Netting account
 

Good afternoon to allJ I decided to split my Grail machine into two versions . 1) for demo/real and 2) for tester and optimization. The version for tester and optimisation has a tick check at the beginning of it for new bar and function call for counting EA orders.

Everything works fine and only 1 order is opened when a signal comes in, just the way I need it. I have removed the check of new bar in the Demo and Real versions. I left the function for calculating EA's orders checked and, oh my goodness, the signal opens orders until the money runs out. This is what the EA's order counter function looks like.

//+------------------------------------------------------------------+
//|                                                  DATA_ORDERS.mqh |
//|                                                    ДАНЯ ГАГАРКИН |
//|                                     https://vk.com/danila_mastep |
//+------------------------------------------------------------------+
#property copyright "ДАНЯ ГАГАРКИН"
#property link      "https://vk.com/danila_mastep"
#property strict
   int count_orders_all,     //КОЛИЧЕСТВО ВСЕХ УСТАНОВЛЕННЫХ ОРДЕРОВ
   count_orders_market_all,  //КОЛИЧСТВО ВСЕХ РЫНОЧНЫХ ОРДЕРОВ
   count_orders_market_buy,  // КОЛИЧЕСТВО РЫНОЧНЫХ БАЙ ОРДЕРОВ
   count_orders_market_sell, // КОЛИЧЕСТВО РЫНОЧНЫХ СЕЛЛ ОРДЕРОВ
   
   count_orders_stop_buy,    //КОЛИЧЕСТВО СТОП БАЕВ
   count_orders_limit_buy,   // КОЛИЧЕСТВО ЛИМИТ БАЕВ
   
   count_orders_stop_sell,    //КОЛИЧЕСТВО СТОП СЕЛОВ
   count_orders_limit_sell;   //КОЛИЧЕСТВО ЛИМИТ СЕЛОВ
   
   
   double lot_orders_buy,     //ОБЪЁМ ЛОТА ПО БАЙ ОРДЕРАМ
         lot_orders_sell,      //ОБЪЁМ ЛОТА ПО СЕЛЛ ОРДЕРАМ
         balance_all,          // БАЛАНС ПО ВСЕМ ОРДЕРАМ
         balance_buy,         // БАЛАНС ПО ОРДЕРАМ БАЙ
         balance_sell;        // БАЛАНС ПО ОРДЕРАМ СЕЛЛ
         
         void data_orders(string comment="alt",int magik_number=123)
              {
         int I = 0;
   count_orders_all = 0;   //КОЛИЧЕСТВО ВСЕХ УСТАНОВЛЕННЫХ ОРДЕРОВ
   count_orders_market_all = 0; //КОЛИЧСТВО ВСЕХ РЫНОЧНЫХ ОРДЕРОВ
   count_orders_market_buy = 0;
   
   count_orders_stop_buy = 0;    //КОЛИЧЕСТВО СТОП БАЕВ
   count_orders_limit_buy = 0;   // КОЛИЧЕСТВО ЛИМИТ БАЕВ
   
   count_orders_stop_sell = 0;    //КОЛИЧЕСТВО СТОП СЕЛОВ
   count_orders_limit_sell = 0;   //КОЛИЧЕСТВО ЛИМИТ СЕЛОВ
   
   
  lot_orders_buy = 0;    //ОБЪЁМ ЛОТА ПО БАЙ ОРДЕРАМ
         lot_orders_sell = 0;      //ОБЪЁМ ЛОТА ПО СЕЛЛ ОРДЕРАМ
         balance_all = 0;          // БАЛАНС ПО ВСЕМ ОРДЕРАМ
         balance_buy = 0;         // БАЛАНС ПО ОРДЕРАМ БАЙ
         balance_sell = 0;        // БАЛАНС ПО ОРДЕРАМ СЕЛЛ
         
         
         
          for(int i = 0; i <= OrdersTotal();i ++) // перебор всех ордеров в цикле
          {
  
   if(OrderSelect(I , SELECT_BY_POS, MODE_TRADES))// выбираем ордер по переменной цикла
   {
    if(OrderMagicNumber() != magik_number || OrderSymbol() !=Symbol()) // если ордер не нашь то
    {
    continue; // переходим на следующую итерацию
    
    }
    if(comment== OrderComment() || comment=="alt")// если коментарий нашь то 
    {
    count_orders_all+=1;
    if(OrderType()== OP_BUY)
    {
    count_orders_market_all+=1;
    count_orders_market_buy+=1;
    }
    if(OrderType()== OP_SELL)
    {
    count_orders_market_all+=1;
    count_orders_market_sell+=1;
    }
    if(OrderType()== OP_BUYSTOP)
    {
    count_orders_stop_buy+=1;
    }
    if(OrderType()== OP_BUYLIMIT)
    {
    count_orders_limit_buy+=1;
    
    }
    if(OrderType()== OP_SELLSTOP)
    {
    count_orders_stop_sell+=1;
    
    }
    if(OrderType()== OP_SELLLIMIT)
    {
    count_orders_limit_sell+=1;
    
    }
    
    
    
    }
         
         
              }
              }
              }


Here

I put information about the number of orders and call the function itself in the comment.

    data_orders( Coment, Magik_number);// ПОЛУЧАЕМ ДАННЫЕ ПО ОРДЕРАМ
 
Comment("\n",
     "КОЛИЧЕСТВО ВСЕХ ИМЕЮЩИХСЯ ОРДЕРОВ = ",   count_orders_all,"\n","\n"
   "КОЛИЧЕСТВО  ВСЕХ РЫНОЧНЫХ ОРДЕРОВ = ",   count_orders_market_all,"\n","\n" 
   "КОЛИЧЕСТВО РЫНОЧНЫХ БАЙ ОРДЕРОВ = ",    count_orders_market_buy,"\n","\n" 
   
   "КОЛИЧЕСТВО СТОП БАЕВ = ",    count_orders_stop_buy,"\n","\n" 
   "КОЛИЧЕСТВО ЛИМИТ БАЕВ = ",   count_orders_limit_buy,"\n","\n" 
   
   "КОЛИЧЕСТВО СТОП СЕЛОВ = ",  count_orders_stop_sell,"\n","\n" 
   "КОЛИЧЕСТВО ЛИМИТ СЕЛОВ = ",    count_orders_limit_sell,"\n","\n"
   
   
  "ЛОТ БАЙ ОРДЕРОВ = ", lot_orders_buy,"\n", 
         "ЛОТ СЕЛ ОРДЕРОВ = ",          lot_orders_sell,"\n","\n" 
         "БАЛАНС ПО ВСЕМ ОРДЕРАМ  = ",         balance_all,"\n","\n"  
        "БАЛАНС ПО БАЙ ОРДЕРАМ  = ",          balance_buy,"\n","\n" 
         "БАЛАНС ПО СЕЛ ОРДЕРАМ= " ,       balance_sell,"\n","\n"
         );
  

My question is why I have a normal open order in the Strategy Tester but the function is the same and if I remove check for a new bar, I get a pile for how much money I have. Please advise where I have screwed up?

p/s opening an order with the same magician and comment.

 
The question is probably simple and naive, but I've already racked my brain aboutHistorySelectByPosition(ORDER_MAGIC==1) I needa history of positions with magik = 1. Something I don't understand. Whatever I do, I don't get the history. Where should I enter the number of a magician?
Документация по MQL5: Торговые функции / HistorySelectByPosition
Документация по MQL5: Торговые функции / HistorySelectByPosition
  • www.mql5.com
HistorySelectByPosition - Торговые функции - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Reason: