Crazy or mysterious...

 

Hi,

about to despare over a non working indicator call. My EA simply won't read the values from the indicator. After a run of the strategy tester, the values are nicely and correctly displayed in the window but from within the EA, no access possible although it used to work. Did I unwillingly change some strange setup parameters well hidden somewhere in the menus which are intended to block indicators' input for all the future? Or am I just blind for not seeing the mistake?


Thank anyone in advance for contributing to saving my mental health and the physical integrity of those I might run into today (just kidding) :-)


Code as follows:

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int cnt=0;

int start()
{
cnt++;
int arg=20;

string str= DoubleToStr(iCustom(NULL,0,"testind",arg,0,0),1);
Alert(cnt," ",str );

return(0);
}

 

How about this ?

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int cnt=0;

int start()
{ 

   cnt++;
   int arg=20;
   double IndVal= iCustom(NULL,0,"Momentum",arg,0,0,1);
   Comment("cnt:   ",IndVal );

return(0);
}
Just make sure you spell the indicator name exactly right, and that you arguments / parameters in their right place.
 
DayTrader:

How about this ?

Just make sure you spell the indicator name exactly right, and that you arguments / parameters in their right place.


Hi Daytrader

Thanks for your ideas. But I'm afraid it didn't solve the problem. I changed the type of variable into double but it didn't work. And the name is definitely spelled correctly. The thing is it used to work with more or less the same EA (I am quite sure I didn't change anything around the indicator call) but now the values are no longer accessible.

Yet by drag-and-drop into the chartwindow, the indicator WORKS! Could it be some option I changed...?

 

Hotte, publish the indicator - at least the global code. Let us see all top level (outside of start()). Sometimes, clues can be seen by others that your current mental state fails to see, yes?

Or even tell us the ind name that using and where we can find it... and - "testind" name? Just wondering cuz DayTrader used "Momentum" or maybe was in context of an example only.

Best

 
fbj:

Hotte, publish the indicator - at least the global code. Let us see all top level (outside of start()). Sometimes, clues can be seen by others that your current mental state fails to see, yes?

Best

Hi fbj,

thought the same. indicators under https://forum.mql4.com/23036.


thks,

Hotte