[WIP] Cowabunga MT4 Expert Advisor

OK Kepler,

Thanks for your reply. If I get time to look at the code of your EA then I’ll keep you posted with any updates that I make / results etc.

Kind regards,

Pipalot :slight_smile:

Thank you for your help! :slight_smile:

COWABUNGA EA CONSIDERATIONS

I got interested in Cowabunga in my search for better entry systems for an automated trader.
These are my observations, thoughts and improvements to the EA.

  1. WHAT we are doing is more important than HOW to code this or that aspect. We must always come back to this.
    WHAT am I doing with this EA?
    I am trying to help code the EA EXACTLY as Big Pippin does it.

  2. To really code what Big Pippin is doing, you need to study his blog.
    He lays out his rules (in ‘Read this First’ - find it in the blog) but you also have to look carefully at what he DOES, as the rules are not always precisely stated.
    I have observed that unless - perhaps - a trader has a strong math/science type background, his statement of the rules is likely to be “in the ballpark”, but not precise enough to code and get good results.

For example, Big Pippin does not necessarily trade on the same bar as an MA cross, or the next bar.
So, for how many bars after each timeframe’s cross is a trade valid?
That is the kind of rule that can be coded and a computer can follow.
On the 4 Hour chart he takes the trend as EMA 5 above (or below) the EMA 10, for many bars after the cross, essentially until the re-cross.
But on the M15 chart he usually trades soon after the MA cross. I have set it up for 5 bars, but you can experiment, changing the variable ‘MaxMACrossShift’ in the Strategy Tester, “Expert Properties” screen. I have not reviewed all of Big Pippin’s blog to find what is the value that 90 or 95% of his trades fall within, (4 bars? 10 bars?) so I eyeballed a bunch and started with 5.

  1. A bar’s time is the OPEN time. For backtesting, the close of the current bar is not usable, I believe because it is already known to the program when the bar opens: but you can use the OPEN of the current bar, and for consistency, prior bars. OR use Closes up to the previous bar.
    It would be interesting to backtest two versions AFTER all else is correct, to compare using OPENs up to the current bar (shifts of 0 and 1), to the present code which has closes of the previous two bars (shifts of 1 and 2). the differences would not be great I think, but we could be surprised.

CODING SPECIFICS:

  1. Solved: Not taking trades. Because of coding logic: it only took a trade ON the 4 Hour crossover bar, but Big Pippin actually considers the Main trend as when (for long) the 5 EMA is above the 10 EMA. This is true for many bars at a stretch.

  2. Need to use Metatrader’s OSMA, not MACD, to match Big Pippin’s charts. Kept this.

  3. Added code to prevent a trade opening on the same bar as a close of trade. Avoids unprofitable mess

  4. I setup Profit and Maxstop in pips instead of decimals, for ease of use.

  5. Added a MinStop to always give the price some “wiggle room”.
    Setting MaxStop to 500 and MinStop to 0 effectively nullifies them.
    MaxStop and MinStop would ideally not be there if all Big Pippin’s rules are coded, and work well.

  6. Corrected coding errors in the exits (*Point).

  7. Recoded the initial stoploss calculations to occur before order entry. Orders should have stops in case your connection fails.

  8. Changed some of the logic to more closely match what Big Pippin does.

WORK NEEDED TO BE DONE

Add Money management. I prefer simple code based on Larry William’s system. This is to keep you out if the stop is too wide, per Big Pippin.

Exits. Code the exits as Big Pippin describes and shows. A TakeProfit of 20 or 30 is not what the doctor ordered.
And also code the “exit by 4 PM.”

Close trades before news events.

I hope someone else can tackle this.
Many of these are contained in EA’s at ForexTSD. (I read a lot at ForexTSD.)

Testing! If you find some consistently profitable settings let us know!


FINAL THOUGHTS

I do not ever expect a perfect match between the EA and Big Pippin’s trades. A 2/3 correlation would be quite good.

WARNING: Even if profitable this program is not safe to trade with real money as it does not have sufficient error handling, etc.

Final Point: I repeat:
WHAT we are doing is more important than HOW to code this or that aspect. We must always come back to this.
WHAT am I doing with this EA?
I am trying to help code the EA EXACTLY as Big Pippin does it.
(That will also give us a reference to try changes and compare to the ‘pure’ Cowabunga system.)

Let us know what you find out with it!

Big Be,

Nice to see your still working on this. Just a couple thoughts. The advisor runs fairly slowly in backtesting.

You are checking your 4H and 15Min info with every tick. The 4H info really doesn’t change that often and I believe that doing this manually you would probably only check after a new 4H bar has come out.

Big Pippin only opens trades on the close of a bar. With the expert advisor, it is easiest to do this on the first tick of the next bar(as I believe you have talked about). Again, while manually trading this system one would watch for the signals, if they happen in the middle of a bar, wait until the end in order to ensure that it is not a fake out. But in an automated system we need to simply check on the first tick of the bar if the previous bar’s close values give us the signal. If you limit all your logic to the first tick in a bar, things will run faster and be more accurate to the system.

I too am working on an EA for this, but I am as of yet unwilling to release my source code. My backtesting shows the system opening positions when the indicator says to, but I am still loosing money. I won’t release a loosing EA.

GentooGeek,
Thank you.

You said,
“I too am working on an EA for this, but I am as of yet unwilling to release my source code. My backtesting shows the system opening positions when the indicator says to, but I am still losing money. I won’t release a losing EA.”

Does the trades it takes match Big Pippin’s?

I wouldn’t let the profit be my standard - and here is why:
Most systems when automated do a lot worse than when manually traded.
I have observed that the computer can not SEE that which the trader’s eye sees. It only calculates based on the rules you give it. It sees every match of the rules, including many, many that you did not intend.

For that reason I hope an Expert Advisor (EA) can be created that matches what Big Pippin says and does, then ask him to look at a (long) series of actual trades it takes (such as with the Strategy Tester), and say which trades he would not take and WHY. There may be a little filter (rule) or two that he does not even realize he applies.

Collaboration may get us there. If we stick to the plan.  In most EA thread's at ForexTSD, collaboration involves adding every indicator except the kitchen sink.  To me that means the original idea is inadequate, at least for automating.

You said,
“If you limit all your logic to the first tick in a bar, things will run faster and be more accurate to the system.”

Sounds great! Do you know how to code that?

Big Be

Big Be,

As far as I can tell my EA opens trades when Big Pippin’s does. I have requested an excel file from him with a history of the trades that his system has made so that I can cross check without having to go to each blog post and manually check things. I have not yet gotten my system to exit the way that Big Pippin does. My code is already growing fairly complex, and I think I may need a small rewrite to get things straightened out.

As for coding on the first tick of a bar:
if(Volume[0] == 1){
//do something
}

GentooGeek

GentooGeek,
Thank you. Would you like the MM code I referred to? (It is short.)
Can I e-mail you?

Big Be

The MM code would be interesting. I have not yet played much with any money managment tools.

GentooGeek

GentooGeek,
As you set your user settings to NOT receive e-mail, I cannot send to you unless you email me with an address.

I want to send this privately.

Big Be

Before I wrote my last post, I allowed users to email me. You should be able to email me.

Hey guys - been looking for a Cowabunga EA and came across this thread… Any progress on it? I’m trying to learn MQL4 so that one day I can give back to the pipping community what they’ve given to me.

Keep up the awesome work!

Did you ever get the swing high/low code working? I will post mine if yours doesn’t work sufficiently.

Hey guys,

Sorry for not responding. I have been busy with other things and haven’t had a chance to look at this. It has been a while since I looked at this, but from what I can recall I was having trouble getting the backtests to match the trades that were posted. I now have a machine on which I could run this in a demo account to forward test, but it looks like the surfer dude is on vacation.

I am not sure if I will have much if anytime to work more on this before summer.

GentooGeek

Hi all,
I was wondering, who has the latest code on the EA?

I’m working on Cowabunga EA myself too, but it was made from scratch and I’m sure there’s still a lot of things to do. I have some spare time to work on this one, and I’m looking forward find people who are also interested in it.

i have my version too and notes about what to change if any1 wants to. had no idea there were so many cowabunga EAs lol thought i was the only 1 but good thing im not

Hi guys, found this website a few days ago that gave a free Cowabunga EA.

thetrademachine.com/blog/2009/10/29/cowabunga-expert-advisor/

I downloaded it and backtested it on M15 from May 2009 to August 2009 and my balance shrunk from 25000 to 24301 … doesnt seem to fit in with the publiched results. Was wondering if you guys could try it and see if it works?

:mad:i have heard about a new feature of meta trader 4. it allows the use of excels for charting and graphing that also without the knowledge of typical language. can any one tell any thing more about it.

with regards
dave

I believe you are referring to DDE linking? You can use it to display prices from MT4 in Excel and then use VBA to code a system…but getting MT4 to read your signals from Excel is rather more tricky but can be done.

You might find it easier to just code in Mql (MT4), than coding in both Mql and VBA

Did you open a H4 chart and leave it open before opening the M15 chart and attaching the CowabungaEA ? You can also then load the original Cowabunga Indicators for monitoring.

btw I’m currently running a ‘controlled’ test for the CowabungaEA with the hope of developing and establishing quality ‘settings’, an automated AvoidNews addon and an additional Neural Net adviser between the selected currency pairs.

The test is running on a $5000 AlpariUK-Demo account, trading GBP/USD , GBP/JPY , GBP/CHF - All 3 currency pairs will trade from 08:00 to 22:00 GMT on the ‘default’ settings.

Live MT4stats are available - you can find the thread in > Expert Advisors and Automated Trading.

:slight_smile:

can not find or connect to the CowabungaEAv4.mq4 how do i get it please