Simple EA Help Needed

 

With respect to the indicators attached below, can some body help with the codes to create a very simple EA using iCustom based on the following rules:


If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open Buy order when MACD crosses zero upwards on the 5m time frame

If Price touches the SHI_Channel_Colour_Talk's upper boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open sell order when MACD crosses zero downwards on the 5m time frame.

Thanks.

 
You can have people code Experts for you at this Link.
 
ubzen:
You can have people code Experts for you at this Link.

I am actually learning to code in MQL4, and I have been trying things out (like coding some of my ideas) but then i ran into a little problem with respect to the SHI_Channel_Colour_Talk indicator, that's why i am asking for a little help just to put me on track. The problem is, in the condition for opening buy/sell order

Which is: If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open Buy order when MACD crosses zero upwards on the 5m time frame and If Price touches the SHI_Channel_Colour_Talk's upper boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open sell order when MACD crosses zero downwards on the 5m time frame.)

I do not know how to spell this statement "If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse,........ If Price touches the SHI_Channel_Colour_Talk's upper boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse,......." in MQL4 codes that's the problem I am having.

 

Have you tried looking at the basics of the book?

How much programming experience do you have?

You should post the codes you've already written. Use the SRC button above for that.

 
ubzen:

Have you tried looking at the basics of the book?

How much programming experience do you have?

You should post the codes you've already written. Use the SRC button above for that.


To your first question, Yes.As a matter of fact the "Book" (book.mql4.com) is what i studied and still studying.

Not much experience. I only code my ideas so that i can further test it automatically.

The thing is, i have a strategy that is made up of a couple of indicators which i have been testing for a while now. I intend to create an EA based on the strategy so that i can test it with the MT4 strategy tester and further test it automatically with out me having to sit in front of my computer all day. With my little MQL4 knowledge which i have gained from book.mql4.com and from contribution here on this from, I know how to code the conditions for the other indicators, but i how no idea on how to write the code for the condition to be met by the SHI_Channel_Colour_Talk indicator for the ea to open a buy or sell condition (which is If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open Buy order when MACD crosses zero upwards on the 5m time frame and If Price touches the SHI_Channel_Colour_Talk's upper boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open sell order when MACD crosses zero downwards on the 5m time frame) Thats why i just paired the indicator SHI_Channel_Colour_Talk with MACD, hoping some one can help me write a simple EA with the above conditions for opening trade so that I can have an Idea. I hope you understand now. I will Love it if you can help. Thanks.

 

I will look at it but no promises. Me busy too, you know. That's not simple EA for newbie. Have to be carefully coding them.

It also involving trendlines, calculating their values from different tf, will be a little headache !

 
onewithzachy:

I will look at it but no promises. Me busy too, you know. That's not simple EA for newbie. Have to be carefully coding them.

It also involving trendlines, calculating their values from different tf, will be a little headache !

I would really love it if you can look into it for me. You are far too kind. Thank you.
 

1. You define it only the condition to open position, my question is, what is the condition to close those positions ?

2. There's this CI, it's called i-Regr (Click here), I know that i-Regr is not SHI_Channel_Colour_Talk, but the problem is SHI_Channel_Colour_Talk is using trendlines - something that a little bit difficult to calculate especially if we have to call it from different TF, while iRegr is using indicator buffer which much more easy. I was thinking maybe we could change SHI_Channel_Colour_Talk a little so we can call it from different TF, like i-Regr. This gonna takes time to make SHI_Channel_Colour_Talk using buffer and not trendlines anymore, without making any error.

3. First, for a start, let me give you example of that condition for 5 minutes timeframe. This is for Lower SHI Channel ...

double M5_Data_Lower_SHI_Channel_Colour_Talk;

if (iLow (Symbol (), PERIOD_M5, 1) <= M5_Data_Lower_SHI_Channel_Colour_Talk && // <<== If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m
    iLow (Symbol (), PERIOD_M5, 0) >  M5_Data_Lower_SHI_Channel_Colour_Talk )  // <<== ... and begins to reverse

... and this is for the upper one. Those are the condition for 5 minutes only, you ask for 4 timeframes. That's a lot !.

double M5_Data_Upper_SHI_Channel_Colour_Talk;
    
if (iHigh (Symbol (), PERIOD_M5, 1) >= M5_Data_Upper_SHI_Channel_Colour_Talk && // <<== If Price touches the SHI_Channel_Colour_Talk's Upper boundary on the 5m
    iHigh (Symbol (), PERIOD_M5, 0) <  M5_Data_Upper_SHI_Channel_Colour_Talk )  // <<== ... and begins to reverse

However, we have to work that SHI Channel first :)

