Help To fix error 'OrderSend' - some operator expected robot.mq5 91 3

 

Hi

im create this code but error  'OrderSend' - some operator expected    robot.mq5    91    3

please help me to fix this code Tnx :)

int rsihandle;
double rsiarray[];
int rsiPeroid=21;

int rsiBuystart=30;
int rsiBuyEnd=40;

int rsiSellstart=70;
int rsisellend=75;



//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   rsihandle=iRSI(_Symbol,_Period,rsiPeroid,PRICE_CLOSE);
  if(rsihandle<0){
  Alert("Error in Calc RsI",GetLastError());
  
  }
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   IndicatorRelease(rsihandle);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  MqlTick Tick;
  MqlRates Rates[];
  MqlTradeRequest TradeRequset;
  MqlTradeResult TradeResult;
  
  CopyRates(_Symbol,_Period,0,2,Rates);
  CopyBuffer(rsihandle,0,0,1,rsiarray);
  
  ArraySetAsSeries(Rates,1);
  ArraySetAsSeries(rsiarray,1);
  
  SymbolInfoTick(_Symbol,Tick);
  
  if(rsiarray[0]>rsiBuystart && rsiarray[0]<rsiBuyEnd){
 
  TradeRequset.action=TRADE_ACTION_DEAL;
  TradeRequset.price=Tick.ask;
  TradeRequset.symbol=_Symbol;
  TradeRequset.volume=10000;
  TradeRequset.magic=12345;
  TradeRequset.type=ORDER_TYPE_BUY;
  TradeRequset.type_filling=SYMBOL_FILLING_IOC;
  
  OrderSend(TradeRequset,TradeResult);
  if(TradeResult.retcode==1009 || TradeResult.retcode==1008){
   Print("orderBuy");  
  }
   else{
     Print(" cancel to order",TradeResult.retcode);   
  }
  }
  
  if(rsiarray[0]>rsiSellstart && rsiarray[0]<rsisellend){
      TradeRequset.action=TRADE_ACTION_DEAL;
      TradeRequset.price=Tick.bid;
      TradeRequset.symbol=_Symbol;
         TradeRequset.volume=10000;
         TradeRequset.magic=12345;
         TradeRequset.type=ORDER_TYPE_SELL;
         TradeRequset.type_filling=SYMBOL_FILLING_IOC
  OrderSend(TradeRequset,TradeResult);
   
     if(TradeResult.retcode==1009 || TradeResult.retcode==1008){
   Print("OrderSelled");  
  }
   else{
     Print("cancel to order",TradeResult.retcode);   
  }
  }
   
  }
  
//+------------------------------------------------------------------+
 
seyed yasin:

Hi

im create this code but error  'OrderSend' - some operator expected    robot.mq5    91    3

please help me to fix this code Tnx :)

Do you know how to code in MQL5?

Would you bet all your money on this EA? Blindly?

 
Oke i test to help u to start u on to trader. 
 
seyed yasin: im create this code but error  'OrderSend' - some operator expected    robot.mq5    91    3
         TradeRequset.type=ORDER_TYPE_SELL;
         TradeRequset.type_filling=SYMBOL_FILLING_IOC OrderSend(TradeRequset,TradeResult);

Does that look correct to you?

 
Flavio Jarabeck #:

Do you know how to code in MQL5?

Would you bet all your money on this EA? Blindly?

why ?

im just for testing code my dear

 
William Roeder #:

Does that look correct to you?

tnx

find it