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
Peter, if you remember, the New7.mq5 script 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.
1. Script no, EA yes. The script starts immediately and unloads when it finishes. You cannot use OnTick function 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.
Valery, even now many people don't understand me, why do I need all this? I don't worry much about it. But to understand and create a more complex script is a small, but confident step in self-study. Thanks for the tip, I will study the necessary information tomorrow. Now it's time to relax and tune in to the Russia-Sweden football match.
Regards, Vladimir.
Hello! It is possible and necessary to write. Let's start with understanding what a trailing stop is, it's a change, a so-called dragging of a stop loss for example, which occurs with every new tick and depending on a given 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. You may decide for yourself whether to apply them or not.)
Hello, I need to use, because the self-study plan, which I try to stick to, I have an item on modernizing the script. I move from simple to complex! Thank you for the tip!
Regards, Vladimir.
Trailing is the function of following the price with an order at a distant location to lock in the current profit/loss.
Are you sure you understand trailing stop correctly?
Are you sure you understand trailing stop correctly?
Yes.
No more questions
To write a trailing stop, you need to pass from the script to the Expert Advisor, because the script is unloaded from the chart when it is executed and it does not have OnTick event, without which it will not work. So, you will not be able (though it is theoretically possible) to write such a script.
Peter, I have found several trailing scripts in MQL4. I have not found any in MQL5.
Regards, Vladimir.
Peter, I have found several trailing scripts in MQL4. I have not found any in MQL5.
Sincerely, Vladimir.
Well, I'm NOT saying that it's impossible to write). I said it would be impossible for you to do so far. For now... It's easier and truer to implement in an EA.
Great, let's do that! But you have already intrigued me with the script. Anyway, I will try to make this script complete.
I`ll have a couple of hours off, because I need to relax and watch football.
Regards, Vladimir.