I hope you don't mind waiting, I don't have much time, so I'll write later.

 
sugarboy234:

With respect to the indicators attached below, can some body help with the codes to create a very simple EA using iCustom based on the following rules:


If Price touches the SHI_Channel_Colour_Talk's Lower boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open Buy order when MACD crosses zero upwards on the 5m time frame

If Price touches the SHI_Channel_Colour_Talk's upper boundary on the 5m, 15m, 30m and 1h time frame and begins to reverse, Open sell order when MACD crosses zero downwards on the 5m time frame.

Thanks.


do you have an ea you have started yet

if so you need to put that up

we can then possibly add some code for you

the SHI_Channel_Colour_Talk's output can be captured ok making it output on several time frames at the same time would be the hard part for me

any way I am happy to help where i can if you got something to start with

 
onewithzachy:

1. You define it only the condition to open position, my question is, what is the condition to close those positions ?

2. There's this CI, it's called i-Regr (Click here), I know that i-Regr is not SHI_Channel_Colour_Talk, but the problem is SHI_Channel_Colour_Talk is using trendlines - something that a little bit difficult to calculate especially if we have to call it from different TF, while iRegr is using indicator buffer which much more easy. I was thinking maybe we could change SHI_Channel_Colour_Talk a little so we can call it from different TF, like i-Regr. This gonna takes time to make SHI_Channel_Colour_Talk using buffer and not trendlines anymore, without making any error.

3. First, for a start, let me give you example of that condition for 5 minutes timeframe. This is for Lower SHI Channel ...

... and this is for the upper one. Those are the condition for 5 minutes only, you ask for 4 timeframes. That's a lot !.

However, we have to work that SHI Channel first :)

I hope you don't mind waiting, I don't have much time, so I'll write later.

First I would like to say thank You for the effort and Idea. With respect to how the strategy is, we cant alter SHI_Channel_Colour_Talk. The only thing we can do is to use the indicator Forex Trend fxfariz Custom Indicator attached below in place of MACD and then use values of SHI_Channel_Colour_Talk on the 1hour time frame only. Now the condition for opening orders using the iCustom function will now be: If Price touches the "SHI_Channel_Colour_Talk's" Lower boundary on the 1h time frame and begins to reverse, Open Buy order "when Forex Trend fxfariz" crosses zero upwards on the 5m time frame

and

If Price touches the "SHI_Channel_Colour_Talk's" upper boundary on the 1h time frame and begins to reverse, Open sell order when "Forex Trend fxfariz" crosses zero downwards on the 5m time frame.

(Typo Corrected)

And to your first question "1. You define it only the condition to open position, my question is, what is the condition to close those positions ?" there is no condition for closing the trades. The EA is to place a preset take profit and stop loss along with the order.

Thank You so so much for your help and contribution. Hope to hear from you again as soon as possible.

 
Tradingjunky:

do you have an ea you have started yet

if so you need to put that up

we can then possibly add some code for you

the SHI_Channel_Colour_Talk's output can be captured ok making it output on several time frames at the same time would be the hard part for me

any way I am happy to help where i can if you got something to start with



The thing is I am trying to Create an EA by using the iCustom function to call the values of indicators for opening trades, but i have no idea on how call the values of the SHI_Channel_Colour_Talk indicator on multiple time frame. So I was hoping that people like You who know better could help me out. Thank you.
Reason: