Questions from a "dummy" - page 267

 

Can anyone check if the drawing restriction in the indicator works?

PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,r+s-1);

Already downloaded the ready-made indicator from here , still draws for the whole story.

Upd I have figured it out. It should be put in OnCalculate and set adequate value (rates_total-n).

 
pavelrev:

On weekdays, when there are quotes, the same thing.

Sometimes it slips through and shows what you need, but when you change the TF or get a new quote, it starts giving nonsense again.

Well, if no one is aware of it, write to the author of the article (in comments), if he does not respond - to Service Desk.
 

I am trying to draw a template of multicurrency indicator.

I have declared the buffers, initialized them (EMPTY_VALUE), where to draw from... I have done everything. In OnInit. In OnCalculate - nothing.

I run it and get rubbish in the indicator window on different parts of the chart.

What is wrong?

One more thing. When I change the parameters in the f_comment function and recompile it, the comment does not change, the changes take effect only after I remove and put the indicator on the chart again. Is it ok?

ps reuploaded the file

Files:
 
Silent:

I am trying to draw a template of multicurrency indicator.

I declared buffers, initialized (EMPTY_VALUE), where to draw from... I have done everything. In OnInit. In OnCalculate - nothing.

Run it - I get rubbish in indicator window on different chunks of chart.

What is wrong?

I don't see any rubbish when I run this code. Try to remove all copies of the indicator from the chart and load them again.
 
tol64:
I don't see any rubbish when I run this code. Try to delete all copies of the indicator from the chart and load them on the chart again.
Click on timeframes, it does not always appear, and not on all timeframes.
 

I've been sitting with it for a week, I've thrown everything out, only left empty arrays, but it still periodically draws from empty buffers... It still draws periodically with empty buffers...

 
Silent:

I've been working with it for a week, I've discarded everything, leaving only empty arrays, but it still occasionally draws from empty buffers... What a load of crap.

Clicked through the timeframes. At first the rubbish came out. Then it disappeared and no longer plays.

Probably a hard to catch microbug. )) But it's not a problem. You can (and should) just keep a stricter control (just in case). When calculating the values for the indicator buffers no problems will occur. And where values are supposed to be empty, just re-specify an empty value already for a particular array element.

Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
  • 2010.10.25
  • Nikolay Kositsin
  • www.mql5.com
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
 
Silent:

I've been sitting with it for a week, I've thrown everything out, only left empty arrays, but it still periodically draws from empty buffers... It still draws periodically with empty buffers...

Found one bug:

   SetIndexBuffer(0,USDBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,EURBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,GBPBuffer,INDICATOR_DATA);
   SetIndexBuffer(0,xUSDBuffer,INDICATOR_CALCULATIONS); // 3
   SetIndexBuffer(1,xEURBuffer,INDICATOR_CALCULATIONS); // 4
   SetIndexBuffer(2,xGBPBuffer,INDICATOR_CALCULATIONS); // 5
But I didn't see any rubbish before or after editing. Just an empty window.
 
tol64:

I clicked through the timeframes. At first the rubbish came out. Then it disappeared and doesn't play anymore.

Probably a hard to catch microbug. )) But it's not a problem. You can (and should) just keep a stricter control (just in case). When calculating the values for the indicator buffers no problems will occur. And where values are supposed to be empty, just re-specify an empty value already for the particular array element.

Heh... I'll have to dint where it is, in INDICATOR_DATA or in INDICATOR_CALCULATIONS

The trick is that after removing the indicator and putting it on the chart again, the rubbish is drawn in the same places where it was. This is also a trick.

Control, that's understandable. I will still see it visually, if it starts lying. But when I call some indication, will I have to re-calculate its values?

That's a bit crooked...

MetaDriver:

Found one bug:

But I didn't see any rubbish before or after editing. Just a blank window.

Thanks, I missed it when I was copying it.

The rubbish appears, unstable and not on all TFs (or out of range, need to look at the chart to the left), but it is there.

upd it is still visible here, should be 0.000000 0.000000... everywhere


 
Silent:

I've been sitting with it for a week, I've thrown everything out, only left empty arrays, but it still periodically draws from empty buffers... It still draws periodically with empty buffers...

Not sure, but that's probably why:

from the help:

Initializing an array with expression ArrayInitialize(array, init_val) does not mean initializing the elements of the reserve allocated for this array with the same value. Subsequent resizing of array with ArrayResize() within the current reserve adds elements to the end of the arraywhose values are undefined and, most often, not equal to init_val.

Reason: