Requests & Ideas - page 68

Mladen Rakic
162718
Mladen Rakic  

Rod

I think that (HullPeriod*2)+2 bars for calculation is not enough (it is the smallest value of the 3 periods used for calculation) Maybe you should use HMAPeriod instead but I am not sure that it will give you expected results (internal EA calculation using built in "onArray" indicators sometimes is a lottery instead of an exact "science". That is why I prefer using external indicators - if you use the second parameter (time frame) of iCustom, the called indicator does not have to be multi time frame at all and you are going to get correct results)

regards

Mladen

madcedar:
Hello

I'm trying to code an MTF Hull Moving Average Trend routine for an EA. What I've coded is copied from Mladens work but it doesn't give the exact same result as Mladen's indicators. It's a case of "close but no cigar". My trend slightly lags that of Mladen's indicators.

Here is the code I've used:

//+------------------------------------------------------------------+

//

//

double workHMA[]; // working array for HMA values

//

//

//+------------------------------------------------------------------+

// Calculate the current Hull Moving Average trend direction

//

int /*double*/ HullMovingAverageTrend(int timeFrame, /*int HMAPeriod,*/ int shift=0)

{

int HMAPrice = PRICE_CLOSE;

int HMAMethod = MODE_LWMA;

HMAPeriod = MathMax(2,HMAPeriod);

if (timeFrame==0) timeFrame=Period();

int HalfPeriod = MathFloor(HMAPeriod/2);

int HullPeriod = MathFloor(MathSqrt(HMAPeriod));

int limit = (HullPeriod*2)+2; //want to last two bars to be accurate to determine trend

if(Bars-1 < limit*timeFrame/Period()) return(0.0); //not enough bars to calculate HMA

if (ArraySize(workHMA)!=limit) { ArrayResize(workHMA,limit); ArrayInitialize(workHMA,0); }

ArraySetAsSeries(workHMA, true);

int yold = -1;

for(int i=limit*timeFrame/Period(); i>=0; i--) {

int y = iBarShift(NULL,timeFrame,Time,true);

if (y!=yold){ // fill the array only if y has changed (avoid repeated values in mtf mode)

workHMA[y] = iMA(NULL,timeFrame,HalfPeriod,0,HMAMethod,HMAPrice,y)*2.0-iMA(NULL,timeFrame,HMAPeriod ,0,HMAMethod,HMAPrice,y);

yold = y;

}

}

// workHMA array has values in the selected mtf timframe and increments with respect to that timeframe

for(i=limit/2+1; i>=0; i--) {

workHMA = iMAOnArray(workHMA,0,HullPeriod,0,HMAMethod,i);

}

if (workHMA[shift] > workHMA[shift+1]) return(1); //up

if (workHMA[shift] < workHMA[shift+1]) return(-1); //down

//return(NormalizeDouble(workHMA[shift],Digits));

return(0);

}

//+------------------------------------------------------------------+

Can someone please advise me if I have the array limits correct or where the problem is in the above code?

Cheers

Rod
Mladen Rakic
162718
Mladen Rakic  

simba

Posted it here : https://www.mql5.com/en/forum

regards

Mladen

SIMBA:
Mladen,

Please take a look at the pictures.

What I want is for a modified trendline that works nonlinearly...a curve.

User fixes starting point and a minimum of 2 additional points,or a maximum of 3 additional points then the nonlinear trendline curve is drawn,projecting into the future(like radius mode in normal tl).

Thanks for your consideration.

Regards

S
madcedar
24
madcedar  

Mladen

Thank you for your reply as always. Metatrader's behaviour is really surprising to me sometimes. The good news (for me) is that my copy and pasting skills (of your code) is more or less okay this time. Also now I know why you coded the HMA for EA on this thread without MTF ability. I don't like using iCustom just because it seems to slow down back testing and it's not as neat because the EA consists of multiple files. It's no bid deal in the end though. Again, thank you for your commentary because constructive information opens not only my eyes and mind to doing things better and differently in the future.

Kind Regards

Rodney

mladen:
Rod

I think that (HullPeriod*2)+2 bars for calculation is not enough (it is the smallest value of the 3 periods used for calculation) Maybe you should use HMAPeriod instead but I am not sure that it will give you expected results (internal EA calculation using built in "onArray" indicators sometimes is a lottery instead of an exact "science". That is why I prefer using external indicators - if you use the second parameter (time frame) of iCustom, the called indicator does not have to be multi time frame at all and you are going to get correct results)

regards

Mladen
bebeshel
519
bebeshel  

mrtools

Could you confirm if this indicator is: "" cfb channel new on ds jurik_mtf , and otherwise put on the web??,

and arrows that what indicator come in ?

Files:
mtfnrp.gif 28 kb
brax64
158
brax64  

Hi Mladen,

Thanks a lot to spent some of your precious time to reply.

The indicator that you have attached works great, my only problem is do not clutter the chart, usually I don't need the mid or mini levels (anyway pretty cool the colored bar at the touch of the line!!) so mine was perfect because the lines are only on the left side (like the pivot indicator "PivotD_v5" that I've already posted in the forum) but it has the refreshing problems...

May you help me on this?

Thank you and Best Regards

mladen:
brax64

Try out this one

It is a modification that I was working on a long, long time ago with some extras (showind mid levels, showing "baby levels", showing bars when a line is "touched" alerts, and so on ...) As far as I remember it was working OK
regards Mladen
brax64
158
brax64  

Hi Msquared

That picture is one of my templates, glad that you like it

the nitro indi is a commercial one, I bought it at WYFX | Forex Probability Indicator | New MetaTrader Indicators

the macd is my little mod and you can find it here in the forum, right now I don't remember exactly where, but have a look a the indicator list thread and you 'll find it.

Regards

msquared:
where may i find the WYFX NITRO+Lo eMACD v1.0 indicator posted in the image below?
William Snyder
9493
William Snyder  
bebeshel:
Could you confirm if this indicator is: "" cfb channel new on ds jurik_mtf , and otherwise put on the web??, and arrows that what indicator come in ?

Not sure but think it is the cfb channel on jurik mtf, the arrows again not sure but maybe a ma cross of some sort.

bebeshel
519
bebeshel  

"trendRSX system"

Could someone create an EA., with "trendRSX" ??

Thanks

bbjurek
67
bbjurek  

BB OMacd nrp

Dear Mladen,

can You add email alarm to this indicator and arrows on price windows?

https://c.mql5.com/forextsd/forum/123/bb_omacd_nrp.mq4

thanks,

bbjurek

Mladen Rakic
162718
Mladen Rakic  

Here you go

just in case added 2 kind of alerts and 2 kind of arrows : you can choose for both if you wish them on macd slope change or you wish them on macd bands break. If you choose bands break then you will probably to set StdDev parameter to less than 3 since with 3 deviations it is rarely going to happen (here is an example with 2 deviations bands breaking arrows)
regards

Mladen

bbjurek:
Dear Mladen,

can You add email alarm to this indicator and arrows on price windows?

https://c.mql5.com/forextsd/forum/123/bb_omacd_nrp.mq4

thanks,

bbjurek