sllawa3: BUT THE QUESTION STILL REMAINS... HOW TO GET AROUND THE SELECT ERROR... IT'S JUST AN EXPERT WITH AN ARRAY... YOU CAN'T ALWAYS FOLLOW THIS PATTERN...
instead of arrays we could use a lot of variables. There is no error in the "Select". The difference in Expert Advisors is that the order evaluation block is independent of the rest of the program. The modification does not depend on deletion either, while in your case everything is in one place. To write everything together, you have to be very experienced, and you have just made a mistake somewhere, it would be easier to write a new EA than to deal with that mess.
In short, if you don't zero the variables, they are not zeroed anywhere else, and nothing in your original version works. If you zero them out at the end, then the EA works, but you have a line, for example, if(OrderType() == OP_BUYSTOP&DB==1){OrderDelete(OrderTicket(),CLR_NONE);return(0);}
And nothing works, because a limit order can go first and the market order only after it, and this condition will never be met and the pending order will not be deleted. So, your Expert Advisor only works when the order sequence in the terminal is in accordance with the algorithm, as you have understood it rarely happens in 11 years 90 deals have been opened, I checked it. So the conclusion is the wrong structure of the programme, or rather the total dependence of one iteration on another during the overshoot.
sllawa3: WELL, THERE'S OBVIOUSLY SOMETHING WRONG... SO I'VE BEEN LOOKING FOR IT...
so I wrote you the error above. The structure of the program is not correct, that is, it is not in one symbol error, but in 70% of the whole program error.
YOU ALSO HAVE A BUG IN YOUR CODE... IT DOES NOT MODIFY BUY POSITIONS, SO IF A BUY STOP TRIGGERED, THE ORDER IS PLACED WITHOUT A STOP AND TAKEAWAY AND OTHERS ARE NOT OPENED
YOU ALSO HAVE A BUG IN YOUR CODE... IT DOES NOT MODIFY BUY POSITIONS, SO IF A BUY STOP TRIGGERED, THE ORDER IS PLACED WITHOUT A STOP AND TAKEAWAY AND OTHERS ARE NOT OPENED
NO DATA DB[2]==0 DB[3]==0 ALSO
Slava, your problem is that you don't accept new ideas... You've been given a different approach, but you expect a ready solution...
It's up to you to decide how to deal with possible problems with orders - requotes, incorrect prices and so on...
Techno: Yeah, I fixed it myself, I just forgot to put in the uploaded file.
I decided to rewrite all my EAs using an array... i am thinking how to add 2 more variables - order lot and order profit and 2 orders for bylimit and selligit
into the order lookup table
are there any limitations on the number of variables horizontally and vertically ? and variables before the start [4] is it the number of orders or the number of variables in each order ?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
No way, it's the same thing, a completely different expert. Use mine, fill in the missing details
I DON'T MEAN THE ORIGINAL ONE, I MEAN THE ONE I GLUED TOGETHER FROM YOUR PARTS... BUT THANKS A LOT FOR THE LESSON WITH THE ARRAY !
BUT THE QUESTION STILL REMAINS... HOW TO GET AROUND THE SELECT ERROR... IT'S JUST AN EXPERT WITH AN ARRAY... YOU CAN'T ALWAYS FOLLOW THIS PATTERN...
In short, if you don't zero the variables, they are not zeroed anywhere else, and nothing in your original version works. If you zero them out at the end, then the EA works, but you have a line, for example, if(OrderType() == OP_BUYSTOP&DB==1){OrderDelete(OrderTicket(),CLR_NONE);return(0);}
And nothing works, because a limit order can go first and the market order only after it, and this condition will never be met and the pending order will not be deleted. So, your Expert Advisor only works when the order sequence in the terminal is in accordance with the algorithm, as you have understood it rarely happens in 11 years 90 deals have been opened, I checked it. So the conclusion is the wrong structure of the programme, or rather the total dependence of one iteration on another during the overshoot.
WELL, THERE'S OBVIOUSLY SOMETHING WRONG... SO I'VE BEEN LOOKING FOR IT...
YOU ALSO HAVE A BUG IN YOUR CODE... IT DOES NOT MODIFY BUY POSITIONS, SO IF A BUY STOP TRIGGERED, THE ORDER IS PLACED WITHOUT A STOP AND TAKEAWAY AND OTHERS ARE NOT OPENED
NO DATA DB[2]==0 DB[3]==0 ALSO
YOU ALSO HAVE A BUG IN YOUR CODE... IT DOES NOT MODIFY BUY POSITIONS, SO IF A BUY STOP TRIGGERED, THE ORDER IS PLACED WITHOUT A STOP AND TAKEAWAY AND OTHERS ARE NOT OPENED
NO DATA DB[2]==0 DB[3]==0 ALSO
Slava, your problem is that you don't accept new ideas... You've been given a different approach, but you expect a ready solution...
It's up to you to decide how to deal with possible problems with orders - requotes, incorrect prices and so on...
Yeah, I fixed it myself, I just forgot to put
in the uploaded file.
I decided to rewrite all my EAs using an array... i am thinking how to add 2 more variables - order lot and order profit and 2 orders for bylimit and selligit
into the order lookup table
are there any limitations on the number of variables horizontally and vertically ? and variables before the start [4] is it the number of orders or the number of variables in each order ?