icustom issue

 

Heys guys plz can some one help me as  my ea compiles perfect but does not take a trade when i set these values for the indicator.

 but if i change it to if (arrowup > 0.0001) then takes trade like crazy so i know the buy and sell fuction work.

please if any one can help. 

double arrowup=iCustom(NULL,0,"BB60SEC",0,1);
double arrowdown=iCustom(NULL,0,"BB60SEC",1,1);
 
 
  if(arrowup!=2147483647)

  {
       BuyOrder();
       return;
      
  } 

  if(arrowdown!=2147483647)

 { 
       SellOrder();
       return;
      
 } 
Files:
BB60SEC.ex4  9 kb
 
byron88:

Heys guys plz can some one help me as  my ea compiles perfect but does not take a trade when i set these values for the indicator.

 but if i change it to if (arrowup > 0.0001) then takes trade like crazy so i know the buy and sell fuction work.

please if any one can help. 

provide code where you set values. by the way this code works?
 

This ugly number you have in your code has pretty name in MQL - EMPTY_VALUE. It is default value used for "no value in the buffer at this point"

This code goes through last 100 candles and prints value of up/down arrow if indicator value is not equal to EMPTY_VALUE:

   for(int i = 0; i < 100; i++)
   {
      double arrowup=iCustom(NULL,0,"BB60SEC",0,i);
      double arrowdown=iCustom(NULL,0,"BB60SEC",1,i);
      string out = "";
      if(arrowup != EMPTY_VALUE)
         out += StringFormat(" UP: %f", arrowup);
      if(arrowdown != EMPTY_VALUE)
         out += StringFormat(" DOWN: %f", arrowdown);         
      if(StringLen(out) > 0)
         Print(out);         
   }  

Your code will call SellOrder() function if there is an down arrow on the chart.

You should inspect SellOrder() function for bugs. Do you have error checking when you call OrderSend()

 
Drazen Penic:

This ugly number you have in your code has pretty name in MQL - EMPTY_VALUE. It is default value used for "no value in the buffer at this point"

This code goes through last 100 candles and prints value of up/down arrow if indicator value is not equal to EMPTY_VALUE:

Your code will call SellOrder() function if there is an down arrow on the chart.

You should inspect SellOrder() function for bugs. Do you have error checking when you call OrderSend()

do you think is a good idea check indicator arrow on current bar buddy?
 
Aleksei Beliakov:
do you think is a good idea check indicator arrow on current bar buddy?
What do you mean with this question? Who is checking indicator on current bar?