Thank goodness I found you !!

 

I'm so happy to have found this site. This is my first post so please someone reply!!!

I'm trying to develop some MT4 EA's. These are systems that I have traded profitably in the past whilst trading live without the benefit of automated trading.

I am trying release myself from the screen and to learn to program but I find it very difficult. The EA builders have helped but I am seemingly not able to incorporate many of my trading rules using them.

My first strategy is an ADX pullback system. For buys ADX >30, 130EMA and 130 SMA must be rising, DI+>DI-, current price26EMA. I have only 1 trade open at any one time and no trade may be opened while any of the previous 5 bars have crossed 26 EMA. For sells simply reverse the rules. I have backtested this with manual bar by bar testing and it is fairy robust but probably would benefit from optimisation.

I use a trailing stop of 20 pips and this strategy gives on average 1-2 trades per day on the 5 min bars. Works on all currencies but I only trade tight spreads.

My problems are that I have not found a way to express the rising EMA rule. the 'only 1 trade open' rule or the 'no trade within a 26EMA cross for 5 bars' rule using an EA builder.

Can anyone help please?

 
simongb:
I'm so happy to have found this site. This is my first post so please someone reply!!!

My problems are that I have not found a way to express the rising EMA rule. the 'only 1 trade open' rule or the 'no trade within a 26EMA cross for 5 bars' rule using an EA builder.

Can anyone help please?

Hi Simongb,

I'm just a novice coder but I think I can help with at least one question.

1) Only 1 trade open rule:

Requires a little more technical coding than my present novice skills. Hopefully one of the pro's here can help (they may need to see your code to help fix it) . If not, try mq4.com for lots of examples and help. Also many free EA's have a number of good examples of "only 1 trade" code logic. Check them out too.

2) 26EMA cross for 5 bars:

Not sure which crossing to compare this 26EMA crossing with - the price line or other EMA's...?

Check the crossing/time and count the bars...??

If 26EMA cross X < 5 bars ....Trade=false...??

If 26EMA cross X > 5 bars ....Trade=true...??

3) Try this for your 130EMA and 130SMA rising:

Current values greater than previous values = rising

if (130EMA(0) > 130EMA(1) && 130EMA(1 > 130EMA(2) &&

130SMA(0) > 130SMA(1) && 130SMA(1) > 130SMA(2) ) 130EMAand130SMArising=true ;

Hope this helps and good luck,

Robert

 

Thanks for that Robert, I will give it a try.

Good Luck !!

Reason: