[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 557

 
maryan.dirtyn >>:
вмешивайтесь плз.. задача проста.. пока цена летит вниз не покупать, пока не будет тика в другую сторону. причем нужно зациклить код в одном месте, пока летит, ничего не трогаем..
So do as you're told. It should work. Either static in start body, or declare your tmp in header with assignment of, say, lm.
 
Svinozavr >>:
Ну так и сделайте как вам предложил. Должно работать. Или статик в теле старт, или в заголовке свою tmp объявите с присвоением, скажем, ляма.
If you don't mind, the code please.
 
static double tmp=0;  
RefreshRates();
while(Ask<tmp || tmp==0) { 
   tmp=Ask;
   ///
   ///
  }
 

What's the point? You entered the loop, assigned tmp, then exited the loop without doing anything, and moved on... Does that sound like...

double tmp=Ask; while(Ask<=tmp) tmp=Ask; Print("Заработало");
 
maryan.dirtyn >>:

а в чем смисл? вошли в цикл, присвоили tmp, тут же вышли из цикла по сути ничего не сделав, и пошли дальше... разве ето похоже на


And the point is that a well-formulated problem is already a half-solved problem.

Maybe it is time for us to look at the mysterious processes that have to take place in this cycle? And maybe we will see a different solution to the problem?

 
Why overload the code with things that will happen in the loop or after it... I think the task is as clearly formulated as possible... but I'm still at a loss for a solution.
 
Look, it's early - the telepaths haven't pulled up yet. How do I know what you're going to do in the loop while Ask is going down? I have marked your actions I don't know as ///.
Do you even know what you want?)))
 
maryan.dirtyn >>:
ну я давно не новичок уже в mql. за два года уже освоился.. да, мне нужно именно while. кстати к учебнику периодически возращаюсь, а не зевнул ли я чего).. ти не видишь кролика? а он есть.. не все так просто.
I'm troubled by doubts...
 
All I need is for Ask to go down and the Expert Advisor to do nothing, as soon as Ask goes one tick higher, the code will start again from the same place... is it that complicated? I'm going to bed, I hope the telepaths wake up and give me some tips.
 

Shit. Well, insert return in the body of the loop.

===

In fact, what for is there a loop there? Just if(Ask<tmp) {tmp=Ask; return(0);}