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

 
FAQ:

Completely independent of that. Maybe it depends on something else, but not on ticks - I checked. In general, the new build has completely changed the terminal operation with respect to the EA flow. Now the looped EA clearly fulfills all iterations of the loop irrespective of the terminal operation, in old versions, there were delays in loading the main thread. By the way, the amount of CPU resources consumed by the looped EA has been drastically reduced.
I also had a similar thing with terminal - there were no looped things - it looked like the terminal was busy processing something... When I repeatedly tried to call up the Properties window with my mouse - after 5-8 attempts - it successfully opened...
 
Roman.:
I also had a similar problem with the terminal - there was no looping thing - it looked like the terminal was busy processing something... when I repeatedly tried to call up the Properties window with my mouse - after 5-8 attempts - it successfully opened...

Possibly, but it has nothing to do with the ticks.
 
FAQ:

Maybe, but it has nothing to do with tics.

I see.
 

I hope I'm on the right topic ; )

It's more of a nubian question, but I've been stuck on it for a while now.

int total=OrdersTotal();

int Q,W;
if (total == Q + W)

and then I open several different orders. Some are under Q, others under W. How to change an order (for example, if it closes) to Q, it will reopen Q... If they are both closed - Q and W, they will reopen only if they are both closed.

 
Keda:

I hope I'm on the right topic ; )

It's more of a nubian question, but I've been stuck on it for a while now.

int total=OrdersTotal();

int Q,W;
if (total == Q + W)

and then I open several different orders. Some are under Q, others under W. How to change an order (for example, if it closes) to Q, it will reopen Q... Otherwise they are reopened only if Q and W are both closed.


As far as you can tell - the variables Q and W are integers.

Next, the orders of some integers are opened (how do you mean?) and you are asking how to do this, if an order (of some integer) is closed, in order to reopen some other integer. Now they open if two whole ones close (which ones what?).

The question is super. You correctly said, "The question is rather nubile". Exactly: a nub of asking questions. Don't be a noubet at asking questions, train yourself to ask them in such a way that you are understood.

In the meantime, you should go here.

 

I can tell from the question that the person asking it is completely new to mql4. Thanks for the reply, now I understand what the problem is.

I tried to understand it and got even more confused. I'm using 2 lots only. 2 different lots are opening. They should work together. When one of them closes, how do I make the closed one open again? When one lot is closed, the other one works together. Only when both lots are closed, 2 lots are opened. I would be grateful for advice.

 
yosuf:
The internet often goes down, is there no way to automate it programmatically to get it up and running again? Or what is known in this direction? Is there a way to power two or more ISPs at the same time, I mean in parallel? Thank you in advance.
It is easier and safer for your money to use VPS service.
 
Keda:

I can tell from the question that the person asking it is completely new to mql4. Thanks for the reply, now I understand what the problem is.

I tried to understand it and got even more confused. I'm using 2 lots only. 2 different lots are opening. They should work together. When one of them closes, how do I make the closed one open again? When one lot is closed, the other one works together. Only when both lots are closed, 2 lots are opened. I would be grateful for advice.


Now I understand. Here's a rough estimate:

int    Magic=123;

double Lot_Q=0.01;
double Lot_W=0.05;

bool   Flag_Q=False;
bool   Flag_W=False;


//Просматриваем все открытые ордера

for(int i = OrdersTotal() - 1; i >= 0; i--) 
  {
   OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
   if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)//Если это ордер данного символа и магика (т.е. открыт данным советником)
     {
      if(OrderLots()==Lot_Q) Flag_Q=True;//Если ордер с объемом Q есть среди открытых, присваиваем флагу Q истину.
      if(OrderLots()==Lot_W) Flag_W=True;//Если ордер с объемом W есть среди открытых, присваиваем флагу W истину.
     }
   }


//Проверяем условия нужности открытия - индикаторы, другие сигналы, и что там у Вас еще. И если есть сигнал

if(Flag_Q==False)//Только если ордер Q не открыт в настоящий момент
  {
   //Открытие ордера Q
  }

if(Flag_W==False)//Только если ордер W не открыт в настоящий момент
  {
   //Открытие ордера W
  }
 
Oh great, this is it. Thank you
 

Hello again) Hello! Can you tell me how to write this in a more compact way?

        for (i=4; i<7; i++){
        sum+=GetPrcD1(symb[i]);
        Content[5][1]=DoubleToStr(sum/3,3);
        }
        
        for (i=7; i<10; i++){
        sum+=GetPrcD1(symb[i]);
        Content[6][1]=DoubleToStr(sum/3,3);
        }

        for (i=10; i<13; i++){
        sum+=GetPrcD1(symb[i]);
        Content[7][1]=DoubleToStr(sum/3,3);
        }

        for (i=13; i<16; i++){
        sum+=GetPrcD1(symb[i]);
        Content[8][1]=DoubleToStr(sum/3,3);
        }

        for (i=16; i<19; i++){
        sum+=GetPrcD1(symb[i]);
        Content[9][1]=DoubleToStr(sum/3,3);
        }
Reason: