Discussion of article "Using limit orders instead of Take Profit without changing the EA's original code" - 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
Hi, you must add * before paprameter
Hi Dmitry,
Something is still not working, the same three lines gives the following errors:
- parameter passed as reference, variable expected LimitTakeProfit.mqh 54 57
- redefinition; different type modifiers LimitTakeProfit.mqh 54 35
Thank you for answering!
Hi Dmitry,
I know this article was published a while ago, but I wanted to thank you for it! It is very useful, your explanation is really clear, and the class works like a charm. Thank you!
I believe I found a minor bug in the posted code. Halfway through function SetTakeProfits, we find this line:
This is inside a loop through all TP. The problem is that later in the loop, function CheckLimitOrder is called, who in turn calls function CheckOrderInHistory, and there another Position may be selected. This means that in the next iteration of the loop, the "switch" in the code above may be different.
To solve this, I believe that position_type should be stored in a variable, before the loop begins. Thus:
Hope this makes sense. Again, thanks for an excellent job!
Hello everyone!
I'm having a [Invalid expiration] problem, anyone knows how to fix it?
Hello everyone!
I'm having a [Invalid expiration] problem, anyone knows how to fix it?
I have the same problem, did you manage to solve it?