View Single Post
  #13 (permalink)  
Old 04-09-2008, 06:45 PM
Dave137 Dave137 is online now
Senior Member
 
Join Date: Oct 2007
Posts: 216
Dave137 is on a distinguished road
Smile

Quote:
Originally Posted by ryanklefas View Post
Minor update: This one will only take one trade per bar.
Good Start - I will evaluate it on demo with my settings and modifications like RSI(14) over and under 50 on entry, 14/42 EMA MA's 15-min scale, TP=30, also the gap between the short and long ma > 2*Point on entry (eliminates false entries) - Must say, Real nice clean programming! Try using EURJPY / USDJPY / GBPJPY as the currency pairs. One last entry condition is that Open[0]>Close[1] or Open[0]<Close[1].

Dave
<><<<

Since some crosses take time to widen before taking off, you may have to test various entry conditions on each current bar, and then check back several bars to see if an actual cross has taken place and then enter the trade - This took me a while to make this work. In your entry statement you have the current bar test, plus one bar back test for reverse condition. Just extend this by using a || (or) statement and test the bar back, and the reverse of this one bar back of the bar back bar.

Example of a setup entry statement to go long:
(MAS = MA-Short) (MAL = MA-Long)

if(MAS>MAL && MAS_1<MAL_1 || MAS_1>MAL_1 && MAS_2<MAL_2|| MAS_2>MAL_2 && MAS_3<MAL_3|| MAS_3>MAL_3 && MAS_4<MAL_4|| MAS_4>MAL_4 && MAS_5<MAL_5)
if(RSI1>50)
if(Open[0]>Close[1] ) {
BuyValue=1;
}

I have enclose the modified file to test:
Attached Files
File Type: mq4 Generic MA Cross Expert v1.1 mod1.mq4 (17.8 KB, 62 views)

Last edited by Dave137; 04-09-2008 at 08:05 PM.
Reply With Quote