Download MetaTrader 5

Signal based on two custom Indicators

To add comments, please log in or register
Publish your application in Cobe Base. Millions of traders will see it!
art1-0
8
art1-0 2013.10.14 15:19 

Hello,

I have big problems getting my two indicators together.

I made two custom indicators, one is the Parabolic SAR, and the other is an averaging method, similar to MA. The Parabolic SAR Indicator looks like this one:

https://www.mql5.com/en/code/viewcode/43/10703/parabolicsar__3.mq5

I don’t have much programming knowledge, so I am depending on the articles from mql5.

My plan is to generate a Signal when both Indicators show in the same direction. But I don’t know how to do that.

How do I generate that Signal? I know that I need to create a class which is derived from the CExpertSignal Class like in the following example:

https://www.mql5.com/en/articles/691 

But I just don’t get the interaction between the indicators and the Signal. I didn’t find an article which includes two indicators and a signal based on theses indicators.

Shouldn’t the Signal have access to the Buffers made in the indicators? If not, where is the place to define the conditions?

And if I create the Signal finally, where do I write the code to make the Expert trade automatically?

Thank you very much in advance!  

Alain Verleyen
Moderator
30688
Alain Verleyen 2013.10.14 15:27  
art1-0:
...

Hello, you only have to create a class if you want to create an automatically with MQL5 Wizard, is it well what you want ?

If yes then this article Create Your Own Trading Robot in 6 Steps! seems to me better, though it's also only for 1 indicator. You can also find a full reference for the Wizard in this topic : All about MQL5 Wizard : create robots without programming.

You can post the code of your attempt if you need help. Also you have to define precisely your signal condition, "both Indicators show in the same direction" isn't very clear to me.

art1-0
8
art1-0 2013.10.14 15:40  
angevoyageur:

Hello, you only have to create a class if you want to create an automatically with MQL5 Wizard, is it well what you want ?

If yes then this article Create Your Own Trading Robot in 6 Steps! seems to me better, though it's also only for 1 indicator. You can also find a full reference for the Wizard in this topic : All about MQL5 Wizard : create robots without programming.

You can post the code of your attempt if you need help. Also you have to define precisely your signal condition, "both Indicators show in the same direction" isn't very clear to me.

Thank you for your quick answer! Yes, I want to let the Expert Advisor trade automatically for me, if that was  your question. The Signal condition is: Buy if the ParSar is below the price of the analyzed bar AND the close price of the bar crosses the averaging indicator downwars. Close position when Parabolic Sar reverses.

I will try the articles which you proposed. 

Alain Verleyen
Moderator
30688
Alain Verleyen 2013.10.14 16:05  
art1-0:

Thank you for your quick answer! Yes, I want to let the Expert Advisor trade automatically for me, if that was  your question. The Signal condition is: Buy if the ParSar is below the price of the analyzed bar AND the close price of the bar crosses the averaging indicator downwars. Close position when Parabolic Sar reverses.

I will try the articles which you proposed. 

Great, let us know how that works for you.
To add comments, please log in or register