[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 397
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
Yes, if you set it as x=0, it will go to zero if you just set it as x:, it won't go to zero, it will go up.
This is the right way to go!!!!!
I'm sure it'll reset. Thank you all, it's a bit hilarious.
Guys a more complicated question......
How to make an EA close all orders when a given profit is reached .... Close only orders on one symbol ...
Example : EA works on 3 pairs amount to close all orders on one symbol 100p ...
If the EUR has more than 100p it will only close orders on EUR while others may have 200p ...
If I take accountbalanse(), then EA will close only when the sum of three pairs is more than 100p. This option does not work for me !!!!
Help please.........
Probably with
Please advise what is wrong in the code. The robot is supposed to close a sell order, if it is not there, it should buy. Error 4105 appears, which I try to handle, but there is no result. Maybe there are other ways to process it?
PRICECURRENTPPROFIT is the buy level.
// ROBOT SELLS
// determine if there are sell orders
if (Bid>=PRICECURRENTPPROFIT && PRICECURRENTMPROFIT>0)
{
for(cnt=OrdersTotal();cnt>=0;cnt--)
{OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); mode = OrderType(); if(OrderSymbol() == "EURUSD")
{if(mode == OP_BUY)
{go=OrderClose(OrderTicket(), Lots, Bid, slippage, Green);
}
}
} // if open, close
} if(go != true) {Print("Failed to open SELL order. Error N", GetLastError());
switch(GetLastError()) {case 4105: OrderSend("EURUSD",OP_SELL,Lots,Bid,2*Point,0,0, "robot sells",MagicNumber,0,Red);break;}
}
I want to add some functions to it to make it open for buy and sell but for sell and buy need a separate magicnumber
If a Take Profit order triggers, the robot closes all pending orders. I want it to close all pending orders OP_SELLLIMIT and leave them unchanged OP_BUYLIMIT, OP_BUY
I put in your code, it doesn't compile. What is the error, I can't understand. But most importantly, I still asked, there must be some kind of logical error, orders are opened on every tick, most likely this part is not working, and I can't understand it either?