Download MetaTrader 5

iCustom - How to retrieve a value from indicator?

To add comments, please log in or register
Do you want to become a well-known developer? Execute the orders of traders in the Freelance service!
jeannie
36
jeannie 2016.02.16 07:59 

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
30745
Alain Verleyen 2016.02.16 08:56  

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
18554
Vasyl Nosal 2016.02.16 11:07  
"testvalue"
testvalue
jeannie
36
jeannie 2016.02.17 07:03  
Alain Verleyen:

Thank you, will do next time.
jeannie
36
jeannie 2016.02.17 07:05  
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
18554
Vasyl Nosal 2016.02.17 10:24  
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