HELP WHO CAN !!! - page 11

 
Techno:
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 !
 
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.

 
I KNOW THERE'S SOMETHING WRONG... I'VE BEEN LOOKING FOR IT... BUT YOUR CODE IS MUCH SHORTER... MUCH SHORTER...
 
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

NO DATA DB[2]==0 DB[3]==0 ALSO

 
figured it out... set DB[0] not > 1 a >=1....
 
Yeah, I fixed it in mine, I just forgot to put it in the uploaded file
 
sllawa3:

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 ?