Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 452

 
Help -- I bought a new laptop with vin.8 installed -- I downloaded the terminal from alpari last updated -- I load indicators that I worked with before, in the folder MQL4-indicators, they appear there -- but in the terminal itself in the users do not see them, customer service does not say anything straight - what to do?
 
galinka:
Help -- I bought a new laptop with vin.8 installed -- I downloaded the terminal from alpari last updated -- I load indicators that I worked with before, in the folder MQL4-indicators, they appear there -- but in the terminal itself in the users do not see them, customer service does not say anything straight - what to do?

The system menu "File" has a new item "Open Data Folder". That's where you have to put it now.
 
No can do - they are not in the terminal
 

I must have misunderstood what to do - program files - I have Alpari - open ---- there are folders ---- MQL4- indikators - I put them in - they appear - I close - I open the terminal - they are not in the user files

 
Maybe there is something in my indicators that needs to be changed
 

Thank you it helped.

 
1mql:

Below the last extern:
extern int slippage = 2; // price slippage when closing market positions

insert another one:
extern bool total_symb = true; // on all pairs

and every line:
if ((OrderSymbol() == Symbol()))
and
if(OrderSymbol() == Symbol())

replace this:
if(OrderSymbol() == Symbol() || total_symb)

in theory should work, check.


It closes only a couple of charts where the position is activated. on others an error 4107 will close. I have tried to change in extern bool Buy = false; //delete/close direction of buy orders
extern bool Sell = false; //delete/close sell order direction. at true . it didn't work. but if e.g. we put it on a chart with no position open, none of them closes and error 4107 is seen.
 
Profitov:
Question has arisen, is it possible to write an Expert Advisor or script, which would be to achieve for example a 2% loss on the day would close all transactions?
Already written.
 
alsu:

So, Ticket is still used somewhere in the old version. We have to clean up the code...

Made as follows:

 Symb=Symbol();                               // Название фин.инстр.
   Total=0;                                     // Количество ордеров
   int order[7];//буффер для семи ордеров
   int ord;//количество ордеров
   ArrayInitialize(order,0);//обнуляем количество ордеров
   for(int i=1; i<=OrdersTotal(); i++)          // Цикл перебора ордер
     {
      if (OrderSelect(i-1,SELECT_BY_POS)==true) // Если есть следующий
        {                                       // Анализ ордеров:
         if (OrderSymbol()!=Symb)continue;      // Не наш фин. инструм
         if (OrderType()>1){Alert("Обнаружен отложенный ордер. Эксперт не работает.");return;}
         Total++;                               // Счётчик рыночн. орд
         if (Total>7){Alert("Более 7 ордеров. Эксперт не работает.");return;}
         Ticket=OrderTicket();                  // Номер выбранн. орд.
         Tip   =OrderType();                    // Тип выбранного орд.
         order  [OrderType()]++;                    // ПОЛУЧАЕМ КОЛИЧЕСТВО ОРДЕРОВ         
         Price =OrderOpenPrice();               // Цена выбранн. орд.
         SL    =OrderStopLoss();                // SL выбранного орд.
         TP    =OrderTakeProfit();              // TP выбранного орд.
         Lot   =OrderLots();                    // Количество лотов
        }
     }
     ord=order  [OrderType()];

 while(true)                                  // Цикл закрытия орд.
     {
      if (Tip==0 && Cls_B==true)                // Открыт ордер Buy..
        {                                       //и есть критерий закр
         Alert("Попытка закрыть Buy ",Ticket,". Ожидание ответа..");
         RefreshRates();                        // Обновление данных
         Ans=OrderClose(Ticket,Lot,Bid,2);      // Закрытие Buy
         if (Ans==true){Alert ("Закрыт ордер Buy ",Ticket);if (ord ==0){Alert ("Закрыты все ордера ",ord);break;}}
         if (Fun_Error(GetLastError())==1)      // Обработка ошибок
            continue;                           // Повторная попытка
         return;                                // Выход из start()
        }

The positions are closed completely. It is true that error zero comes out, but the docks says that it means no errors. And I cannot find"All orders closed" message in the log.

I bolded the lines that I have changed. It seems to work, I have not checked thoroughly yet.

I do not quite understand how loops work. Suppose I have code above and below and in the middle of the loop. If the loop's conditions coincide, the code is executed only inside the loop and does not let the code lines below the loop get executed? Considering this example,does thebreak operatorinterrupt the loop? Is it allowing lines below the loop to be executed, or does the program start calculating from the beginning?

Correct me if I'm wrong: break interrupts the loop it is in, whilecontinue performs the evaluation of the operator above it, so it's not clear if there is a second operator - will its evaluation be interrupted or doescontinue interrupt all the code and sends the program to execute it first?

 
Hello! Please help! How do I find out Open[0] on another symbol (not on the current chart symbol)-Thank you...