static bool isOpenOrders; if(!isOpenOrders){ int tic=OrderSend(Symbol(),OP_BUY,150,Ask,4,0,0,"My EA",152,0,Green); // Capture GLE before it's clobbered by the sell if(tic < 0) Alert("Error opening Buy order :",GetLastError()); int tic1=OrderSend(Symbol(),OP_SELL,1,Bid,4,0,0,"My EA",152,0,Red); // Capture gLE before it's clobbered by messagebox if(tic1 < 0) Alert("Error opening Buy order :",GetLastError()); if(tic>0) MessageBox("Buy order opened"); if(tic1>0) MessageBox("Sell order opened"); isOpenOrders = tic > 0 || tic1 > 0; }
Thank you WHRoeder for helping, really that what i want.
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
Hello
I am building simple EA for showing Error messages ans numbers as test. The following codes open 2 orders buy and sell, the buy has a big lot 150 and that is so big and when i do it manually it gives me error not enough money, but when i do it as script the error gives 0 and that means there is no error. But i am surprising why error no = 0 and not one of the number in error list and changed the lot with 1 lot and the open price with something different to see different error code but the error shows 0. I dont know the problem why it shows me 0 not any one of the error list.