Indicators: Hull moving average - page 2

 
Anthony Garot:

This is a standard call to iCustom(). It should look something like this:

(I didn't test this code)

Thank you for your help. I'll try from this point.

 
Mladen Rakic:

Re-check the data ...

There is one buffer labeled Hull and two labeled Hull slope down. That is how non-repainting two color line must be done in metatrader 4 (check the code - it is there after all and you can easily check what exactly and why is it done) . Nothing wrong with it and nothing to be fixed

I tried using this Hull MA in two different EA builders but none of them read the buffer0 value. Whenever I set the conditions to see when buffer0 appears and buffer1 appears it only takes the buffer1 and skips buffer0.
 
1CPU1Vote:
I tried using this Hull MA in two different EA builders but none of them read the buffer0 value. Whenever I set the conditions to see when buffer0 appears and buffer1 appears it only takes the buffer1 and skips buffer0.

It takes one single iCustom() call (ie: one line of code) to get the current trend / slope of that hull.

If you want to check for trend/slope change, it gets "complicated" : you shall have to add one iCustom() call (ie: one more line of code), and then compare 2 values.


So much about that "issue" from me. The rest is up to you

 
Mladen Rakic:

It takes one single iCustom() call (ie: one line of code) to get the current trend / slope of that hull.

If you want to check for trend/slope change, it gets "complicated" : you shall have to add one iCustom() call (ie: one more line of code), and then compare 2 values.


So much about that "issue" from me. The rest is up to you

Well, I changed from buffer0 to buffer1. I used both buffers but checks only one each time when a certain condition is met once per bar. But I now I use only buffer1 and the logic now if buffer1 disappears = buffer0 appears and vice versa. Thank you for the response by the way. Also I tried your hull moving average 2.0  but it gives a few compiling error. 
 
1CPU1Vote:
Well, I changed from buffer0 to buffer1. I used both buffers but checks only one each time when a certain condition is met once per bar. But I now I use only buffer1 and the logic now if buffer1 disappears = buffer0 appears and vice versa. Thank you for the response by the way. Also I tried your hull moving average 2.0  but it gives a few compiling error. 

There are 4 buffers used in that indicator - why do you think that buffer0 and buffer1 (which, btw, do not exist in the indicator as such - the names used in the indicator are completely different) are the ones that you should be using?


PS: when you use some "expert builder", please do not post in coding sections (like code base). "Expert builders" have nothing (and I repeat : nothing) in common with any coding stuff

 
Mladen Rakic:

There are 4 buffers used in that indicator - why do you think that buffer0 and buffer1 (which, btw, do not exist in the indicator as such - the names used in the indicator are completely different) are the ones that you should be using?


PS: when you use some "expert builder", please do not post in coding sections (like code base). "Expert builders" have nothing (and I repeat : nothing) in common with any coding stuff

Forgive me for not being specific. The buffer0 I referred to was variable "val" with the label "Hull" and buffer1 was "valda" with label "Hull - slope down"

I use EA builders to lay out the structure and thereafter tweak and modify some snippets to work it out in MetaEditor.
 

Hi Mladin and MrTools,

Firstly thank you so much the sheer amount of your own personal time you have donated to helping traders.

None of us will ever be able to repay you! but thank you enormously!

If you have time could you please modify the HMA color nrp indi, to make it MTF,  and possibly in a bar format (color change) to go in seperate window?

Could you include in the indi which options are open price, close price, high, low etc (eg. 0=open, 1=close ETC) or have a drop down option.

If this already exists could you kindly point me to it, I have looked back through to 2008, and could not find it.

Forever greatful and thanking you indavce for your time.

 

Hello Malden,

Could you please give an example of the correct way to detect when color of the indicator changes from RED to GREEN (or vice versa)


I noticed that buffer 1 is empty when green and not empty when red. So i am getting value of buffer1 at each bar end. But this approach seems like a patch and not the correct solution. Also upon testing the results are not the most reliable. 

Thx


CODE SAMPLE:

// Get HullMA buffer 1 val
        double hullma_buffer_current=iCustom(_Symbol,            // symbol
                                      _Period,       // chart period
                                      "Hull moving average.ex4",
                                      16,                 // Hull period
                                      2.0,                // Hull divisor
                                      PRICE_CLOSE,         // applied price
                                      1,                   // Index of buffer 
                                      1);
                                     
        double hullma_buffer_prev=iCustom(  _Symbol,            // symbol
                                     _Period,       // chart period
                                     "Hull moving average.ex4",
                                     16,                 // Hull period
                                     2.0,                // Hull divisor
                                     PRICE_CLOSE,         // applied price
                                     1,                   // Index of buffer 
                                     2);                 // SHIFT set to 1
        
        bool condition_1 = (hullma_buffer_prev > 0 && hullma_buffer_prev != empty_val); 
        bool condition_2 = (hullma_buffer_current == empty_val || hullma_buffer_current == 0.0);
        if (condition_1 && condition_2)
                // BUY TRADE
 
Rounak Mohanty #:

Hello Malden,

Could you please give an example of the correct way to detect when color of the indicator changes from RED to GREEN (or vice versa)


I noticed that buffer 1 is empty when green and not empty when red. So i am getting value of buffer1 at each bar end. But this approach seems like a patch and not the correct solution. Also upon testing the results are not the most reliable. 

Thx


CODE SAMPLE:

Use buffer 3

 
Mladen Rakic #:

Use buffer 3

Thanks for the quick reply I will try it out and let you know.
Reason: