Errors, bugs, questions - page 154

 

For some reason I can't get data from the indicator using the standard library. Here is the script:

//---------------------------------------------------------------------
#include  <Indicators\Trend.mqh>
//---------------------------------------------------------------------
CiSAR  price_source;
//---------------------------------------------------------------------
void
OnStart( )
{
  if( price_source.Create( Symbol( ), PERIOD_CURRENT, 0.01, 0.2 ) == true )
  {
    for( int i = 0; i < 10; i++ )
    {
      Print( "Price[ ", i, " ] = ", price_source.Main( i ));
    }
  }
}
//---------------------------------------------------------------------

Here is the result of its operation:

2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 9 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 8 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 7 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 6 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 5 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 4 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 3 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 2 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 1 ] = 1.797693134862316e+308
2010.10.04 13:31:17 TestIndicator (AUDUSD,H1) Price[ 0 ] = 1.797693134862316e+308

Apparently EMPTY_VALUE is output instead of values.

What I do wrong?

 
Dima_S:


What am I doing wrong?


Try adding

price_source.Refresh(-1);


Before requesting data.

 

Thank you, that's helpful. It would be good to reflect this in the help.

void CIndicator::Refresh(int flags)

So I understand that flags is a binary mask of timeframes which are refreshed? If -1, then all TFs are refreshed?
 
Dima_S:
I take it that flags is a binary mask of timeframes that are refreshed? If -1, then all TFs are refreshed?

Exactly. You can use object visibility constants.

https://www.mql5.com/ru/docs/constants/objectconstants/visible

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Видимость объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Видимость объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Видимость объектов - Документация по MQL5
 

I can't understand it, I must have missed it. This:

class dfgdfg
{                                
   void sgsfd();
};

compiles normally. Is it supposed to be like this?

So I understand the optimizer cuts the method as not used before compilation and as a result the error message 111 is not generated.

+Also, unused methods with implementation errors are compiled without messages.

 

Is my problem of interest to anyone?

https://www.mql5.com/ru/forum/2172/page1

Не обновляются некоторые графики
Не обновляются некоторые графики
  • www.mql5.com
Непосредственно в индикаторе выбирается необходимый инструмент и период графика.
 

There is also a problem.

Arrays are initialised only when the indicator starts

This correlates to some kind of error in the standard zigzag:


 
MT 5 does not work through proxies (http,socks 4,5) Build 328. However, MT 4 works fine through these proxies.
 
AlexSTAL:

Is my problem of interest to anyone?

https://www.mql5.com/ru/forum/2172/page1

Yes, your messages have been seen.

Trying to do it again.

 
AlexSTAL:

There is also a problem.

The arrays are only initialised when the indicator starts

This correlates to some kind of error in the standard zigzag:


When you get a Memory exception there is no point in continuing to run the terminal. The most sensible thing is to restart the terminal and figure out why it took so much memory and try to reduce the appetite.