New metatrader 4 compatible indicators - page 287

Mladen Rakic
160094
Mladen Rakic  
andreatrade:
Dear mladen

I've got an issue using the iCustom function with the indi "Bollinger Bands_smooth %b nrp_mtf nmc":

double PercB_Smooth_Trend = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc",30,20,0,2,1.0,false,1,1);

Using MT4 tester apparently everything is fine but when the computation is finish ( or you stop the EA running in tester mode ) an incredible number of windows of this indicator are generated and it is almost impossible assess the results at the video.

bollinger_bands_smooth_b_nrp_mtf_nmc.mq4

You are missing the first parameter in the iCustom() call.

The call should be like this :

double PercB_Smooth_Trend = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc","",30,20,0,2,1.0,false,1,1);

LakeTrader
11
LakeTrader  

Dear Mladen ---- I picked up the indicator below -- from one of your earlier posts -- it carries the nmc label --- but does not seem to work in the EA I am building with an online app --- and they keep telling me the indicator is not up to date with current MT4 language requirements --- can you update to current codes ? Also, can you confirm this indicator is not a re-paint ? Thx

LakeTrader
11
LakeTrader  
LakeTrader
11
LakeTrader  

not sure why link is not showing -- the link name 4 time frame hull trend nmc.mq4

mntiwana
4555
mntiwana  
Lake Trader:
not sure why link is not showing -- the link name 4 time frame hull trend nmc.mq4

lake trader,

did you means this one of MRTOOLS ver.

4_time_frame_hull_trend_nmc.mq4

Mladen Rakic
160094
Mladen Rakic  
Lake Trader:
not sure why link is not showing -- the link name 4 time frame hull trend nmc.mq4

Lake Trader

As far as I see, all is OK with that indicator :

This is the one I tested (no code changes, just downloaded it from this post : https://www.mql5.com/en/forum/174961/page18 ) : 4_time_frame_hull_trend_nmc_1.mq4

So. that indicator is new mt4 compatible

LakeTrader
11
LakeTrader  

Yes it seems to work as indicator -- but when converting to use within EA -- not so much --- this is the answer I am getting from the EA app group --- "Custom indicators used in any EA must be programmed in the new MQL4 language. Old, incompatible indicators include the functions init() and start(), whereas new indicators include the functions OnInit() and OnCalculate()." ??? Any help and/or direction much appreciated -- Thx

andreatrade
62
andreatrade  
mladen:

You are missing the first parameter in the iCustom() call.

The call should be like this :

double PercB_Smooth_Trend = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc","",30,20,0,2,1.0,false,1,1);

Dear mladen,

may be I'm wrong but it doesn't work ( ok now I don't get any extra window) :now I don't get back the results of the iCustom function.

According to the indicator the parameters are :

extern string TimeFrame = "Current time frame";

extern double BandsPeriod = 20;

extern int BandsPrice = 0;

extern double BandsDeviations = 2.0;

extern double T3Hot = 1.0;

extern bool T3Original = false;

and therefore my iCustom call should be correct ( 30 min timeframe ) : double PercB_Smooth = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc",30,20,0,2,1.0,false,1,1);

Mladen Rakic
160094
Mladen Rakic  
andreatrade:

Dear mladen,

may be I'm wrong but it doesn't work ( ok now I don't get any extra window) :now I don't get back the results of the iCustom function.

According to the indicator the parameters are :

extern string TimeFrame = "Current time frame";

extern double BandsPeriod = 20;

extern int BandsPrice = 0;

extern double BandsDeviations = 2.0;

extern double T3Hot = 1.0;

extern bool T3Original = false;

and therefore my iCustom call should be correct ( 30 min timeframe ) : double PercB_Smooth = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc",30,20,0,2,1.0,false,1,1);

andreatrade

No. First of all, the first parameter must be a string (not a number) - that will cause a direct error in reloading the indicator over and over. The second is that we are already calling the iCustom() in the target time frame - no need to try to force it to recognize that time frame again. And empty string in that case passed as a value of the first parameter will do just fine and will do it in the most efficient way

____________________

But I have a feeling that you are looking in a wrong buffer. First buffer has values all the time. Second does not (it has values only when the slope is down, and you should not use that buffer - because f the way how nrp is treated - but much better to use the 4th buffer (the "trend"buffer ) and then you shall always have the exact value of the trend

________________

PPS: now I saw that there is an extra 30 in that call. This is the correct call to get values from that trend buffer :

double PercB_Smooth_Trend = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc","",20,0,2,1.0,false,3,1);

Tested it and all works OK

tropicalrecon
128
tropicalrecon  
mladen:

andreatrade

No. First of all, the first parameter must be a string (not a number) - that will cause a direct error in reloading the indicator over and over. The second is that we are already calling the iCustom() in the target time frame - no need to try to force it to recognize that time frame again. And empty string in that case passed as a value of the first parameter will do just fine and will do it in the most efficient way

____________________

But I have a feeling that you are looking in a wrong buffer. First buffer has values all the time. Second does not (it has values only when the slope is down, and you should not use that buffer - because f the way how nrp is treated - but much better to use the 4th buffer (the "trend"buffer ) and then you shall always have the exact value of the trend

________________

PPS: now I saw that there is an extra 30 in that call. This is the correct call to get values from that trend buffer :

double PercB_Smooth_Trend = iCustom(Symbol(),30,"Bollinger Bands_smooth %b nrp_mtf nmc","",20,0,2,1.0,false,3,1);

Tested it and all works OK

Hey Mladen, These two indicators don't work on mt4, would you have a better recommendation for mtf supply and demand?

#SS_SupportResistance_v01_m mtf.mq4

SS_SupportResistance_v04b.mq4