help: No output in the indicator window.

 
The indicator contained in the attached file produces no output.

But if I changethe following code

diff[i]=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);

to

diff[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
then I can see the output. May I know what's the problem with my code?
Hopefully i have clearly explained my problem(There are also some comments in the source code file attached...). Would you please kindly tell me what is wrong with my code? Thanks a lot for your time and consideration.
 
tzm:
The indicator contained in the attached file produces no output.

But if I changethe following code

to

then I can see the output. May I know what's the problem with my code?
Hopefully i have clearly explained my problem(There are also some comments in the source code file attached...). Would you please kindly tell me what is wrong with my code? Thanks a lot for your time and consideration.

In the first line you are always getting the value for bar 0, in the second you are getting it for bar i . . . do you see the problem ? if you had used a more descriptive variable name than i you might have seen this issue earlier . . . . what is i meant to represent ?
 
Dear Raptor, The problem has beend successfully solved. I cannot be moresatisfied. Many thanks for your prompt and effective reply!
Reason: