iCustom - How to retrieve a value from indicator?

 

Hi All,

I am new in meta trader and trying to code using iCustom.

I also tried to read a number of articles, forum and even meta trader definition of iCustom and still clueless. So, I need your help.

This is my simple indicator script:

 

#property  copyright "Jeannnie"

int init()

  {

   return(0);

  }


int start()

{

int testvalue;

testvalue = 123;


testvalue = iCustom(NULL, 0, 

Alert(testvalue);           

//---- done

   return(0);

 } 

 

I am trying to get the testvalue from indicator to pass it to EA.

Below is my EA and still can't get the value 123 from my indicator.

 

#property copyright "Jeannie"

//---- indicator buffers

double   test01;

int start()

{


test01=  iCustom(NULL, 0, "Test", "testvalue", 1,1);


Alert(test01);


//---- done

   return(0);

 

But, I am still not getting the value 123 from indicator.

Any advice is appreciated!

 

Many Thanks,

Jeannie 

 

Forum on trading, automated trading systems and testing trading strategies

Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.


 
"testvalue"
testvalue
 
Alain Verleyen:

Thank you, will do next time.
 
Vasyl Nosal:

Hi Vasyl,

 

Do you mean enter the icustom as per below:

 

test01=  iCustom(NULL, 0, "Test", testvalue, 1,1);

 instead of

 

test01=  iCustom(NULL, 0, "Test", "testvalue", 1,1);

 I tried this before posting the forum, but it doesn't works.

 

Thanks,

Jeannie 

 
jeannie:

Hi Vasyl,

 

Do you mean enter the icustom as per below:

 

 instead of

 

 I tried this before posting the forum, but it doesn't works.

 

Thanks,

Jeannie 

yes
Reason: