[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 448

 
semiromid:

I told you to use flags.
You think that's the right answer in a beginner's topic. It's ..... clear .

Do you know what "flag" means in programmer terms?


instead of helping you answer the question clearly.

You need to know your level of knowledge first. and what do you expect - a piece of code or advice on how to do it?
 
sergeev:
do you know what a "flag" is in programmer terms?


You need to know your level of knowledge first. and what do you expect - a piece of code or advice on how to do


a detailed algorithm .

1...

2...

3...

Or a simple example of any such code .

 
semiromid:


detailed algorithm .

1...

2...

3...

Or a simple example of any such code .

bool flag = true;

start()
  {
   if (flag)
     {
      while(i<20)
       {


        i++;
       }
      flag = false;
     }
  }
1
datetime flagTime = 0;
int     flagStep = 20; ///sekund
start()
  {
   datetime dd = TimeLocal();
   if (flagTime < dd)
     {
      while(i<1000000)
       {


        i++;
       }
      flagTime = dd + flagStep;
     }
  }

2 For the case in 20 seconds. But it will work if quotes will come for at least 20 seconds. Otherwise the loop will execute only when a quote arrives. For example after 34 minutes .

 
Help please, same error with unbalanced bracket, only which one I can't figure out, my head is exploding already(((
Files:
 
rlx:

2 For the case in 20 seconds. But it will work if the quotes will not come in less than 20 seconds. Otherwise, the loop will only execute when a quote arrives. For example after 34 minutes...

or as follows

while(true)
{
  if (MathMod(TimeLocal(), 20)==0) // каждая 20 секунда
  while(i<10) {   i++; } // полезный цикл
  Sleep(10); // поспим немного для разгрузки проца
}
 

This is also possible.

If only Sleep() worked in indicators....

 
rlx:

This is also possible.

If only Sleep() worked in indicators....


infinite loops in indicators is actually nonsense.

But if you really want to , you can.

 
Dizet_02:
Help please, same error with unbalanced bracket, only which one I can't figure out, my head is just exploding already(((


ObjectSetText("incomeS",StringConcatenate("SELL orders =",s));
if (MargaBuy<0) TextColor=Red; else TextColor=Green;
ObjectSetText("incomeB",StringConcatenate("BUY orders =",b));
 
rlx:


ObjectSetText("incomeS",StringConcatenate("SELL orders =",s));
if (MargaBuy<0) TextColor=Red; else TextColor=Green;
ObjectSetText("incomeB",StringConcatenate("BUY orders =",b));

THANKS A LOT!!!!
 
Dizet_02:
Help please, same error with unbalanced bracket, only which one I can't figure out, my head is exploding already(((

Can we stop asking the same questions in different branches. This is spam: one week ban.
Reason: