Discussion of article "Using limit orders instead of Take Profit without changing the EA's original code" - page 6

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
hello Readers!
did anyone else stumble upon the "stack overflow " error ?
I think the problem lies in the "LimitTakeProfit.mqh" library!!!
Hello Dmitry,
Thank you for your interesting article!
Please, would you explain error "paramter passed as reference, variable expected" related of each of the following lines (line 54, 55, 56)?
CSymbolInfo CLimitTakeProfit::c_Symbol = new CSymbolInfo();
CArrayLong CLimitTakeProfit::i_TakeProfit = new CArrayLong();
CArrayDouble CLimitTakeProfit::d_TakeProfit = new CArrayDouble();
Thanks!
Hello Dmitry,
Thank you for your interesting article!
Please, would you explain error "paramter passed as reference, variable expected" related of each of the following lines (line 54, 55, 56)?
CSymbolInfo CLimitTakeProfit::c_Symbol = new CSymbolInfo();
CArrayLong CLimitTakeProfit::i_TakeProfit = new CArrayLong();
CArrayDouble CLimitTakeProfit::d_TakeProfit = new CArrayDouble();
Thanks!
Hi, do you use?
Hi, do you use?
Hi Dmitry,
The following lines are exactly written on your "LimitTakeProfit.mqh":
More precisely, such error "paramter passed as reference, variable expected" come from compilation of your EA "MACD Sample LImitTP.mq5".
Thank you for answering!
Hi Dmitry,
The following lines are exactly written on your "LimitTakeProfit.mqh":
More precisely, such error "paramter passed as reference, variable expected" come from compilation of your EA "MACD Sample LImitTP.mq5".
Thank you for answering!
Hi, you must add * before paprameter
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.
When testing the EA with LimitTakeProfit, it returns the following error message: "Invalid expiry".
I've tried adding expiry along with the trade request structure, but to no avail.
Someone please help me.
Machine translation applied by moderator