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
I didn't ask anyone in particular.
But you must have been right to take it personally.
I can't call you a fool, but you are deaf, that's for sure.
You do not hear others. I'm not talking about my remarks, but about the advice you've been given.
Have you ever written interoperable programs?
What Ant_TL asks is "interoperability", but it cannot be implemented in MQL.
Have you ever written an interoperable program?
What Ant_TL is asking about is "interoperability", but it's not feasible in MQL.
It's not hard to implement. And there is a solution in principle. Too lazy to read further
It is not difficult to implement. And there is a solution. Too lazy to read further
You will not be able to execute operations with orders and make sure the environment is not affected.
It has already been said about GetLastError(), you will not be able to restore the code that should be returnedby function GetLastError().
You will not be able to execute operations with orders and be sure that the environment will not be affected.
It has already been said about GetLastError(), you will not be able to recover the code that the GetLastError() function should have returned.
You can if you want, it will just have its own function ( I meanGetLastError())
This may look like a solution - OrderSelect() - MySelect() wrapper for use in functions that search for orders by index
int last_select=0; // put it somewhere before init and start
// ...... program code
bool MySelect(int i,int mode=MODE_TRADES){ // order selection - returns True if the order is selected and belongs to the EA, False otherwise
if(OrderSelect(i,SELECT_BY_POS,mode)){
last_select=OrderTicket();
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
return(true);
else
return(false);
}
return(false);
}
bool TickSelect(int tick){ // Order selection directly by tick
if(OrderSelect(tick,SELECT_BY_TICKET))
last_select=tick;
else
return(false);
return(true);
}
void SomeFunc(){ // A function template that can break the order selection and therefore break the program logic, if the current order selection is not taken care of
int tick=last_select;
// ... perform required actions
if(tick>0)
TickSelect(tick);
}
It cannot, unless you change this state yourself in the program.
It is assumed that the order state has changed from MODE_TRADES to MODE_HISTORY. And your Expert Advisor has not done anything with the order. Is it the same order or is it different?
It was assumed that the order status changed from MODE_TRADES to MODE_HISTORY. And your EA has not done anything with the order. Is it the same order or is it different?
It is the same order
This may look like a solution - OrderSelect() - MySelect() wrapper for use in functions that search for orders by index
int last_select=0; // put it somewhere before init and start
// ...... program code
bool MySelect(int i,int mode=MODE_TRADES){ // Selection of the order we need - returns True if the order has been selected and belongs to the Expert Advisor; otherwise, False
if(OrderSelect(i,SELECT_BY_POS,mode)){
last_select=OrderTicket();
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
return(true);
else
return(false);
}
return(false);
}
bool TickSelect(int tick){ // Order selection directly by tick
if(OrderSelect(tick,SELECT_BY_TICKET))
last_select=tick;
else
return(false);
return(true);
}
void SomeFunc(){ // A function template that can break the order selection and hence break the program logic, if the current order selection is not taken care of
int tick=last_select;
// ... perform the required action
if(tick>0)
TickSelect(tick);
}