Re: Step Indicators for MT4

81
wojtek wrote:
Dear MrTools, this indicator (StepMA pdf nmc 3.01 mtf + arrows.mq4) doesn't seem
to work with the following timeframe declaration:

Code: Select all

 extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame to use 
Am I wrong?
wojtek

When you change a parameter type like that, then the rest of the code must be changed too in order to adjust it (especially when mtf is in question since those parameters are used for iCustom() call and wrong parameter type in iCustom() call cal freeze terminal)


Re: Step Indicators for MT4

83
wojtek wrote:OK, I see, thank you!



Exactly that happened. I will observe indicators posted,
perhaps something will appear with the lighter mtf function
and the new time-frame declaration (to learn how to do it)...
The new mtf way is much easier to use and is lighter on the cpu - really better to use the new way
Also, what is not widely know, regardless if the old or the new mtf mode is used, if you use the mtf modes that mrtools and me are using, then you shall have no "left out" values in multi time frame mode (unlike the mtf that was recalculating just a fixed number of bars, these mtf modes are taking into account how many bars have actually changed in the target time frame and are calculating that much bars)

Re: Step Indicators for MT4

84
Being very old-fashioned, I still use keris2112 method (OK, it's very easy to understand and use ).

Then, could you please add the new MTF method and the new TF declaration for the indicator from

There are some coding 'irregularities' regarding the chart style (e.g., Shift and arrows) as far as I can see...

Re: Step Indicators for MT4

85
wojtek wrote:Being very old-fashioned, I still use keris2112 method (OK, it's very easy to understand and use ).

Then, could you please add the new MTF method and the new TF declaration for the indicator from

There are some coding 'irregularities' regarding the chart style (e.g., Shift and arrows) as far as I can see...
wojtek

What exact 'irregularities'?


Re: Step Indicators for MT4

86
For instance, in #define _mtfCall the exact names of all varables are written, but
there are some zeros, for instance for LineWidth and/or for Shift (those variables
describe the visualization of buffers).  The variable Interpolation is skipped.
The buffers are described by different formulas for lines and for arrows,
I mean these substitutions

Code: Select all

                     buffer[i]   = _mtfCall(0,y);
                     trend[i]    = _mtfCall(5,y);
                     bufferda[i] = EMPTY_VALUE;
                     bufferdb[i] = EMPTY_VALUE;
                     arrowu[i]   = EMPTY_VALUE;
                     arrowd[i]   = EMPTY_VALUE;
                     if (x!=y)
                     {
                        arrowu[i] = _mtfCall(3,y);
                        arrowd[i] = _mtfCall(4,y);
                     }
And why bufferda and bufferdb are empty, if they draw the indicator line?  
All the above examples come from the code of the indicator attached.

Re: Step Indicators for MT4

87
wojtek wrote:For instance, in #define _mtfCall the exact names of all varables are written, but
there are some zeros, for instance for LineWidth and/or for Shift (those variables
describe the visualization of buffers).  The variable Interpolation is skipped.
The buffers are described by different formulas for lines and for arrows,
I mean these substitutions

Code: Select all

 buffer[i] = _mtfCall(0,y); trend[i] = _mtfCall(5,y); bufferda[i] = EMPTY_VALUE; bufferdb[i] = EMPTY_VALUE; arrowu[i] = EMPTY_VALUE; arrowd[i] = EMPTY_VALUE; if (x!=y) { arrowu[i] = _mtfCall(3,y); arrowd[i] = _mtfCall(4,y); }
And why bufferda and bufferdb are empty, if they draw the indicator line?  
All the above examples come from the code of the indicator attached.
wojtek

#define with macro parameters saves time (and nerves) when you have to repeat exactly the same code nnn time + it adds macro options to apply to repeated code. Frankly that is one of the best features of new builds of metatrader 4 - starting from changing just one one place when it is used on nnn places

Of skipped parameters : when calling anther instance of indicator (as it is called from a multi time frame indicator) it is completely irrelevant what colors are going to be used (since they are not going to be display by the called instance but buy the calling instance). Also, when calling the target time frame, using a shift in target time frame is very bad idea (you would wrong results). Instead shift has to be applied in the higher time frame

Interpolation parameter is used only (and only) in the multi time frame part - regular part never uses it

The two buffers that are emptied : they are drawn later (if necessary), but as it is always necessary - in order to prevent repainting - buffers always have to be emptied if we do not know for certain that they will be used later. They are a part of non-repainting way of drawing colored lines and exactly the same way iss used in any other nrp multi color indicator - regardless if it is a mtf or not

Re: Step Indicators for MT4

90
wojtek wrote:OK, thanks a lot for your detailed explanation!

One more question, please: what is the buffer count for?
It appears only once in the code:

Code: Select all

count[0]=limit;
OK, and here: _mtfCall(6,0)
That is the "trick" part :

In order to calculate exactly as much bars as necessary (but only bars changed in the target time frame), multi time frame instance is "asking" the target time frame instance how many bars have been changed in the target time frame. And that is that part of the code : it makes sure that all the bars that need to be recalculated are recalculated


Who is online

Users browsing this forum: Abdi, Bing [Bot], boytoy, Facebook [Crawler], Krunal Gajjar, LittleCaro, Majestic-12 [Bot], ssscary, thomdel, Yandex [Bot] and 107 guests