Dear Mr. Rosh, Now the problem is .....

 

May be using iCustom() has some problem ,The data EA get from the indicator are different with the data calculating by the indicator itself.

We know Mt4 have a series famous three articles to explain how to use iCustom(), the hard nut.

But I found some thing wrong happened with Transferring an Indicator Code into an Expert Advisor Code

In those articles,the writor give the classical example:

An EA "ASCTrend1RAVI_Expert.mq4" communicates with an Indicator "RAVI. mq4"

I do something to show you the wrong facts.

For this, I adding some Filewrite instruction at Ravi.mq4 to record the the buffer's value

And simplify the ASCTrend1RAVI_Expert.mq4 to TEST.mq4

The TEST.mq4 only get data once from RAVI.mq4,so we can compare with the data in the buffers of RAVI.mq4

I give you the results and the mq4s

附加的文件:
ravi.mq4  4 kb
test.mq4  1 kb
 
There is mistype in your code. This is properly code in Expert Advisor (EA) code:

RAVI_Up[bar-1] = iCustom(NULL, RAVI_Timeframe,"RAVI", Period1_Up,Period2_Up, MA_Metod_Up, PRICE_Up, 0, bar-1);
附加的文件:
test_1.mq4  2 kb
ravi_2.mq4  4 kb
 

Dear Mr.Rosh

You are an intelligentest man in Russia may be in the world !!!

You so quickly found the bug and fixed it !

Thank you very very much !

The mistake came from Mr. Nikolay Kositsin

I copyed the code from his program exactly.

So Mr. Nikolay Kositsin may pay us for drinking vodka a lot when I come to Russia