Bug report for MQL Build 509 - page 2

 
SDC:

Don't SetIndexEmptyValue to zero. Delete all that. Empty value already has a default special value called EMPTY_VALUE, there are reasons for changing it (rarely) and they do not apply in your case.

You have already limited your history to max bars, all you need to do to prevent it getting longer than that is do

linebuffer[maxbars] = EMPTY_VALUE;

here look at this


SDC,

1. You are the man !

It worked ! Thanks for being such a nice, patient guy... so really there was no need for the SetIndexEmpyValue

declaration.

Now would it have really hurt some other guy to have spent a few minutes to explain like you did,

as opposed to essentially misleading me sadistically as above ????

BTW, MQL4 doc is crap. After 10+ years, they should have had many volumes of documentation.

2. Now I have a couple simple questions for you that have confused me throughout:

A. I am using iBars instead of Bars to make sure a different TF plot is done correctly. Will also use iBarShift (NULL, tf, Time[i]),True/False) for the loop as well, for plotting MTF. My plan is to have 4 different TF plots on same window, with horizontal spacing.

A1. Should I use the True version with iBarShift ()+1; OR the False one with iBarshift(); ?

A2. Now how about IndicatorCounted?

How does it know that it needs to count bars on perhaps a TF different than the current one?

B. Is the Start() function triggered every time by an incoming tick? If so, what does it mean to do RefreshRates(),

or in many cases RefreshEveryXMinutes, a routine written in many indis to specify the refresh rate (by tick, M1, M5 etc.)?

Cheers,

Athar.

 

iBarShift true or false is dependant on what you need it for. IndicatorCounted() only counts bars on the chart the indicator is attached to. start() runs on every tick, if start() has not completed before a new tick arrives it will not be interupted and start over, it will continue with what it was doing so if that happens the Bid and Ask variables and all the other predefined variables and arrays will still have the old values, so you might want to refresh rates to be sure they are still current before using them.

 
SDC:

iBarShift true or false is dependant on what you need it for. IndicatorCounted() only counts bars on the chart the indicator is attached to. start() runs on every tick, if start() has not completed before a new tick arrives it will not be interupted and start over, it will continue with what it was doing so if that happens the Bid and Ask variables and all the other predefined variables and arrays will still have the old values, so you might want to refresh rates to be sure they are still current before using them.


OK, so is there an equivalent iIndicatorCounted() for a different TF?

Otherwise, how would you plot MTF using the same code, horizontally spaced?

 

If you mean to find when a different tf started a new bar you have to write your own code for that, look in the codebase for coding examples of mtf indicators

 
SDC:

If you mean to find when a different tf started a new bar you have to write your own code for that, look in the codebase for coding examples of mtf indicators


Ok, thanks. Will do.
Reason: