[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 388

 
Chiripaha:
I wonder what will happen. : )) Usually these holes are formed just on the server of the broker itself and in similar attempts to fix them I have had no success. If the broker doesn't fix it, there's nothing to pump up.
But on another MT4 on the Demo of the same broker there is no hole!
 
borilunad:
But on another MT4 on demo of the same broker there is no hole!

the keyword is demo.

I've had dozens of such cases with different brokers... This is a common situation.

 
Listen up, pros. There's not enough of you and you're clashing, it's getting to the point of hand-to-hand. Do you even appreciate all the local content? You want me to show you forums where there are no such pros at all?Integer is hot on his hands, I've been in a fight before, I know him. I understand what we have and weep for what we don't have. But to beat an entire person for the fact that he was wrong in one thing, even though each of you has experience, and quite good - at least unreasonable, if not to say worse.
 
sdm:
Need help 1 how to know the price of the top open or pending sell order 2 how to check if there is an open or pending sell order at the price I have specified



Only by going through all the orders. For example like this:

#property copyright "Copyright 2013, Mikhail <Sepulca> Kozhemyako"
#property link      "ua3xcm@obninsk.com"
extern int MAGIC=1234;
int init()
 {
  return(0);
 }
int deinit()
 {
  return(0);
 }
int start()
 {
  int NoL,NoS,NoBS,NoSS,NoBL,NoSL,n,i;
  double MaxSellOpenPrice,MaxSellStopOpenPrice,MaxSellLimitOpenPrice,MinBuyOpenPrice,MinBuyLimitOpenPrice,MinBuyStopOpenPrice;
  NoL=0;NoS=0;NoBS=0;NoSS=0;NoBL=0;NoSL=0;
  MaxSellOpenPrice=0.0;MaxSellStopOpenPrice=0.0;MaxSellLimitOpenPrice=0; MinBuyOpenPrice=99999999.9;MinBuyStopOpenPrice=9999999.9;MinBuyLimitOpenPrice=9999999.9;
// Перебираем все ордера
  n=OrdersTotal();
  for (i=n-1; i>=0; i--)
   {
    if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
     {
      if(OrderMagicNumber()==MAGIC && OrderSymbol()==Symbol())
       {
        if(OrderType()==OP_BUY) 
         {
          NoL++;MinBuyOpenPrice=MathMin(MinBuyOpenPrice,OrderOpenPrice());
         }
        if(OrderType()==OP_SELL)
         {
          NoS++;MaxSellOpenPrice=MathMax(MaxSellOpenPrice,OrderOpenPrice());
         }
        if(OrderType()==OP_BUYSTOP) 
         {
          NoBS++;MinBuyStopOpenPrice=MathMin(MinBuyStopOpenPrice,OrderOpenPrice());
         }
        if(OrderType()==OP_SELLSTOP)
         {
          NoSS++;MaxSellStopOpenPrice=MathMax(MaxSellStopOpenPrice,OrderOpenPrice());
         }
        if(OrderType()==OP_BUYLIMIT) 
         {
          NoBL++;MinBuyLimitOpenPrice=MathMin(MinBuyLimitOpenPrice,OrderOpenPrice());
         }
        if(OrderType()==OP_SELLLIMIT)
         {
          NoSL++;MaxSellLimitOpenPrice=MathMax(MaxSellLimitOpenPrice,OrderOpenPrice());
         }
       }
     }
   }
// Смотрим чего есть в наличии
  if(NoL>0)// Если есть активные лонги
   {
   }
  if(NoS>0)// Если есть активные шорты
   {
   }
  if(NoBL>0)// Если есть лонги-отложеннники лимитники
   {
   }
  if(NoSL>0)// Если есть шорты отложенники лимитники
   {
   }
  if(NoBS>0)// Если есть лонги-отложенники стоповые
   {
   }
  if(NoSS>0)// Если есть шорты отложенники стоповые
   {
   }
// Соответственно в  переменных получаете мин/макс цену.
  return(0);
 }
 
borilunad:

Thank you! But there are positions open, or is that OK?! I'll give it a try now!

Sorry, how can I delete just from the beginning of the hole? You can delete everything in F2, but as soon as I press M1, all quotes appear immediately with the same hole! So how do you delete just from the beginning of the hole?


Nothing will happen to the positions. From the beginning of the hole - see what time the holes start, in the history table there is a column with the date, use it to look upwards from the desired date (using the Shift key). Quotes archive is Main menu - Tools - Quotes archive.
 
Integer:

Nothing will happen to the positions. From the beginning of the hole - see what time the holes start, in the history table there is a column with the date, use it to look upwards from the desired date (using the Shift key). The quotes archive is in the Main menu - Tools - Quotes archive.
Thank you Dmitriy! I have already thanked above and reported what I've got! I don't know how, but the main thing is that there are 0 errors and all quotes are in place. But these volumes cause errors all the time! How about not using them? I do not use them in my code! Thanks again!
 

I have string type names - h0 h1 h2 etc. Depending on the name found, I need to do a swith(Name) enumeration.

How to do it properly?

I tried to use preprocessor, but it didn't work. : (

#define h0   0
#define h1   1
#define h2   2
#define h3   3      

      string Имя_Остатке;

      switch (Имя_Остатке)
         {
          case h0:  break;
          case h1:  break;
          case h2:  break;
          case h3:  break;
         }
 
It won't work, the switch only works with ints. put the names in an array, and operate it with indices.
 
FAQ:
It won't work, the switch only works with ints. put the names in an array, and operate it with indices.

Thank you very much!

Got it! : )))) I mean, through an array.

 

Unfortunately, the 1minutes are gone again altogether, only there on the chart, and in the logbook it's scribbling every tenth of a second:

15:55:39 Memory handler: cannot allocate 206924212 bytes of memory
15:55:39 HistoryBase: not enough memory 'EURUSD1' [4702734 bars]
15:55:39 Memory handler: cannot allocate 206924212 bytes of memory
15:55:39 HistoryBase: not enough memory 'EURUSD1' [4702734 bars]
15:55:39 Memory handler: cannot allocate 206924212 bytes of memory
15:55:39 HistoryBase: not enough memory 'EURUSD1' [4702734 bars]

500й!

Reason: