Universal MA Cross EA - page 73

 

Some advice/help would be appreciated!

While I haven't posted much (if any), I have been following this EA and thread, and am using the ea, but am confused a bit by some of the fields in it, and was wondering if the inventor (FireDave?), or some "senior" members such as Robert or Blaiserboy (sorry if I got the name wrong), can explain some things and perhaps show me (and others) how to make some changes (add some things to it), to make it even better and more understandable for more people?

I saw that Robert added/changed some code on the Maxlookup and MincrossDistance (I think around page 68 of this thread), and I will try to make those changes to get a better understanding of MQL and how to program, which I know nothing about, but am trying to learn a little bit of.

Anyway, to my 1st question about this EA:

1) I was noticing that one of the fields is StopAndReverse (under the Exit Settings), and the description I thought was the answer to Chuck's post, for it sounds like if the trend/ma cross happens in the opposite direction while a trade is going on, the trade will exit and go in the new direction (IE: if there was a buy trade, but the ma's and price crossed to go short, then the current long trade would exit and a new short trade would be entered), but apparently that doesn't happen, as Chuck has eluded to, and certainly hasn't worked for me, when setting that field to true.

So my question is: What does this field really do, how does it work, and can someone create (and/or tell us what code to change/add to), to get this EA to function like I thought that field meant, and what Chuck (and probably many here) would really like this EA to do?

2) Can someone show me how to add yet more fields to this, such as:

Not taking trades unless an RSI value has also been crossed, in addition to the crossing of the MA's?

Is there a way to add if a stochastic line has crossed a certain value, much like the RSI indicator? And no, I don't mean the K and other period, or signal, or mode, but I do mean the VALUE. IE: Take your cursor and move it over a stochastic line and you should see a box that pops up with the name, the time, and then the VALUE - that's what I would like to ADD to this EA, only I don't know HOW, since I'm not a programmer!

What about being able to measure the pip difference between the top and bottom bol bands, so that when they're flat (and usually 10 to 15 pips or less in distance on a 5 minute chart), one shouldn't get in the trade until price breaks out above or below them, but as you all are probably aware, the ma's get crossed a LOT in a sideways market, and if one is trading a 5 min chart when that happens, one can lose a lot with all the crosses.

There have been some other good ideas by others in this thread, such as having the take profit/stop loss based on x # of bars back, or 1.5 times the adr or some such (I don't recall the exact suggestions), but I was wondering how hard it is to add those features into this one EA?

Being able to add some or all of these ideas into this EA sure would help everyone out, and make trading almost a really "set it and forget it" kind of EA (except for NFP and other heavy news times that one still has to watch out for), but for the majority of time, this one would really be GREAT.

If we could just get what Chuck is talking about incorporated into this EA, that would help out a LOT, for if the criteria (price movement and MA's) changed direction, one would want the current trade to close, and a new trade going in the opposite direction to open up, provided the settings for the new direction (an ma crossover) had actually happened (the settings in the EA for the MA's had been met).

Sorry for this long post, but until I can get some help to have the current trade close when the direction has changed, and open a new trade in the new direction automatically, I'll keep asking, 'cuz I have to watch the trade and screen a lot, and I'd like to be able to just "set it and forget it".

The other things I asked for would also help, but this is a "must have" to be able to walk away and let the system do what it does, which is what I think we're all looking for, aren't we?

Thanks ahead of time for your help and answers

Regards,

Paul

 

Universal MA Crossing EA - Notes

paulk:
While I haven't posted much (if any), I have been following this EA and thread, and am using the ea, but am confused a bit by some of the fields in it, and was wondering if the inventor (FireDave?), or some "senior" members such as Robert or Blaiserboy (sorry if I got the name wrong), can explain some things and perhaps show me (and others) how to make some changes (add some things to it), to make it even better and more understandable for more people?

......

There have been some other good ideas by others in this thread, such as having the take profit/stop loss based on x # of bars back, or 1.5 times the adr or some such (I don't recall the exact suggestions), but I was wondering how hard it is to add those features into this one EA?

......

The other things I asked for would also help, but this is a "must have" to be able to walk away and let the system do what it does, which is what I think we're all looking for, aren't we?

Thanks ahead of time for your help and answers Regards, Paul

Hi Paul,

It's been a while since I looked at the UnivMACross EA...and it's important to know there are many versions...so the following are general comments only...and not for a particular version.

MaxLookUp>0 && MinCrossDistance>0

This looked like a really good feature...but using the ">0" plus the "&&" (AND) forces both conditions to be used at the same time which limits your options...and it also prevented it from working on the current bar. I changed it by changing the MaxLookUp to "=>0"...so either value works with or without the other...and it works on the current bar also.

Stop and Reverse

Do a search for these terms (control F) to see where it is in the EA and what it does... I think you will find it only associated with the PureSAR settings...and it only works when PureSAR is set to TRUE. To answer your question about how to use this with MA's etc...you can try and place this Stop and Reverse function outside the PSAR function and get it to work with the MA crossing's etc.

Adding RSI and/or Stochastic

Check out the code section for using a Third MA { if(UseThirdMA==true) }... It is a good example of how you can add new features to this EA.

Use this format to add RSI and/or your Stochastic functions. Be sure to add an "extern" at the top to select the function (True/False) just like the Third MA does... This is your "HOW" to add new features to this EA...

Bollinger Bands - Pip difference between the top and bottom Bollinger Bands

I don't recall Bollinger Bands in the UMAC...but you can calculate the Pip difference between the top and bottom bands by simple math. Create the BBand variables in the EA and call the Bollinger Bands indicator to get the values...then just subtract Upper band from Lower band to get your pip distance.

PipDist = BollUpper - BollLower;

if(PipDist < 15) Do this...(or don't do this)...;

Set EA and Walk Away

Yes...that's the ideal goal for all our EA's...comes after much testing and building your confidence that your code is doing EXACTLY what you what it to do. A really great feeling when you accomplish that and actually see your EA taking trades and exiting on your conditions...!

------------------------------------------------------------

Nice to see you using this UMAC EA to learn your coding skills. I started here as well and had lots of fun learning some basic coding skills. My thanks to FireDave and others who have shared their great coding skills to learn from.

Just a suggestion - you also may want to look at PipMaker v17 for an even more flexible EA Template model...much easier to work with JMHO...and it already has your RSI and Stoch and many other great features built-in to learn from. I use this as one of my basic EA templates...

Hope this helps...and keep having fun learning new things.

Robert

 

Problem with IBFX ping fail

Hi

Can anybody help to solve my problem, please!

I use InterBank FX 5digts. EA returns "Ping failed" and "no connection". However my connection is working good. I had other EA Working with Interbank ok.

Thank you

H. Le

 
cosmiclifeform:
Hi Paul,

It's been a while since I looked at the UnivMACross EA...and it's important to know there are many versions...so the following are general comments only...and not for a particular version.

MaxLookUp>0 && MinCrossDistance>0

This looked like a really good feature...but using the ">0" plus the "&&" (AND) forces both conditions to be used at the same time which limits your options...and it also prevented it from working on the current bar. I changed it by changing the MaxLookUp to "=>0"...so either value works with or without the other...and it works on the current bar also.

Stop and Reverse

Do a search for these terms (control F) to see where it is in the EA and what it does... I think you will find it only associated with the PureSAR settings...and it only works when PureSAR is set to TRUE. To answer your question about how to use this with MA's etc...you can try and place this Stop and Reverse function outside the PSAR function and get it to work with the MA crossing's etc.

Adding RSI and/or Stochastic

Check out the code section for using a Third MA { if(UseThirdMA==true) }... It is a good example of how you can add new features to this EA.

Use this format to add RSI and/or your Stochastic functions. Be sure to add an "extern" at the top to select the function (True/False) just like the Third MA does... This is your "HOW" to add new features to this EA...

Bollinger Bands - Pip difference between the top and bottom Bollinger Bands

I don't recall Bollinger Bands in the UMAC...but you can calculate the Pip difference between the top and bottom bands by simple math. Create the BBand variables in the EA and call the Bollinger Bands indicator to get the values...then just subtract Upper band from Lower band to get your pip distance.

PipDist = BollUpper - BollLower;

if(PipDist < 15) Do this...(or don't do this)...;

Set EA and Walk Away

Yes...that's the ideal goal for all our EA's...comes after much testing and building your confidence that your code is doing EXACTLY what you what it to do. A really great feeling when you accomplish that and actually see your EA taking trades and exiting on your conditions...!

------------------------------------------------------------

Nice to see you using this UMAC EA to learn your coding skills. I started here as well and had lots of fun learning some basic coding skills. My thanks to FireDave and others who have shared their great coding skills to learn from.

Just a suggestion - you also may want to look at PipMaker v17 for an even more flexible EA Template model...much easier to work with JMHO...and it already has your RSI and Stoch and many other great features built-in to learn from. I use this as one of my basic EA templates...

Hope this helps...and keep having fun learning new things.

Robert

Thank you Robert for the tips on coding and suggestions, as well as telling me about PipMaker v17. I will look for that - I presume it's on this site also? Anyway, I will search for it here, and if I don't find it, will Google it.

Paul

 

error 130

a set a take profit and occur a error 130

anyone could me help?

tks

 

Ecn broker added ...

Try this one

It has an option for ECN brokers added. Set the ecn broker parameter (it is the first parameter now) to true, and it should work. I did not change the way it calculates stop loss and take profit so, if you are on a 5 digit broker you should multiply those with 10 to get values in pips

profitable:
a set a take profit and occur a error 130

anyone could me help?

tks
 

variable inside takeprofit

i want to use this formation in take-profit but a don't now how use the correctly way

double TakeProfit;

TakeProfit=(High)-( Low);

 

takeprofit

mladen:
Try this one It has an option for ECN brokers added. Set the ecn broker parameter (it is the first parameter now) to true, and it should work. I did not change the way it calculates stop loss and take profit so, if you are on a 5 digit broker you should multiply those with 10 to get values in pips

I wanted to use a variable as takeprofit

is this possible?

eg on my buy signal it to calculate a certain value in the graph

this type

max=High;

min=Low;

alvo=(max-min);

takeprofit=alvo;

 

...

Just in case ... added support for 5 digit brokers, so now you do not have to recalculate stop loss, take profit and trailing stop. It kept the ecn brokers support (if your broker does not allow placing stop loss and / or take profit along with order opening, set the EcnBroker parameter t true and then the EA will take care of the rest)

 
mladen:
Just in case ... added support for 5 digit brokers, so now you do not have to recalculate stop loss, take profit and trailing stop. It kept the ecn brokers support (if your broker does not allow placing stop loss and / or take profit along with order opening, set the EcnBroker parameter t true and then the EA will take care of the rest)

I am currently optimising universalmaea. Got to this thread to find universalmaea with breakeven option and mm based on stoploss. Would you to add the option mladen? This is a wonderful ea. Priceless!

Reason: