ERROR: Invalid Integer Number As Parameter

 

Hi All,

This is a quick question for all of you coding gurus out there.

Im in the process of designing anindicator. I thought it was finished and everything was good to go, and it seemed to look ok when loaded up. But then I started realizing, my 120 gig hard drive was filling up fast. After locating the biggest files on my computer, I realized they were in my log folder in the metatrader directory. One alone was for 37 gigs. Aparently, the indicator has an error that the compile ,in metaeditor, did not pick up on. And since then, every few seconds, an error comes up on the "Experts" tab, right next to the "Journal" tab on the bottum of the metatrader 4 gui. And writes it into a text log, which starts building size quickly.

The actual error is:

" ****** GBPUSD, M5: invalid integer number as parameter 5 for iMAonArray function"

I have tried to adjust a few things but cant seem to fix it. The indicator itself has always seemed to work properly, but it just seems MT4 processing is not happy.lol.

Anyone have any idea? Maybe someone ran into this similar problem before?

Thanks,

- secXces

 
secxces:
Hi All,

This is a quick question for all of you coding gurus out there.

Im in the process of designing anindicator. I thought it was finished and everything was good to go, and it seemed to look ok when loaded up. But then I started realizing, my 120 gig hard drive was filling up fast. After locating the biggest files on my computer, I realized they were in my log folder in the metatrader directory. One alone was for 37 gigs. Aparently, the indicator has an error that the compile ,in metaeditor, did not pick up on. And since then, every few seconds, an error comes up on the "Experts" tab, right next to the "Journal" tab on the bottum of the metatrader 4 gui. And writes it into a text log, which starts building size quickly.

The actual error is:

" ****** GBPUSD, M5: invalid integer number as parameter 5 for iMAonArray function"

I have tried to adjust a few things but cant seem to fix it. The indicator itself has always seemed to work properly, but it just seems MT4 processing is not happy.lol.

Anyone have any idea? Maybe someone ran into this similar problem before?

Thanks,

- secXces

Hi secXces,

Could you send the indicator (or the part you think it makes the error)?

What's the MT build version?

Thanks!

 
codersguru:
Hi secXces,

Could you send the indicator (or the part you think it makes the error)?

What's the MT build version?

Thanks!

Build 193

"MA[shift] = iMAOnArray(RSI,0,MASlow1,0,MODE_EMA,shift)

for(shift=limit-1;shift>=0;shift--)"

I think thats were the error is. Maybe not thought..lol.

 
secxces:
Hi All,

This is a quick question for all of you coding gurus out there.

Im in the process of designing anindicator. I thought it was finished and everything was good to go, and it seemed to look ok when loaded up. But then I started realizing, my 120 gig hard drive was filling up fast. After locating the biggest files on my computer, I realized they were in my log folder in the metatrader directory. One alone was for 37 gigs. Aparently, the indicator has an error that the compile ,in metaeditor, did not pick up on. And since then, every few seconds, an error comes up on the "Experts" tab, right next to the "Journal" tab on the bottum of the metatrader 4 gui. And writes it into a text log, which starts building size quickly.

The actual error is:

" ****** GBPUSD, M5: invalid integer number as parameter 5 for iMAonArray function"

I have tried to adjust a few things but cant seem to fix it. The indicator itself has always seemed to work properly, but it just seems MT4 processing is not happy.lol.

Anyone have any idea? Maybe someone ran into this similar problem before?

Thanks,

- secXces

The variable used as your 5 parameter pass to the function call should be an int type. You have declaired it to some other type variable. Check to see if the 5th parameter is not decleared as an integral type, or that it is in the limits of types used. that is an overflow on the input number. Only 0,1,2,3 are permitted.

double iMAOnArray(double array[], int total, int period, int ma_shift, int ma_method, int shift)

ConstantValueDescription

MODE_SMA 0 Simple moving average,

MODE_EMA 1 Exponential moving average,

MODE_SMMA 2 Smoothed moving average,

MODE_LWMA 3 Linear weighted moving average.

 
cockeyedcowboy:
The variable used as your 5 parameter pass to the function call should be an int type. You have declaired it to some other type variable. Check to see if the 5th parameter is not decleared as an integral type, or that it is in the limits of types used. that is an overflow on the input number. Only 0,1,2,3 are permitted.

double iMAOnArray(double array[], int total, int period, int ma_shift, int ma_method, int shift)

ConstantValueDescription

MODE_SMA 0 Simple moving average,

MODE_EMA 1 Exponential moving average,

MODE_SMMA 2 Smoothed moving average,

MODE_LWMA 3 Linear weighted moving average.

Thanks cockeyedcowboy,

It took me a while but I finally figured it out. My hats off. Thanks again, -secXces

Reason: