Questions from Beginners MQL5 MT5 MetaTrader 5 - page 158

 
pronych:

How to trigger a forced update of indicators from within, i.e. OnCalculate event?

So, if not fixed (below are problems that may arise).

Or by timer (something like this).

 
Silent:

So, if not fixed (below are the problems that may arise).

Or on a timer ( whatever).

I see. )) Have you tried asking for in-house functionality?

 
pronych:

I see. )) Have you tried asking for in-house functionality?

I haven't, in general yes (I think MetaDraiver wrote to SD), and the question was raised several times on the forum.

Response from developers, if any, I do not know.

PS may be useful.

Development of themulticurrency volatility indicator in MQL5

The development of a multicurrency indicator for price divergence analysis

I think it should have been published here, I couldn't find it.

In the first one, if there is an error

Line 40 of CCanvas canvas; error

unresolved static variable 'CCanvas::m_default_colors'

add

uint CCanvas::m_default_colors[9]={0};

Discussed long time ago, didn't check it, what's changed.

Разработка мультивалютного индикатора волатильности на MQL5
Разработка мультивалютного индикатора волатильности на MQL5
  • tol64.blogspot.com
В этой статье рассмотрим разработку мультивалютного индикатора волатильности. Начинающий разработчик на MQL5 может столкнуться с некоторыми сложностями при разработке мультивалютных индикаторов, но после прочтения этой статьи всё станет намного проще. Основные вопросы при разработке мультивалютного индикатора относятся к синхронизации данных...
 

Well, let's try to get Metadriver. Maybe he can shed some light on what the developers have answered. Volodya...

Володя (песня измученного ангольского народа)
Володя (песня измученного ангольского народа)
  • my.mail.ru
Песня посвящена ангольскому революционеру одному из командиров MPLA, убитому в 1975 году (в Луанде в честь него названа одна из улиц). Валодя – это было его боевое прозвище. После 75го года песня про Валодю была очень популярна в Анголе. Где только я ни слышал это имя, Незабываемое для сынов Анголы. Володя, Володя, Володя, славный защитник ангольского народа! Володя, Володя, Володя, противник империалиста, Который собирается установить режим...
 
pronych:

Well, let's try to get Metadriver. Maybe he can shed some light on what the developers have answered. Volodya...

I didn't quite understand the question. I didn't ask for a regular ticker. Like Silent on the contrary was going to ..., in short, we hoped for each other.

The indirect case was - already after it was found out that request of data outside of TERMINAL_MAX_BAR causes refreshing of all indicators on the chart.

I reworked my button chart reloader and sent it to Service Desk with the new version. I asked in the comments if I hoped it would work again... They didn't say anything... I was OK with it... I made a feature from it.

;)

--

Well, strictly speaking, it's not a bug actually. Terminal doesn't crash, doesn't even slow down much, it just updates the data on the chart. I understand what they're doing there. Like: request outside of existing data -> terminal tries to load data, followed by update the chart. Simple and efficient. Why change if there are no victims?

// About "recalculating the indicator from inside", I do not understand the problem. The question is not clear. Internally, the indicator is its own master, it recalculates whatever it wants. But if it uses an external signal, it is another matter. Then we spin...

 

Man, maybe you shouldn't.))

It's not quite clear how prev_calculated specifically affects indicator rendering.

In my case, the refresh attempt occurs both by OnCalculate() and by timer. Multi-instrument.

At unsuccessful attempt to get rows, function is interrupted until the next tick or timer, no drawing takes place, but uninitialized (as it seems) values appear on the chart from somewhere.

Although in Init() ArrayInitialize(Buffer ,...) is present.

Maybe I have a bug somewhere. It happens rather rarely and it's hard to catch it.

It seems to me that the normal function of forceful queuing at OnCalculate() would allow to minimize the tambourine play in multi-instrument indices for charts with rare ticks.

By the way, it's written in the help ;)

Все необходимые расчеты пользовательских индикаторов необходимо размещать в предопределенной функции OnCalculate().

PS. Got it about the "chip".

PSPS/ I have a feeling that in the given case it is more reliable to use calculation of values without using an indicator for an EA. And separately an indicator for visualization.

But then I would have to calculate the same thing twice.

 
MetaDriver:

I didn't quite understand the question. I didn't ask the regular tick-caller to do it. I thought Silent was going to..., in short, we were relying on each other.

...

I mean this.

Forum on trading, automated trading systems and trading strategies testing

Errors, Bugs, Questions

MetaDriver, 2013.08.03 17:55

"

If you want to be sure you have an input signal for indicators, you should use the Pascal's Pascal's suggestion.

For my purposes it is not always suitable, but in general case a lot of "weekend problems" would be removed.

ForExperts on trading, automated trading systems, and trading strategy testing.

Bugs, bugs, questions

MetaDriver, 2013.08.03 18:02

I agree.

A "command" to forcibly reset all prev_calculated for the selected symbol would also be useful. With subsequent tick generation would be a good combo.



 

During visual testing, at the moment when the indicator is re-initialized in the Expert Advisor, the indicator with old settings continues to be displayed on the chart in the tester (in fact, each time during re-initialization one more "parallel line" is added). I tried to do IndicatorRelease every time before getting a new handle - it doesn't help.

Get new handles in code.

void f_indicator_reinit()
 { 
    
   IndicatorRelease(firstHandle);
   IndicatorRelease(secondHandle);
   IndicatorRelease(thirdHandle);
   IndicatorRelease(fourthHandle);  

   bughelper=bughelper+1;
   
   firstHandle=iCustom(NULL,0,"indicatorname.ex5",12+bughelper,ind_s,HotPink,HotPink,10,MODE_SMA,PRICE_CLOSE,1);
   secondHandle=iCustom(NULL,0,"indicatorname.ex5",12+bughelper,ind_s,White,White,10,MODE_SMA,PRICE_CLOSE,2);   
   thirdHandle=iCustom(NULL,0,"indicatorname.ex5",12+bughelper,ind_s,Red,Red,10,MODE_SMA,PRICE_CLOSE,3);   
   fourthHandle=iCustom(NULL,0,"indicatorname.ex5",12+bughelper,ind_s,Gold,Gold,10,MODE_SMA,PRICE_CLOSE,4); 
 }  

I introduced the bughelper variable because the indicator wouldn't recalculate itself without changing its input parameters.

 
Silent:

That's what I mean.

I have solved the recalculation problem by requesting the data outside TERMINAL_MAX_BAR.

And since the chart is updated in general - it does not matter whether the request is made from within the indicator or from an external program. The main thing is that the program (requesting) requests data for this very symbol and timeframe.

Actually I have not encountered cases where I need to update the chart "on the machine". I am completely satisfied with my button // see the link above.

With tick generation (without chart update) the problem is not solved, but I haven't solved it much - it can be avoided in most cases in many ways (mostly with a timer).

 
IndicatorRelease(firstHandle);
Функция возвращает ошибку 4014 - 

ERR_FUNCTION_NOT_ALLOWED

4014

System function not allowed to be called

Please advise what could be the reason forIndicatorRelease() not being called?

Reason: