Error send

Back to topics list To post a new topic, please log in or register
avatar
41
KeepMarcos 2016.03.02 18:59
 

Already many thanks for your help!


 I'm going through a hard time finding the error.

the "if" is working properly, but sometimes it does not respect the order.

int TotalOrdersCount()
  {
   int result=0;
   for(int i=0;i<OrdersTotal();i++)
     {
      int MyOrderSelect=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderMagicNumber()==MagicNumber) result++;

     }
   return (result);
   } 
 double RSI = iRSI(NULL,NULL,14,PRICE_CLOSE,0);

if(TotalOrdersCount()==0)
     {
      int result=0;
      if(RSI<25) // Here is the open buy condition
        {
         result=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss*MyPoint,0,NULL,MagicNumber,0,Blue);

 

 What erro?

 first order, the RSI is above the 70 line, is incorrect!

 the second and third order the RSI is below the 25 line. is correct!!!!

 

Very very thanks!!!! 

avatar
12985
WHRoeder 2016.03.02 19:16 #
 
  1. double RSI = iRSI(NULL,NULL,14,PRICE_CLOSE,0);
    Second argument is the period, and int. NULL is not either.
  2. What function is that code located in?

  3. Check your return codes (OrderSend and OrderSelect) Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
avatar
41
KeepMarcos 2016.03.02 19:43 #
 

hey WHRoeder.

Thanks for answer!!

 

I changed

double RSI = iRSI(Symbol(),15,14,PRICE_CLOSE,0)

 

but no work.

 :((((((

 

avatar
872
eevviill 2016.03.03 00:30 #
 
KeepMarcos:

hey WHRoeder.

Thanks for answer!!

 

I changed

 

but no work.

 :((((((

 

Screenshot?
Back to topics list  

To add comments, please log in or register