View Single Post
  #1 (permalink)  
Old 09-08-2006, 07:08 AM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Script don't work - need help

Hi,

I am tring to run the following script on MT4 (build 196) and I get an error msg - "Invalid trade parameters".

Code:
//+------------------------------------------------------------------+
//| script "send pending order with expiration data"                 |
//+------------------------------------------------------------------+
int start()
  {
   int    ticket,expiration;
   double point;
//----
   point=MarketInfo(Symbol(),MODE_POINT);
   expiration=CurTime()+PERIOD_M1*5;
//----
   while(true)
     {
      ticket=OrderSend(Symbol(),OP_SELLSTOP,1,Bid-20*point,3,Bid-10*point,0,"some comment",1234,expiration,Green);
      if(ticket<=0) Print("Error = ",ErrorDescription(GetLastError()));
      else { Print("ticket = ",ticket); break; }
      //---- 10 seconds wait
      Sleep(10000);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+
I don't understand the problem .
Can someone help ?
10X !
Reply With Quote