Download MetaTrader 5

iCustom - How to retrieve a value from indicator?

To add comments, please log in or register
jeannie
36
jeannie  

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 

Alain Verleyen
Moderator
29908
Alain Verleyen  

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.


Vasyl Nosal
16659
Vasyl Nosal  
"testvalue"
testvalue
jeannie
36
jeannie  
Alain Verleyen:

Thank you, will do next time.
jeannie
36
jeannie  
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 

Vasyl Nosal
16659
Vasyl Nosal  
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
To add comments, please log in or register