
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Time is more or less clear, but the variables for "Enough patience" are still a problem. What to put in them? Is there patience or no patience? At least these two parameters? I need to think about it.
Regards, Vladimir.
Formalizing the attributes is a complicated task. The easiest solution is to have patience or not. It is a little more difficult to gradate for example from 0 to 10. Assess your patience from 0 to 10. Rate your motivation from 0 to 5. Evaluate your memory from 0 to 10. Then we pass these variables into a function and add them up (for example) and compare it to 18 If more, the function returns True, if not, it returns False)
formalising features is a difficult task. The easiest solution is to have patience or not. A slightly more complicated grading is for example from 0 to 10. Rate your patience from 0 to 10. Rate your motivation from 0 to 5. Assess your memory from 0 to 10. Then we pass these variables into a function and add them up (for example) and compare it to 18. If more, the function will return True, if not, then False)
Thanks, Valery, for the tip! Frankly speaking, I got very distracted from the self-study plan and had to switch to the script with "Enough_time" and "Enough_patience" variables. I'll get back to it, but as I wrote - a little later. At this moment I had just begun to work out an algorithm for trailing Stop Loss. I am reading literature, browsing the website, but still cannot find answers to two questions related to MQL5 programming language:
Thanks, Valery, for the tip! To be honest, I got distracted from the self-study plan and had to switch to the script with "Enough_time" and "Enough_patience" variables. I'll get back to it, but as I wrote - a little later. At this moment I had just begun to work out an algorithm for trailing Stop Loss. I am reading literature, browsing the website, but still cannot find answers to two questions related to MQL5 programming language:
Thanks, Valery, for the tip! To be honest, I got distracted from the self-study plan and had to switch to the script with the variables "Enough_time" and "Enough_patience". I'll get back to it, but as I wrote - a little later. At this moment I had just begun to work out an algorithm for trailing Stop Loss. I am reading literature, browsing the website, but still cannot find answers to two questions related to MQL5 programming language:
1. Script no, Expert Advisor yes. The script is started right away and unloaded when it is finished. The OnTick function cannot be used in the script. Theoretically, you can. In the script, you can use SLEEP, the function to stop working for a while, and in the infinite loop vail at intervals to request the Ask price, compare it with the price of the position and change the SL and TP. Trading functions are not prohibited. But it is .... You will never be understood.
The script is a one-off operation, close all positions. Or open positions already with SL and TP and that's it. Remove all objects from the chart.
And the EA starts to work again with every tick.
2. It is possible, and it should be done in short. It is impossible to do without functions if the Expert Advisor has more than 2 actions.
The include files are a matter of code convenience, you don't have a single piece, but 2 separate windows that you can place under each other)
When compiling, the include file is simply inserted where the inlude stands. So compiled files will not differ.
And classes are wrappers of methods and functions, besides with rather complicated syntax. Therefore, a little later is better.
Thanks, Valery, for the tip! To be honest, I got distracted from the self-study plan and had to switch to the script with the variables "Enough_time" and "Enough_patience". I'll get back to it, but as I wrote - a little later. At this moment I had just begun to work out an algorithm for trailing Stop Loss. I am reading literature, browsing the website, but still cannot find answers to two questions related to MQL5 programming language:
1. the trawl is constantly monitoring and trawling, so it' s a robot. Or maybe you can use some kind of looped script, and some smart guys will come running... :-)
2. it's possible.
IMHO, looking at this topic myself re-read.... :-)
don't forget the "basic" articles... :-) which help to understand the subject better than just plain code.
Introduction to MQL5: Writing a Simple Expert Advisor and Indicator
Peter, I completely agree with your point of view, but I would still like to know the answers to my questions:
1. the trawl is constantly monitoring and trawling, so it's a robot. Or there could be some kind of looping script, the smart guys will come running... :-)
2. it's possible.
IMHO, looking at this topic myself re-read.... :-)
don't forget the "basic" articles... :-) which help to understand the subject better than just plain code.
Introduction to MQL5: Writing a Simple Expert Advisor and Indicator
Thank you, Roman, for your reply and the link to the basic articles!
Sincerely, Vladimir.
1. Yes.
Peter, if you remember, script New7.mq5 can already place pending orders, Take Profit and Stop Loss. I was going to add trailing stop loss to it according to the self-study plan. Hence the question. Thank you for the tip!
Regards Vladimir.
Hello! You may write it and you may need it. Let's start with understanding what a trailing stop is, it's the change of the so-called dragging of the stop loss that occurs with every new tick and depending on the set distance from the current price. There are many types and methods, and you can find examples of incremental or one-off dragging of stops, which are used depending on the purpose. And you can decide if you want to use them or not.)