Delete Order
  #1 (permalink)  
Old 01-11-2008, 06:06 AM
Freshman
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
akhmad.hartadi is on a distinguished road
Send a message via Yahoo to akhmad.hartadi
Default Delete Order

Hi,

Why if i run the script it doesn't work?
it says : Error 4109. Is something with with the code?
PHP Code:
/+------------------------------------------------------------------+
//|                                               delete_pending.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      ""
#property show_confirm

double Slip;
bool result;
int start()
  {
  
//----

//----
   
   
for (int f 0OrdersTotal(); f++)
      {
         
OrderSelect(f,SELECT_BY_POSMODE_TRADES);
         switch (
OrderType())
            {
               case 
OP_BUY result OrderClose(OrderTicket(), OrderLots(), Bid3);
               case 
OP_SELL result OrderClose(OrderTicket(), OrderLots(), Ask3);
                        
               case 
OP_BUYLIMIT  result OrderDelete(OrderTicket());
               case 
OP_BUYSTOP   result OrderDelete(OrderTicket());
               case 
OP_SELLLIMIT result OrderDelete(OrderTicket());
               case 
OP_SELLSTOP  result OrderDelete(OrderTicket());
                        
            }
      }

   if(
result == false)
      {
         
Alert("Order " OrderTicket() , " failed to close. Error:" GetLastError() );
         
Sleep(3000);
      }  
//----
   
return(0);
  }
//+------------------------------------------------------------------+ 
Attached Images
File Type: gif Error.gif (91.5 KB, 3 views)
EA Shark +1064% Return
Stock Market Crash? No Problem!
We Are Making Profits As Usual. More Info
Reply With Quote
  #2 (permalink)  
Old 01-12-2008, 06:27 AM
RebateFX.com's Avatar
Sophomore
 
Join Date: Oct 2007
Posts: 79
Thanks: 1
Thanked 3 Times in 3 Posts
RebateFX.com is on a distinguished road
Default

Error 4109 is ERR_TRADE_NOT_ALLOWED according to Expert Advisor MetaTrader Error Codes which is a site you may need to bookmark
As to why, I do not know sorry.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How not to open an order if you already have an order in the vicinity? JFonseca System Coding 1 01-13-2008 10:09 PM
Trailing pending order fx_the_lion Tools / Utilities 1 11-06-2007 08:16 AM
Multi- Trendline Order trustdoc7 Indicators 0 04-10-2007 07:26 AM
Order place EA required pgtips Indicators 2 04-02-2007 12:12 PM
Need Order script w/ built in SL wadeboxjr MetaTrader and ZeroCode 0 03-05-2007 04:45 PM


All times are GMT. The time now is 01:39 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now