Discussion of article "MQL5 Wizard: How to Create a Module of Trailing of Open Positions" - page 2

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
Thank you for your great and helpful article,
May I kindly ask you bring an example how could use this class in writing an expert adviser, my mean is that using this class in EA template not EA generate..
Thank you again,..
Good afternoon. The module does not work.
The log shows that the level of threshold profit must be greater than the level of setting orders.
In the constructor I initialise variables that are not empty and are not equal to zero. Why do I get an error?
Good afternoon. The module does not work.
The log shows that the level of threshold profit must be greater than the level of setting orders.
In the constructor I initialise variables that are not empty and are not equal to zero. Why do I get an error?
When using the module specified in the article, errors are generated in the Expert Advisor log while loading the Expert Advisor to the chart:
2017.09.06 00:28:29.873 1 (EURUSD,M5) OnInit: error initializing indicators
2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetPriceSeries: changing of timeseries is forbidden
2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetOtherSeries: changing of timeseries is forbidden
2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::InitIndicators: parameters of setting are not checked
2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpert::InitIndicators: error initialisation indicators of trailing object
2017.09.06 00:31:20.256 1 (EURUSD,M5) OnInit: error initializing indicators
Make a change in the trailing module "sampleTrailing.mqh":
When using the module specified in the article, errors are generated in the Expert Advisor's log while loading the Expert Advisor to a chart:
Thanks for the message, the article has been corrected
When opening a short position and setting the usual stop loss (not trailing) to 0 in the parameters, the trailing stop is not set to breakeven, but if you slightly move the usual stop and set it at least -1 pip, everything works. In longing everything works normally. In checking the condition that there is already a breakeven (the stop is less than the price), initially 0 in the value of the stop and it does not let it go further.
That's right. It is the specified Stop Loss that is the trigger for THIS trailing module to work at breakeven. That is, it is assumed that the position MUST have a stop loss initially.
Added:
the purpose of any article is to show and familiarise with approaches to solve some problem. Then the user himself should develop his own code based on the knowledge gained.
It should be supplemented so that if there is no stop, the trailing is also - fill the variable with at least the opening value.
(I got a push notification for 2 of your messages, but one of them is missing - deleted)?
If you need to change something - this is not the problem of this article. Here you can do it yourself, based on the knowledge you have gained. That is, if you want to compose a Technical Assignment and think that the article will be rewritten under it - it is not so.
As I see your actions: rewrite the module (a little change) and use.
Added: For the last time, please use the "reply" button. Otherwise I will not reply.
Okay, I'll write it myself. Have you deleted one of your posts (tell me if you have, so I won't have to look for it)?
You can open a new topic, something like"Module of open positions maintenance to breakeven" - I think such a topic will be useful.
So yes, I was editing my post and clicked on "delete" by mistake - that is in fact I wrote TWO posts and deleted one. Therefore the push arrived correctly.