invalid integer number as parameter 2 for iSeries function

 

Hello there every1.

I'm working on an EA. I am trying to use the zigzag and moving average indicators while i get this error.

2011.10.14 11:53:59 Master EURUSD,M1: invalid integer number as parameter 2 for iSeries function

I have checked the perimeters for the ZigZag as well as the Moving Averages and they seem to be integers, and fine. The strategy gives error randomly. That is, i use the same ZigZag and MA combo 4 times. Sometimes it works 3 times and then starts giving this error on the 4th run and sometimes right on the first try it starts filling up the logs.

P.S: Have a snippet of the log attached too

Can any1 please help me out. Anticipating a helpful response from the community.

Thanx,

Master

Files:
log.txt  23 kb
 
Master.Aurora:


Can any1 please help me out. Anticipating a helpful response from the community.

It's going to be a little difficult without seeing your code, for example, what is iSeries ?
 

Here's the code snippet which i am using for the zigzag indicator:

double custZigZag(int TF)
  {
      double value_ZigZag = iCustom(NULL, TF, "ZigZag", ZZ_Depth, ZZ_Deviation, ZZ_Backstep, 0, 0);
      Print("ZigZag is: " + value_ZigZag );
      return(value_ZigZag);
  }

Here TF = Timeframe enumeration value

And i really have no idea what iSeries means. There's nothing about it in the documentation, and nothing on the web too :(

 
What are you passing to custZigZag ? is it a string or an int you are passing ?
 
RaptorUK:
What are you passing to custZigZag ? is it a string or an int you are passing ?

Passing the integer value of the timeframe enumeration
 
What about any iHigh, iOpen, etc calls, are you passing string period values to any of these ? for example are you using any of these variable in place of int timeframe, T1="M1"; T2="M30"; T3="H4"; T4="D1" ?
 
What is the VALUE of the int? Must be one of 1, 5, 15, 30, 60, 240, 1440, 10080, 43200 (PERIOD_M1 .. PERIOD_MN1)
 
double custZigZag(int TF)
  {
      double value_ZigZag = iCustom(NULL, TF<----(1,5,15,...,10080,.), "ZigZag", ZZ_Depth, ZZ_Deviation, ZZ_Backstep, 0, 0); 
      Print("ZigZag is: " + value_ZigZag );
      return(value_ZigZag); <------------------ may not return any high/low, if there is no zig or zag "poking" the bar
  }

 
RaptorUK:
What about any iHigh, iOpen, etc calls, are you passing string period values to any of these ? for example are you using any of these variable in place of int timeframe, T1="M1"; T2="M30"; T3="H4"; T4="D1" ?

Thanx a bundle Raptor. Your tip about the iHigh solved my issue I was using it it with a string as parameter.
 
diostar:


Hello dioster. Mate can you please shed some light on the operation of the ZigZag indicator? I'm not familier with its functionality and so need some insight on it so that i can test my code understandably.

Thanx and Regards,

Master

 
Master.Aurora:


Hello dioster. Mate can you please shed some light on the operation of the ZigZag indicator? I'm not familier with its functionality and so need some insight on it so that i can test my code understandably.

Thanx and Regards,

Master

Hello Master. & sure mate.

here are my own codes for zz. just a short piece of function.

//+------------------------------------------------------------------+
int intelZigZag(string ins, int p){
//+------------------------------------------------------------------+

   int sig=-1;  
   
   for(int a=0;a<iBars(ins,p);a++){
      double v=iCustom(ins,p,"ZigZag",12,5,3,0,a);      
      if(v>0){  <---------------------------------------------- if the most recent zz is "poking" some bar i.e. has a price value, then
         double z=iCustom(ins,p,"ZigZag",12,5,3,1,a); <------- this is the High buffer (its poking from the bottom to its top)
         if(z==v)sig=0;else sig=1; <---- if the value equals high buffer,then sig=0 or else sig=1,(i.e it poking from up to the bottom)     
         break; <---- get out of the looping bars 
      }  
   }
   return(sig);
}