Is it supposed to manage 1 order at a time ?
if yes :
remove these in PanelDialog.mqh
extern COrderExecutor *orderExecutor; COrderExecutor *orderExecutor = NULL;
replace with
class COrderExecutor; then after the class body of the COrderExecutor in PanelDialog.mqh , add
COrderExecutor orderExecutor;
In the function
void CPanelDialog::OnClickButtonExEcuteOCO(void)
remove the :
COrderExecutor orderExecutor(lotSize, entryPrice1, stopLoss1, takeProfit1, entryPrice2, stopLoss2, takeProfit2, orderType1, orderType2);
replace with :
COrderExecutor temp(lotSize, entryPrice1, stopLoss1, takeProfit1, entryPrice2, stopLoss2, takeProfit2, orderType1, orderType2); orderExecutor=temp;
on TradeManager.mq5 delete :
extern COrderExecutor *orderExecutor; in general have a setup and reset function for your classes , will make your life easier
Is it supposed to manage 1 order at a time ?
if yes :
remove these in PanelDialog.mqh
replace with
then after the class body of the COrderExecutor in PanelDialog.mqh , add
In the function
remove the :
replace with :
on TradeManager.mq5 delete :
in general have a setup and reset function for your classes , will make your life easier
in this part
then after the class body of the COrderExecutor in PanelDialog.mqh , add
COrderExecutor orderExecutor;do you have some idea thanks again
thanks for rply , i did do your mod , but return me this error 'COrderExecutor' - wrong parameters count PanelDialog.mqh 2168 22
in this part
then after the class body of the COrderExecutor in PanelDialog.mqh , add
do you have some idea thanks againyou don't have a parameterless constructor. you need pass the parameters or if you don't have the values available in global context you need instantiate it with new operator when you can (in OnInit or whatever).
*or add a default constructor to your class and create a function to set/change the parameters.
- www.mql5.com
you don't have a parameterless constructor. you need pass the parameters or if you don't have the values available in global context you need instantiate it with new operator when you can (in OnInit or whatever).
*or add a default constructor to your class and create a function to set/change the parameters.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
I have a script composed of two scripts: PanelDialog.mqh and TradeManager.mq5.
I'm trying to access the function CheckAndCancelOrders(); , which is inside a class that, in theory, should be fully public, so I should be able to access it. However, there's no way to make it work.
Basically, when I press a button, I send an order (all of this happens in PanelDialog.mqh), and up to this point, everything is fine. But then, I want to check whether the order is still open or has been stopped.
To do this, I created a function inside the class COrderExecutor , called CheckAndCancelOrders(); , but I can't call it in any way.
Could someone give me some guidance?
Thanks!
PanelDialog.mqh
TradeManager.mq5
my error