iCustom

1
Please mladen im trying to call this indicator with iCustom and dont work. Whats wrong? Thanks in advance.

Code: Select all

double 3CTURBO(int i)
{
  double S1 = iCustom(Symbol(),0,"3c_Turbo",2,i)!=EMPTY_VALUE;
  double S2 = iCustom(Symbol(),0,"3c_Turbo",1,i)!=EMPTY_VALUE; 
  
  if(S1)
  {
  return(1);
  }
  if(S2)
  {
  return(-1);
  }
 
 return(0);
}


bool Arrowup(int i)
{
          bool up=false;
       
          up = 3CTURBO(i)==1;
         
          if(up)
          {
          return true;
          }
          return false;
          
}
bool Arrowdn(int i)
{
          bool dn=false;
          
          dn = 3CTURBO(i)==-1;
 
          if(dn)
          {
          return true;
          }
          return false;
}


Re: iCustom

2
Cladi39 wrote: Wed May 10, 2017 12:25 pm Please mladen im trying to call this indicator with iCustom and dont work. Whats wrong? Thanks in advance.

Code: Select all

double 3CTURBO(int i)
{
  double S1 = iCustom(Symbol(),0,"3c_Turbo",2,i)!=EMPTY_VALUE;
  double S2 = iCustom(Symbol(),0,"3c_Turbo",1,i)!=EMPTY_VALUE; 
  
  if(S1)
  {
  return(1);
  }
  if(S2)
  {
  return(-1);
  }
 
 return(0);
}


bool Arrowup(int i)
{
          bool up=false;
       
          up = 3CTURBO(i)==1;
         
          if(up)
          {
          return true;
          }
          return false;
          
}
bool Arrowdn(int i)
{
          bool dn=false;
          
          dn = 3CTURBO(i)==-1;
 
          if(dn)
          {
          return true;
          }
          return false;
}
You can not start the function/variable name with a number
Try like this :

Code: Select all

double _3CTURBO(int i)
{
  double S1 = iCustom(Symbol(),0,"3c_Turbo",2,i)!=EMPTY_VALUE;
  double S2 = iCustom(Symbol(),0,"3c_Turbo",1,i)!=EMPTY_VALUE; 
  
  if(S1)
  {
  return(1);
  }
  if(S2)
  {
  return(-1);
  }
 
 return(0);
}


bool Arrowup(int i)
{
          bool up=false;
       
          up = _3CTURBO(i)==1;
         
          if(up)
          {
          return true;
          }
          return false;
          
}
bool Arrowdn(int i)
{
          bool dn=false;
          
          dn = _3CTURBO(i)==-1;
 
          if(dn)
          {
          return true;
          }
          return false;
}
And it will work (tested and it works OK)

Re: iCustom

3
mladen wrote: Wed May 10, 2017 6:00 pm You can not start the function/variable name with a number
Try like this :

Code: Select all

double _3CTURBO(int i)
{
  double S1 = iCustom(Symbol(),0,"3c_Turbo",2,i)!=EMPTY_VALUE;
  double S2 = iCustom(Symbol(),0,"3c_Turbo",1,i)!=EMPTY_VALUE; 
  
  if(S1)
  {
  return(1);
  }
  if(S2)
  {
  return(-1);
  }
 
 return(0);
}


bool Arrowup(int i)
{
          bool up=false;
       
          up = _3CTURBO(i)==1;
         
          if(up)
          {
          return true;
          }
          return false;
          
}
bool Arrowdn(int i)
{
          bool dn=false;
          
          dn = _3CTURBO(i)==-1;
 
          if(dn)
          {
          return true;
          }
          return false;
}
And it will work (tested and it works OK)
Thanks soo much mladen, work perfect, your teach is very apreciated.


Who is online

Users browsing this forum: No registered users and 10 guests