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

 
hoz:


Hmm. And how can this number affect the collection of statistics on warrants?


That's great! The most interesting thing is that someone knows about it, oddly enough. How could anyone have guessed that?


If an owl is tested in the demo, how can this order be accounted for? I.e. the balance, which is initially given on the demo - it will be that... the sought-after ONE? And in the real one - it is already what we have withdrawn and put on the deposit, right?

Well, why don't you check the type 6 in any of your iterations of orders and, if there is one, print all data about it in the log. I think if you see more clear information about them, you will understand how to use them to your advantage. Huh? :))

ZS. Not for pest's sake, but for development...

 
artmedia70:

Why don't you check for order type 6 in any of your loops and, if you get one, log it all. I think when you see more clear information about them, it will make more sense for you to use it to your advantage. Huh? :))

ZS. Not for pest's sake, but for development...



I will do when I finish the current code. (Meaning, display in the log all of the parameters of the order? In the tester can also?) Although if it is only a non-trading operations, then absentmindedly strange all this.

By the way, I have fixed the order search function. Nothing has changed. The minimum number of all orders and number of pending orders is 1. Even when there are no orders in the market at all. Here is the code:

//+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders(int& t, int& p)
{
   int total = OrdersTotal() - 1;
   t = 0;
   p = 0;
   for (int i=total; i>=0; i--)
   {
      if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
      if (OrderSymbol() != Symbol()) continue;
      if (OrderMagicNumber() != i_magic) continue;
      if (OrderType() > 1 || OrderType() < 6)
      {
          p++;
      }
      t++;
      pr ("FindOrders(): " + "t = " + t);
      pr ("FindOrders(): " + "p = " + p);
   }
}

Type 6 has already been excluded. There is no zeroing for some reason. What is wrong? Everything like this has worked well before. The code is primitively simple.

 
hoz:


I will do when I complete the current code. (I mean, display in the log all parameters of the order? In the tester, too?) Although if it is only not trading operations, then absentmindedly strange all this.

By the way, here's a fix for the order search function. Nothing has changed. The minimum value of the number of all orders, and the number of orders in general is at least 1. Even when there are no orders in the market at all. Here is the code:

Type 6 has already been excluded. There is no zeroing for some reason. What is wrong? Everything like this has worked well before. The code is primitively simple.


if (OrderType() > 1 && OrderType() < 6)
 
artmedia70:


if (OrderType() > 1 && OrderType() < 6)


It's already a sign of sleepiness apparently.

But then again, that's not really the point. I am running the owl in the tester. In the screenshot, as you can see there are no pending orders or market orders.

Both the separate function and the standard comment that I have duplicated the separate function to display the required values show that there are market orders and pending orders all the time.

This is how the function works:

//+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders(int& t, int& p)
{
   int total = OrdersTotal() - 1;
   t = 0;
   p = 0;
   for (int i=total; i>=0; i--)
   {
      if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
      if (OrderSymbol() != Symbol()) continue;
      if (OrderMagicNumber() != i_magic) continue;
      if (OrderType() > 1 && OrderType() < 6)
      {
          p++;
      }
      t++;
      Comment("t = ", t, "p = ", p);
      pr ("FindOrders(): " + "t = " + t);
      pr ("FindOrders(): " + "p = " + p);
   }
}

I call it from the start, where the initial values of the counters are also zeroed:

int start()
{
   if (g_lastBarTime == Time[0])         // На текущем баре все необходимые действия..
       return (0);                               // ..уже были выполнены
   
   int oTotal = 0, oPending = 0;
   
   FindOrders(oTotal, oPending);
   
   int signal = GetGeneralSignal(oTotal);
   
   if (signal != SIGNAL_NO)
   {
       if (!Trade(signal))
       return(0);
   }
   else
 

help me find my mistake))

if(to1<tc&&mag==11&&total>0&&tip==OP_BUYSTOP){

RefreshRates();

double st=NormalizeDouble(Ask+delta*Point-StopLoss*Point,Digits);

double tp=NormalizeDouble(Ask+TakeProfit*Point+delta1*Point,Digits);

if (OrderModify(ticket,Ask+delta*Point,3,st,tp))

{to1=tc; Print("BUY STOP1 MOD : ");}

}

OrderModify error 130


 
Where is OrderSelect()?
 
Why can't I keep track of forum threads and why can't I get messages in my inbox?
 
JLY:
Why can't I keep track of forum threads, the messages don't come to my email?

It would be better if they made it like in the MQL5 forum, new messages in favourite threads would be displayed with an asterisk at the top near the profile.

 
Can anyone tell me if there is a function that measures the time from the moment an order to open a position is sent until it is accepted by the broker's server? I have an EA running on VPS, was looking for cheaper (not necessarily closer to the broker) and wondering how long this delay takes.
 
hoz:


This is already a sign of drowsiness in me.

But then again, that's not really the point. I am running the owl in the tester. In the screenshot, as you can see there are no pending orders or market orders.

Both the separate function and the standard comment that I have duplicated the separate function to display the required values show that there are market orders and pending orders all the time.

This is how the function works:

I call it from the start, where initially I also reset the counter values to zero:

Well, as it were, t++ works either way