Go Back   BabyPips.com Forex Forum > "The Holy Grails" > Free Forex Trading Systems


Free Forex Trading Systems Got the "Holy Grail" system? Want to share it for free and become everyone's hero? This is the place to do it. (No advertisers please!) Also, follow along as our very own Pip Surfer posts daily updates from his Cowabunga System in the Pip My System Forex Blog.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-22-2007, 03:17 PM
Newbie
 

Join Date: May 2007
Posts: 11
Lightbulb [WIP] Cowabunga MT4 Expert Advisor

Hello there,
I'm trying to write the code in order to create a "Cowabunga Expert Advisor" for MetaTrader 4 platform. Starting from the indicator i found here - Cowabunga.mq4 - (sorry, I don't remember the author) I wrote some functions, defined the buy and sell market enters, and for simplicity for now the program closes a position when you are gaining or loosing 20 pips (obviously this is not the Cowabunga system, but I want to test the first part of the code for now).
I've tried to test the advisor into MT but it seems not working as expected, you can download the file CowabungaEA.mq4 and verify it on your own: it opens a lot of positions and closing them immediatly, and NOT when the original Cowabunga indicator shows the arrow signal. I made some mistakes (I'm not an expert programmer)!

If someone that can do the work could help me... It would be useful for many of us, I think
Reply With Quote
  #2 (permalink)  
Old 09-22-2007, 09:58 PM
Newbie
 

Join Date: Feb 2007
Posts: 32
Thumbs up E A

Glad to see someone is working on an EA. Maybe someone can help fill in the gaps to make it work. Good-Luck
Reply With Quote
  #3 (permalink)  
Old 09-23-2007, 03:26 AM
Newbie
 

Join Date: May 2007
Posts: 11
Default

Quote:
Originally Posted by craigfx View Post
Glad to see someone is working on an EA. Maybe someone can help fill in the gaps to make it work. Good-Luck
That's what I hope. Sorry but I'm not really good programming, I'm doing my best to do this stuff work, but I need a help...

Last edited by kepler; 09-23-2007 at 04:28 AM.
Reply With Quote
  #4 (permalink)  
Old 09-24-2007, 06:33 AM
Newbie
 

Join Date: Jul 2007
Posts: 14
Default

Well those lines of a Billion > < == %% || statements makes its almost impossible to comprehend what is going on. I also prefer to make seperate functions to control the program, instead of lumping everything in the start().

for instance you could do something like

Code:
int stochCross(double stoch1, double stoch2)
{
   static int direction = 0;
   static int new_direction = 0;
   
   if(stoch 1> stoch2)
       direciton = 1;
   if(stoch 1 < stoch 2)
       direciton = -1;

   if(direction != new_direction)
   {
        new_direction = direction;
        return(new_direction);
    }
return(0);
}

From there in start just reference:
signal = stochCross(stoch1, stoch2);
then from there something like
if(signal == 1)
placeorder;
etc.
makes for less messy code, and code that people can read. Also eliminates the need for current_stoch and previous_stoch.
Reply With Quote
  #5 (permalink)  
Old 09-24-2007, 07:27 AM
Newbie
 

Join Date: May 2007
Posts: 11
Default

Hello Eight, thank you for the reply!
You are right, the code will be more readable with some sub-funcions, I will re-write all the stuff soon; for the moment I've corrected a lot of stupid errors I made before and now it seems to be working as expected (regarding the market-entry section).

Stay tuned.
Reply With Quote
  #6 (permalink)  
Old 09-24-2007, 08:31 AM
Junior Member
 

Join Date: Jul 2007
Posts: 87
Default

we are waiting impatiently
is it going to take foever?????????????/

Quote:
Originally Posted by kepler View Post
Hello Eight, thank you for the reply!
You are right, the code will be more readable with some sub-funcions, I will re-write all the stuff soon; for the moment I've corrected a lot of stupid errors I made before and now it seems to be working as expected (regarding the market-entry section).

Stay tuned.
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 12:34 PM.
Content Relevant URLs by vBSEO 3.3.1
"Pain is inevitable, suffering is optional"
Origin Unknown
Feedback Form