Indicator Will Not Display Array Numbers.

 

Can someone help me? I have put together an indicator that uses various arrays. I have confirmed that my arrays are populated. But when I try to display my final array elements, I do not get anything? Can someone help me with the arraycopy function? This is where the problem resides.

 
mcertini:
Can someone help me? I have put together an indicator that uses various arrays. I have confirmed that my arrays are populated. But when I try to display my final array elements, I do not get anything? Can someone help me with the arraycopy function? This is where the problem resides.

Tried to explain this before, you can elimiate the need for the arraycopy() function if you just place the data directly into the end buffer as in;

// instead of

Indicator[ i ] = FastMA[ i ] / SlowMA[ i ];

// use

Buf_0[ i ] = FastMA[ i ] / SlowMA[ i ];

there are other errors in your code as well as theres a problem with the MQ arraycopy function as it cannot transfer data between series arrays.

I will posts a rewrite of your code in an hour or so.

Keit

 
mcertini:
Can someone help me? I have put together an indicator that uses various arrays. I have confirmed that my arrays are populated. But when I try to display my final array elements, I do not get anything? Can someone help me with the arraycopy function? This is where the problem resides.

the size of the arrays is wrong if you have more than 500 bars

 

Array Problem.

Cockeyedcowboy,

Thank you for your explanation. I will go directly to the indicator line instead of to another array.

 

Array Problem Continues.

Cockeyedcowboy,

I tried your initial solution but it did not work. I have tried my previous solution and get a wierd number for the first element in my array. I have attached a printscreen of the alert results. I have also included my program.

Files:
 

Array Problems Continue.

cockeyedcowboy,

I made the change you initially recommended. Though this does not work. After looking into the array, I note that there is an unusual number in the first position of my indicator array. I do not know how this number is getting into this position. Attached is a printscreen of an alert with the number. I have also attached my program.

Files:
 

Array Solution.

cockeyedcowboy,

I finally found the array problem. The below code did not an appropriate shift in the formula. I have now changed this so that it reflects "i".

FastMA[ i ] = iMAOnArray( vol, 0, 14, 0, MODE_SMA, i );

SlowMA[ i ] = iMAOnArray( vol, 0, 21, 0, MODE_SMA, i );

Thank you for your help.

 

your right I over look that too

 

mcertini

I kind of got carried away . The attached code should do what you want, I have not run it they may be some errors. Let me know if there are I will fix them.

Keit

 
mcertini:
cockeyedcowboy, I made the change you initially recommended. Though this does not work. After looking into the array, I note that there is an unusual number in the first position of my indicator array. I do not know how this number is getting into this position. Attached is a printscreen of an alert with the number. I have also attached my program.

mcertini

There are other errors in your code that needed to be corrected as well as changing one line of code.

compair this code with yours to see the other changes that are made and try to find out were your mistakes are.

and please if your asking people to look at your code add plenty of white space so it is more easily readable, it does not cost anything.

Keit

Reason: