![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
waustin,
I took a look at your code. However, it was impossible for me to read it to find the problem with the missing curly brackets. Like I said before, it is impossible for me to debug it and it will be more time efficient for me to write an EA to your specifications.
You should start off by reorganizing your code with brackets properly commented.
Hi There
I actually took a quick look at your code, just in case it was something simple.
I think that there are probably mis matched brackets, but once youve fixed these I think you'll get a bunch of other errors as well !
for example, i was puzzled by this section of code
//+------------------------------------------------------------------+
//| Signal Entry |
//+------------------------------------------------------------------+
{if ((EMA1now > EMA2now) && (EMA1previous EMA2after))
{CrossUp5_13};
Its obvious that your testing for a cross of the MA's but then you have the line {CrossUp5_13};
In all likelihood I think you need to be assigning a boolean value to this variable e.g CrossUp5_13=True;
You initially dimension this variable as a double precision, and you actually assign it a value, but later your using it as if it where a boolean in the line
if (CrossUp5_13 && CrossUp13_62) Order = SIGNAL_BUY;
Your also going to hit problems with the line
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
Youve previously defined the variable counter as a double precision number, Im pretty certain tha the High and Low functions require integers as arguments.
The best advice I can give is to sort out the formatting of the curly braces, so the code is at least readable, and you can then at least try to match up the pairs.
Other obvious approaches are to cut sections of code out, and add them back incrementally one small piece at a time. This might help you find the mis matched curly bracket, they can be difficult to track down, and as others have suggested almost impossible if your unsure what the code is supposed to be doing
regards
zup
Thank You. However, I'll say again, I'm not asking anyone to program or develope this strategy idea. I would just like to get some guidance or assistance to help me figure out and eliminate the compile errors I am getting. Because until I get the EA to compile, I can't even test what I've done myself.
As far as the validity of the strategy, it has been a manually proven strategy, as well as variations of it, used by many traders in the past and present. Yes, I agree that each trader may use or apply entry/exit rules a bit differently, but the method is still basically the same.
Thanks Again.lol. hey kid did u ever think maybe u just dont have what it takes? u know - the 'right stuff' to trade fx with the big boyz not 2 menton even writeing ea's? heh. beside moving avg ea's never work. u'll shoot yer eye out kid. lol. my advice 2 u is go back 2 flippin burgers or cutting grass 4 ur money.
lol. hey kid did u ever think maybe u just dont have what it takes? u know - the 'right stuff' to trade fx with the big boyz not 2 menton even writeing ea's? heh. beside moving avg ea's never work. u'll shoot yer eye out kid. lol. my advice 2 u is go back 2 flippin burgers or cutting grass 4 ur money.
squiggle,
I don't know whether he has it or not. However, he is entitled to try and try his best. Anyone who is trying is a winner in my eyes.
As for moving average EAs not working, you are right. They need some twists and a filter or two. Check out the performance by vdiddy on the mql contest. He is not winning but has been in top 10. His EA is based on moving averages but with a twist.
lol. hey kid did u ever think maybe u just dont have what it takes? u know - the 'right stuff' to trade fx with the big boyz not 2 menton even writeing ea's? heh. beside moving avg ea's never work. u'll shoot yer eye out kid. lol. my advice 2 u is go back 2 flippin burgers or cutting grass 4 ur money.
Actually, I have traded manually for a while and have been somewhat successful with manual trading. I am at least in the profit, albeit it's not a huge profit. And, no, i never indicated that I'm as good as the big boys that have been trading for years. That's why I'm on here every day and night learning what I can. And, why are you a member of this forum. From your profile it appears you just joined the forum on 11/29. So, other than your obnoxiousness, what constructive have you accomplished or contributed to the forum? Nothing from what I've seen.
Also I have openly admitted that I am not a programmer. but at least i am attempting to learn. And if Moving Avg EA's never work, then why do there seem to be so many people successfully using them. And, as far as my career, not that it is any of your business, but i have quite a good career as a Professional Engineer! What may I ask is yours, not that you will admit it. based on your reply it seems you must have some knowledge yourself about flippin burgers and cutting grass.
And, finally, as far as your advise goes, in my opinion, it's not worth the pile of crap my dog leaves in the yard, which I would shovel up and throw in the garbage, just as I will with your advise.
So, in consideration of you, i will ignore any further reply posts you may have for me. And don't bother trying to PM me, because you, and only you, are now officially on my ignored list.
To the forum membership, I apologize for responding to this idiot and justifying his existence. I guess all communities have their share of jerks and idiots, and it appears that this is no exception.
Hi There
I actually took a quick look at your code, just in case it was something simple.
I think that there are probably mis matched brackets, but once youve fixed these I think you'll get a bunch of other errors as well !
for example, i was puzzled by this section of code
//+------------------------------------------------------------------+
//| Signal Entry |
//+------------------------------------------------------------------+
{if ((EMA1now > EMA2now) && (EMA1previous EMA2after))
{CrossUp5_13};
Its obvious that your testing for a cross of the MA's but then you have the line {CrossUp5_13};
In all likelihood I think you need to be assigning a boolean value to this variable e.g CrossUp5_13=True;
You initially dimension this variable as a double precision, and you actually assign it a value, but later your using it as if it where a boolean in the line
if (CrossUp5_13 && CrossUp13_62) Order = SIGNAL_BUY;
Your also going to hit problems with the line
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
Youve previously defined the variable counter as a double precision number, Im pretty certain tha the High and Low functions require integers as arguments.
The best advice I can give is to sort out the formatting of the curly braces, so the code is at least readable, and you can then at least try to match up the pairs.
Other obvious approaches are to cut sections of code out, and add them back incrementally one small piece at a time. This might help you find the mis matched curly bracket, they can be difficult to track down, and as others have suggested almost impossible if your unsure what the code is supposed to be doing
regards
zupthanks alot for the advise. I will look at the issues you mentioned and work on fixing them.
oh please not Mooving average EA again !
Hi. I had a go at an EA. Unfortunately as coded, the strategy doesn't seem profitable. Anyway, check it out.
Sheesh...
People please, forgive those who know not, for they are only trying to KNOW.
waaustin, I know it can be frustrating to see all these other threads gettin' some love but your question not being answered, and then people jump down your throat when you try to squeek a little louder when you remember the old "who gets the oil?" proverb...
Keep working at it - even if this strategy doesn't work, you'll learn something and take that next step and get a little better. AND, forgive those who KNOW, for they forget that at one point they knew not. I have yet to meet the man who dropped out of his Mama knowing when to buy or sell...
If you really want to learn to program MT4, try something more simple than an EA. Program an indicator that simply plots the highs or lows, etc. Once you get the simple stuff working, you can take the bigger steps towards doing something like an ea. I know, its probably not the answer you want to hear, but... Its an answer.
The point was made before about debugging someone else's stuff being tough - well, I'll echo that and also add that for most programmers, it ranks up there with stapling ones own nuts to a brick and dropping the entire "package" from a large height.![](https://c.mql5.com/forextsd/smiles/cry_smile.png)
Its easy to get weary with this stuff - just keep plugging along.
Anyway, this has been an attempted public service message from the human decency department.
We now return you to your regularly scheduled flame fest.
Good trading to all,
CS
Strictly trading off of the MAs does not always pan out since one will get whipsawed to death. Just I know that when you go back in the charts looking for those crosses, it looks beautiful, but that is after the fact. If you are doing good trading off the MAs, then its a plus for you, and don't mind what anyone else may think, but be careful.