Please fix this indicator or EA - page 141

 
mladen:
rapal Try it out now : pz_insidebar_1.01.mq4

hi mladen, it still doesn't work properly

i attach 2 images, before & after refresh window

Files:
1.jpg  226 kb
2.jpg  221 kb
 
rapal:
hi mladen, it still doesn't work properly

i attach 2 images, before & after refresh window

That indicator needs to be rewritten. It is looking for data from different time frame in all the wrong way

 
mladen:
That indicator needs to be rewritten. It is looking for data from different time frame in all the wrong way

thank you for the information, mladen

 

hi mladen,

is there any way to fix a lagging indicator like three or four bars..make it non lag i mean?

 
at the best:
hi mladen, is there any way to fix a lagging indicator like three or four bars..make it non lag i mean?

at the best

It depends on the nature of the indicator, but there is no general solution for lag fixing (if there is a solution at all)

 
mladen:
at the best It depends on the nature of the indicator, but there is no general solution for lag fixing (if there is a solution at all)

i will attach the code here as soon as i reach home ..its a histogram indicator.

 

Hi all!

Before i place a request, i always make sure that i have done as much as i can. My habbit to give the blondes some credits Since i'm not a coder at all, i studied the entire weekend mql4. I studied a lot of indicators, different coding etc. So finally i tried to code my own indicator (iCustom PinbarDetector filtered with iMACD). For some reason the results aren't as i want. Please see attached picture. For visuals i added the 12 SMA and 9 EMA. I want an arrow when a bullish/bearish pinbar is detected with the momentum of the MACD (bullish; 9>12, bearish; 9<12). In the picture you can see where the arrows need to be by the green boxes. 1 Arrow appeared correct, 1 appeared false and 3 didn't. I also attach the PinbarDetector.mq4 and my own coded PinbarMacd.mq4.

Please help me solve this. I really don't know what i'm doing wrong.

Thanks a lot!!

pinbardetector.mq4

pinbarmacd.mq4

Files:
 
Liza:
Hi all!

Before i place a request, i always make sure that i have done as much as i can. My habbit to give the blondes some credits Since i'm not a coder at all, i studied the entire weekend mql4. I studied a lot of indicators, different coding etc. So finally i tried to code my own indicator (iCustom PinbarDetector filtered with iMACD). For some reason the results aren't as i want. Please see attached picture. For visuals i added the 12 SMA and 9 EMA. I want an arrow when a bullish/bearish pinbar is detected with the momentum of the MACD (bullish; 9>12, bearish; 9<12). In the picture you can see where the arrows need to be by the green boxes. 1 Arrow appeared correct, 1 appeared false and 3 didn't. I also attach the PinbarDetector.mq4 and my own coded PinbarMacd.mq4.

Please help me solve this. I really don't know what i'm doing wrong.

Thanks a lot!!

pinbardetector.mq4

pinbarmacd.mq4

Hi Liza, nice job for a first try, for the iCustom call for the pinbar detector might try this to correctly call it

double pinbup = iCustom(NULL,0,"PinbarDetector",false,false,false,0.33,0.4,true,false,false,0.1,0.5,1,0,0.1,1,i);

double pinbdown = iCustom(NULL,0,"PinbarDetector",false,false,false,0.33,0.4,true,false,false,0.1,0.5,1,0,0.1,0,i);[/PHP]

for the macd if your looking for the macd momentum might try the slope of the histogram something like this

[PHP]double mainnow = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i);

double mainpre = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i+1);
 

Hi mrtools,

Thanks for your motivating words .

I did code it the correct way, but it generate the same results.

Also, i tried iMA instead of iMACD. But without success.

Thanks for the suggestion to use the slope, but i need the specific method (9>12||9<12).

Maybe a noobs question, but can it be that there is some kind of a conflict in calculating the MACD or MA in 4 digits instead of 5 digits? I use a 5 digit broker. But when i studied some custom indicators i noticed in the data-window that some buffers resulted price as 4 digits instead of 5 digits?

Thanks for your time!!

 
Liza:
Hi mrtools,

Thanks for your motivating words .

I did code it the correct way, but it generate the same results.

Also, i tried iMA instead of iMACD. But without success.

Thanks for the suggestion to use the slope, but i need the specific method (9>12||9<12).

Maybe a noobs question, but can it be that there is some kind of a conflict in calculating the MACD or MA in 4 digits instead of 5 digits? I use a 5 digit broker. But when i studied some custom indicators i noticed in the data-window that some buffers resulted price as 4 digits instead of 5 digits?

Thanks for your time!!

As far as MA or MACD are concerned, it does not matter if the broker is 4 or 5 digit broker : nothing needs to be changed in the code. You probably saw that print or comment were showing 4 digit value, but internally, they are using larger precision than that

PS: what is the (9>12||9<12)? Moving averages with periods 9 and 12?

Reason: