[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 1032

 
costy_:

About that, in a hurry...

Thank you very much.
 
denamix:

help me out here, please.

on the page https://book.mql4.com/ru/trading/ordermodify the author uses while (true) condition. and it seems to have looped in my head. i can't figure out what the hell this is and until when this loop will be executed? and why is he using it? What does it compare to and what does it true.

Thank you in advance or tell me where this has already been discussed.


This loop serves to hold the order modification fie (if the order modification in the real market failed at the first try (it happens) and the possible error is not critical: e.g. No.136 - no prices - wait for a new tick), i.e. this loop holds control until the previously selected order is modified or a critical error is received - all this can happen within several ticks or even seconds (tens of seconds), in other words, everything else in the EA does not work, i.e. if at that time the trade criterion is triggered, the order is not opened.i.e., if a trade criterion to open an order has triggered at this time, the order will not open as the control is held by the function of modification of all selected orders until it finishes, after which, if the condition of opening the next order in the Expert Advisor is still active, the next order will try to be opened on the next tick - this is just an example... "If the trade operation is successful, then the break operator in block 6-7 terminates execution of the while loop that causes termination of the current iteration of the for loop (and the next iteration starts processing the next order) - all this time the function holds control until the last order to be modified is executed. If the trade operation is unsuccessful, errors are handled. If the error is not critical, the attempt to repeat the trading operation is repeated. If the error is estimated as critical, control is transferred outside the modification loop for processing the next order (in the for loop), after which other Expert Advisor functions are executed.

I think I explained it incorrectly but I understand it. :-)))

 
denamix:

help me out here, please.

on the page https://book.mql4.com/ru/trading/ordermodify the author uses while (true) condition. and it seems to have looped in my head. i can't figure out what the hell this is and until when this loop will be executed? and why is he using it? What does it compare to and what does it true.

I am grateful in advance. Or tell me where it has already been discussed.

In scripts and Expert Advisors you can keep the loop unfinished for a long time without fear of slowing down the interface.

I.e. in an indicator while (true) will hang tight, because Sleep doesn't work.

View the script below to see more clearly

Files:
temp_3.mq4  3 kb
 

Folks, please advise! Is it possible to make a programme that gives a beep when the price passes 10-11p in 0.1-0.4s?

 
globad:

Folks, please advise! Is it possible to make a programme that gives a beep when the price passes 10-11p in 0.1-0.4s?

you can. a regular expert/script
 
Hello, I have this problem. I read the tutorial, wrote an Expert Advisor and put it on my demo account.... does not work! I've downloaded inet with 20 different Expert Advisors, but they all don't work either! What's the problem? I went to the settings, set everything on the advice of the Inet, all on automatic.
 
fergios:
Hello, I have this problem. I read the tutorial, wrote an Expert Advisor and put it on my demo account.... does not work! I've downloaded inet with 20 different Expert Advisors, but they all don't work either! What's the problem? I went to the settings, set everything on the advice of the Inet, all on automatic.
What errors do the Experts give out? You should attach the code of your EA here, maybe? How many digits is it?
 
fergios:
Hello, I have this problem. I read the tutorial, wrote an Expert Advisor and put it on my demo account.... does not work! I've downloaded inet with 20 different Expert Advisors, but they all don't work either! What's the problem? I went to the settings, set all on the advice of Inet, all on automatic.

Maybe the problem isn't in the hands. Maybe I need more history. Maybe my EA is not designed to work in your brokerage company. Lots are different, sizes are different. There may be little else. Most often, many EAs are written for certain conditions (including brokerage companies). So, everything may be. Although, we may easily make any EA work in any brokerage company, the results may not rejoice. Or not. I don't matter what I like.
 
Techno:

what kind of errors do the experts make? Would it be better to attach your EA code here? How many digits is the dc?

Well, I will not throw out my code, but I will take some downloaded one!
Files:
bulllbear.mq4  7 kb
 
fergios:
Well, I'm not going to throw away my code, I'm going to use some downloaded code that doesn't work either!


Who says it has to work?

It has to be tidied up first.

Not every code works everywhere. You have to think about it.