Questions from Beginners MQL5 MT5 MetaTrader 5 - page 509
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
What's wrong with a trailing stop? It's already built into the terminal.
Kind people help with compiling EA very please, I'm not good at programming.
This is the error I get when compiling 'delete' - name expected
void delete(int type){
if(OrdersTotal()>0){
for(i=OrdersTotal()-1;i>=0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(type!=6 && type!=7 && type!=8)if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==type)OrderDelete(OrderTicket();
if(type==6)if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP || OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT)OrderDelete(OrderTicket());
if(type==7)if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUYSTOP || OrderType()==OP_BUYLIMIT)OrderDelete(OrderTicket());
if(type==8)if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELLSTOP || OrderType()==OP_SELLLIMIT)OrderDelete(OrderTicket());
}
}
}
Here's another error '(' - object pointer expected
if(oppositedelete){delete(OP_SELLSTOP);delete(OP_SELLLIMIT);}
And here '}' - not all control paths return a value
int countglobal(){
int cnt=0;
if(OrdersTotal()>0){
for(i=OrdersTotal()-1;i>=0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
cnt++;
}
return(cnt);
}
}
Kind people help with compiling EA very please, I'm not good at programming.
This is the error I get when compiling 'delete' - name expected
void delete(int type){.
..............
It says it cannot be called that way. You should call the function by some other name.
and this "not all control paths return a value" about the function having no return path and returning no value, write return(0); before the last "}" of the function
Good afternoon to all) Share the code for a mobile stop loss - to drive the price )))) Thanks in advance
Hi all! Downloaded MT4, strategy tester has only been working since December 2015, who knows how to patch the terminal?
Hello, everyone!
Could you please tell me how to implement in EA the possibility to check if input variable is in range or not. For example:
a) More than 10, but less than 20
b) More than 20 or less than 10
c) etc.
ZS: so far we have 3 values to check each variable: case for switch (greater than/less than/more than, but less than/less than or greater than) and 2 values. I guess you could loop this construction and go through all the variables... Is this the right direction?
Hello, everyone!
Could you please tell me how to implement in EA the possibility to check if input variable is in range or not, in a simpler and more correct way. For example:
a) More than 10, but less than 20
b) More than 20 or less than 10
c) etc.
ZS: so far we have 3 values to check each variable: case for switch (greater than/less than/more than, but less than/less than or greater than) and 2 values. I guess you could loop this construction and go through all the variables... Is this the right direction?