Coding help - page 327

 

Having trouble in programming your trading charts?

Channel Sea Automated Trading Simulatorwill do all the complicated programming for you! It even comes with a financial social network, so you can share your trading trading ideas and learn from fellow traders as well.

Now downloading and installation needed. It's the best FREE trading simulator in the market right now.

Happy trading!

 

Dear Mladen, I've done this Corridor of Momentum, based on your Smoothed Momentum from the "code snippet" thread. Like I have set it (the HighLowStep settings) it comes out pretty good on TF like H1 and H4 (Gyazo - 4a24c73d3d721713c6e37bb508d65596.png), but it seems that with Momentum, the corridor can not be set in a way that it shows coherent values on each TimeFrame, am I right ? You will see that in Daily for example, the steps are too high, and in lower TF too low. Is there a way to fix this ? Besides it seems to be a bug in the first bars of the chart, where the momentum makes a strange curve (Gyazo - af22b911a9caaddaadffc58b41745fa5.png). Thanks a lot for your reply. Regards.

 

Hello , may i know how to get buy or sell signal when the macd cross the signal line ?

By now i was using ( macd>0) for buy and (macd<0) for sell .

But i want the ea only buy or sell when the macd have crossing the signal line only .

Please give me some hints.

Thanks in advance .

Files:
untitled.jpg  218 kb
 
stevenpun:
Hello , may i know how to get buy or sell signal when the macd cross the signal line ?

By now i was using ( macd>0) for buy and (macd<0) for sell .

But i want the ea only buy or sell when the macd have crossing the signal line only .

Please give me some hints.

Thanks in advance .

Dear Stevenpun,

Try changing this in the EA that call the MACD using iCustom....

You need to know the buffer number of the MACD and SIGNAL line to do this....

MACD > SIGNAL for buy ....

MACD < SIGNAL for sell....

Hope this HELP

 
12BPRO:
Dear Stevenpun,

Try changing this in the EA that call the MACD using iCustom....

You need to know the buffer number of the MACD and SIGNAL line to do this....

MACD > SIGNAL for buy ....

Thanks for advise , but where can i get the buffer number ?

MACD < SIGNAL for sell....

Hope this HELP

Thanks for your advise , but where can i get the buffer number ?

 
stevenpun:
Thanks for your advise , but where can i get the buffer number ?

One way to check the Buffer number for the MACD main line and MACD signal line

1) point your mouse to the indicator line.. it will tell the buffer number... you got to minus 1 for the actual number....

2) Open the MACD file and find the SetIndexBuffer(0,ExtMapBuffer);

 
12BPRO:
One way to check the Buffer number for the MACD main line and MACD signal line

1) point your mouse to the indicator line.. it will tell the buffer number... you got to minus 1 for the actual number....

2) Open the MACD file and find the SetIndexBuffer(0,ExtMapBuffer);

Not really 100% understand , but later will try figure it out .

 
airquest:
Dear Mladen, I've done this Corridor of Momentum, based on your Smoothed Momentum from the "code snippet" thread. Like I have set it (the HighLowStep settings) it comes out pretty good on TF like H1 and H4 (Gyazo - 4a24c73d3d721713c6e37bb508d65596.png), but it seems that with Momentum, the corridor can not be set in a way that it shows coherent values on each TimeFrame, am I right ? You will see that in Daily for example, the steps are too high, and in lower TF too low. Is there a way to fix this ? Besides it seems to be a bug in the first bars of the chart, where the momentum makes a strange curve (Gyazo - af22b911a9caaddaadffc58b41745fa5.png). Thanks a lot for your reply. Regards.

airquest

The first bars are normal (previous values are missing and that is why that strange curve)

As of step : you are right. The problem with momentum is that as the time frame rises so the momentum values are rising too and then the HighLowStep has to be adjusted (it is similar in that with macd)

 
mladen:
airquest

The first bars are normal (previous values are missing and that is why that strange curve)

As of step : you are right. The problem with momentum is that as the time frame rises so the momentum values are rising too and then the HighLowStep has to be adjusted (it is similar in that with macd)

Thanks. Do you know a way to fix that ? Outside defining sth like if (Period()=X) HighLowStep = HighLowStep * Y;

 
airquest:
Thanks. Do you know a way to fix that ? Outside defining sth like if (Period()=X) HighLowStep = HighLowStep * Y;

It (the momentum) would need to be normalized

You could try to use the one from this post : https://www.mql5.com/en/forum/176430/page4 as an acceptable solution