Patrick DiMarco
Patrick DiMarco  


From time to time the EA fails to establish an SL and TP. Ex., G/U backtest m15...3/28-9//22. Evervthing fine until trade entered on 8/10, which was closed at stop on 9/22. No SL or TP entries show in the results. This has happend in various time frames, with virtually all of the pairs I have tested. Dejected...this looks to have great potential. EDIT: Live trade today, 9/24, no SL,TP. G/U, M15, 12:00 GMT candle. Looks like keeping Min. Cross Distance set to 0 eliminates the problem. Will keep testing...No, I have found, regrettably, no solution to the problem.


Settings for cross universal EA

The code for the universal Cross Ea wih my Settings at the 1H chart. EURUSD

Try it !! five digit Broker

//----------------------- INCLUDES


//----------------------- EA PARAMETER

extern string Expert_Name = "---------- Universal MA Cross EA v8.1";

extern int MagicNumber = 1234;

extern double StopLoss = 570,

TakeProfit = 370;

extern string TrailingStop_Setting = "---------- Trailing Stop Setting";

extern int TrailingStopType = 1,

TrailingStop = 550;

extern string Indicator_Setting = "---------- Indicator Setting";

extern int FastMAPeriod = 10,

FastMAType = 0, //0:SMA 1:EMA 2:SMMA 3:LWMA

FastMAPrice = 2, //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted

FastMAshift = 0,

SlowMAPeriod = 70,

SlowMAType = 1, //0:SMA 1:EMA 2:SMMA 3:LWMA

SlowMAPrice = 2, //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted

SlowMAshift = 0;

extern string CossDistance_Setting = "---------- Min Cross Distance Setting";

extern int MinCrossDistance = 1, //Always positive, 0:disable

MaxLookUp = 1; //Number of bar to keep checking for the entry condition

extern string Exit_Setting = "---------- Exit Setting";

extern bool StopAndReverse = false, // TURE:if signal change, exit and reverse order

PureSAR = false, // TRUE:no SL, no TP, no TS

ExitOnCross = false;

extern string ThirdEMA_Setting = "---------- Third MA Setting";

extern bool UseThirdMA = false,

UseCounterTrend = false,

OnlyCounterTrend = false;

extern int ThirdMAPeriod = 100,

ThirdMAType = 1, //0:SMA 1:EMA 2:SMMA 3:LWMA

ThirdMAPrice = 0, //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted

ThirdMAshift = 0,

CTStopLoss = 0,

CTTakeProfit = 0;

extern string Pivot.Setting = "---------- Pivot Filter Setting";

extern bool Use.Pivot.Filter = false;

/* reserve for future development

extern string BGFilter_Setting = "---------- BG Cross Filter Setting";

extern bool UseBGFilter = false;

extern int BGFilter = 20;


extern string Order_Setting = "---------- Order Setting";

extern bool ReverseCondition = false, // TRUE:buy-sell , sell-buy

ConfirmedOnEntry = true, // TRUE:entry on the next signal bar

OneEntryPerBar = true;

extern int NumberOfTries = 1,

Slippage = 5;

extern string OpenOrder_Setting = "---------- Multiple Open Trade Setting";

extern int MaxOpenTrade = 1,

MinPriceDistance = 5;

extern string Time_Parameters = "---------- EA Active Time";

extern bool UseHourTrade = true;

extern int StartHour = 4,

EndHour = 6;

extern string MM_Parameters = "---------- Money Management";

extern double Lots = 0.3;

extern bool MM = false, //Use Money Management or not

AccountIsMicro = false; //Use Micro-Account or not

extern int Risk = 10; //10%

extern string Alert_Setting = "---------- Alert Setting";

extern bool EnableAlert = true;

extern string SoundFilename = "alert.wav";

extern string Testing_Parameters= "---------- Back Test Parameter";

extern bool PrintControl = true,

Show_Settings = true;


hi all

i don't know how this EA open order trade, because 1 set PARAMETER indicator SMA like PARAMETER EA but it open order (buy/sell) dosen't like signal in indicator.

And I want use this EA for 1M chart , doesn't it??

sorry for my english


hi all,

First I would like to thank you all for such a wonderful forum.This is my first time posting here.

Regarding this EA I have set it up and trying to trade it in 5 Min time frame, have downloaded 5 digit EA - VA4 . and its showing smily face in upper right corner and I have some information on upper left corner.

Now my problem is, it is giving me crossing signal/Alert sound which I have disable but it hasnt traded yet.what am I doing wronge???

Can anyone plz help me here?

Thanks in advance,



Hi guys,

I also noticed the problem lotuseater mentioned in his post. So I looked at the code and fixed that problem, I am attaching the corrected version here with the same name.

I was also thinking if there is any way to limit the number of trades the EA takes after a target has been reached. For example, if I want the EA to stop trading for the day after it has reached say for example 50 pips in total profit or a $ amount (derived from either one trade or from several smaller profits); would that be possible to code into this EA?

I've coded an indicator to try this out that gives me the total profits for the day in $. Perhaps I will include it at the beginning of the EA as a conditional and if the requirement is met it should just return 0. Do you guys think that would work? I'm very new to coding.


The code for the universal Cross Ea wih my Settings at the 1H chart. EURUSD

Try it !! five digit Broker

//----------------------- INCLUDES



Backtested these setting for the past year. From Nov '09 to May 2010, it trades pretty much even the whole time. From May 2010 to November 2010, it is very profitable.



Backtested these setting for the past year. From Nov '09 to May 2010, it trades pretty much even the whole time. From May 2010 to November 2010, it is very profitable.

Good finding man, will check it out.


Hey Dave

Your EA is very great and matured.

One question, I tried to add one function to modify your EA for test.

Buy or Sell by ema cross, and close orders by other function like Boiling bands scalping function.

But it keeps immediate opening orders in the same row after exit buy/sell.

How can I modify it?


Hi Traders!

I have a raw idea that i think could be nice to test if some one could be helpfull

If its possible some one perhaps could help me to code the

Universal Moving Average cross with John Ehlers MAMA bands instead of useing : Fast MA and Slow MA but keep the third MA as a filter

I think this can be very effectfull on smaler TF.