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'd like to know an Expert Advisor like this... it opens 2 different pending orders and closes the rest when one of them triggers...
there used to be a code base double pending 2 called ... now there is no ...
what he means is that he has all the operations on all the orders mixed up in one loop, with one iteration significantly affecting the result of the other, and he can't understand why it all doesn't work.
So we have to separate the cutlets from the flies first... I didn't think of such chaos :-)
I'd like to know an Expert Advisor like this... it opens 2 different pending orders and closes the rest when one of them triggers...
there was a pending 2 in the code was called ... not anymore ...
loop through the open orders by OrderType() and set the counter:
int count=0;
if(OrderType()<2) count++;
if(count==0)
{ here is a selector - as soon as you come across OrderType()>1 - delete it: OrderDelete(.....); if deletion is successful (see documentation), set active: OrderSend(...); } Elementary, Watson!
I got you a little wrong: if(OrdersTotal()==0) {place 2 pending orders} and then check with the order type selector : once you've found one <2, look for the second >2 and delete it
Here is a loop to check the state of the orders, after that do checks and closes and modifications, after each action return operator to make the loop update the state of the orders
ok... i figured you won't be much help... it's useless to give advice until i see it anyway... i'll look for a similar one ( it doesn't work with this check loop either... all is the same... and even with several loops per operation...)
You've become lazy... write a function (or two, if you don't know how) that returns the number of orders in the market (history) according to the given parameters: symbol, magician, order type, i.e., in any combinations...
then on every tick (or other time frame where the EA starts) you define the number of orders in the market and pending orders and using their combinations perform the following actions
market == 0 and pending orders == 0
market == 0 and pending orders == 2 do nothing
market == 1 and pending orders == 1 delete a pending order
market == 1 and pauses == 0 bait
i can't believe it's so hard to do ...
sorry. it's time to forget about procedural programming - use functions...
a variable saves the last value, it's ridiculous...
THERE IS NO PROBLEM IN THE HISTORY BUT HOW DO I KNOW IF IT'S OPEN OR NOT? IF THE SELECTOR KEEPS THE LAST VALUE UNTIL IT IS RESTARTED...
IT'S BUTTERY.
THERE IS NO PROBLEM IN THE HISTORY BUT HOW DO I KNOW IF IT'S OPEN OR NOT? IF THE SELECTOR KEEPS THE LAST VALUE UNTIL IT IS RESTARTED...