Forex
Google
New signals service!

Go Back   Forex Trading > Trading systems > Ema Cross


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

View Poll Results: What do you think about Counter-Trend strategies?
They are good. 197 30.12%
They are bad. 99 15.14%
Good strategies! But have to be well programmed. 240 36.70%
I don’t know what you are talking about. 133 20.34%
Multiple Choice Poll. Voters: 654. You may not vote on this poll

Reply
 
LinkBack (10) Thread Tools Display Modes
  #111 (permalink)  
Old 02-15-2006, 11:34 PM
Audio's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 140
Audio is an unknown quantity at this point
nowonder some said it cant be done!

Last edited by Audio; 02-16-2006 at 01:10 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #112 (permalink)  
Old 02-16-2006, 04:06 AM
Junior Member
 
Join Date: Nov 2005
Posts: 17
dedywind is on a distinguished road
@codersguru:

thank you for great effort...

After attached your EA (http://www.forex-tsd.com/9264-post100.html) in 4pair eur/usd, gbp/usd, usd/chf, gbp/jpy.... three pair immediately started open trade (gbp/usd, usd/chf, gbp/jpy) and all of them have good result....


I dont know anything about programming... but based on this advised:

Quote:
Originally Posted by gkozlyk
For the arrows being reversed, just swap the 2 arrow numbers in the code, then problem is solved. Compile afterward for it to take effect on all charts the indicator is applied to

Graham
I do make small change in EA:

if(line1>line2)current_direction = 1; //up
if(line1<line2)current_direction = 2; //down

To

if(line1>line2)current_direction = 2; //up
if(line1<line2)current_direction = 1; //down

Yesterday, I attached this EA to neuimex demo account TF30 in four pair.... and all of them have good result to....

I will continue to forward testing those EA for another 2/3 weeks....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #113 (permalink)  
Old 02-16-2006, 04:22 AM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
In the next modification i might put in another switch so if users want to do reverse trades on the cross they can (as in if the fast EMA goes above the slow, you do a sell). In my visual backtesting, it seems less profitable than going with the cross immediately then as the trades gets older looking for a reverse trade.

Another idea i had was to maybe wait a bar to take the trade after the cross (this might prevent those times the currency pokes through then goes the other way)

I found another EMA cross program on this website had some good ideas.

CROSSING EMA 5 x EMA 13
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #114 (permalink)  
Old 02-16-2006, 05:04 AM
Senior Member
 
Join Date: Jan 2006
Posts: 135
radicalmoses is on a distinguished road
Codersguru,

With respect to the MM part of trading.

Starting with 10,000$ account:

(account equity * risk %)/ largest loss = lots to trade


(10,000* 10%)/ 50= 2 lots


This is assuming SL is 50pips.

So the account has to be adjusted every trade with this formula.

I hope this helps.

But before you incorporate this formula, please tell me what kinda
win/loss ratio and risk/reward ratio are you expecting for this system.
We can then build once we know that.

Accordingly we can adjust the risk % to 10 or 15%.
Also your typical largest loss will be equal to your SL since that will be maximum you can loose on any one trade. The risk % also has to take into account maximum drawdown or largest consecutive losses so that we can tide over the drawdown.

Hope that helps. Anyone disagree with this MM please point it out so that we improve.

The results which we get in a backtest usually just takes a standard 1 lot trade for every trade. So if we incorporate MM, the equity growth is multiplied by several times. That is the magic of MM.

Most people concentrate on finding the best systems, but the real holy grail is MM. You can make an average system into a super system by MM itself.
As I had pointed out in my earlier post, the following example will make it obvious.

win - 74%

Without Money Management

Initial equity - 20,000$
Final Equity - 251,813$

With MM
initial equity - 30,000$
Final equity - 582,930,624 $$$$$$$$$$$$$$$

Thats right! thats 5.82 million $!

The values are theoritical, however the message is pretty clear.

Last edited by radicalmoses; 02-16-2006 at 09:29 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #115 (permalink)  
Old 02-16-2006, 05:06 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow

Quote:
Originally Posted by dedywind
@codersguru:

thank you for great effort...

After attached your EA (http://www.forex-tsd.com/9264-post100.html) in 4pair eur/usd, gbp/usd, usd/chf, gbp/jpy.... three pair immediately started open trade (gbp/usd, usd/chf, gbp/jpy) and all of them have good result....


I dont know anything about programming... but based on this advised:



I do make small change in EA:

if(line1>line2)current_direction = 1; //up
if(line1<line2)current_direction = 2; //down

To

if(line1>line2)current_direction = 2; //up
if(line1<line2)current_direction = 1; //down

Yesterday, I attached this EA to neuimex demo account TF30 in four pair.... and all of them have good result to....

I will continue to forward testing those EA for another 2/3 weeks....
You have reversed the direction of the cross, EMA CROSS will work in both directions but it originally based on taking the reverse direction of the market.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #116 (permalink)  
Old 02-16-2006, 10:05 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Talking New version

Hi folks,

Firstly, I want to thank you all for your shares and useful comments
Secondly, I have updated the EMA CROSS expert advisor to version 2.

I hope you find it useful!
Attached Images
File Type: gif StrategyTester.gif (5.1 KB, 611 views)
Attached Files
File Type: mq4 EMA_CROSS_2.mq4 (6.7 KB, 689 views)
File Type: htm StrategyTester.htm (200.8 KB, 489 views)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #117 (permalink)  
Old 02-17-2006, 02:32 AM
Audio's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 140
Audio is an unknown quantity at this point
Talking

I try to do the back for 1 and 2 codersguru ea ,test on eur/usd ,D1 it open .5 lot . Donno what I click ,I lost the result test on forward demo acct for 1 week it is up $# 1025 # . only on eur/usa .
Attached Images
File Type: gif TesterGraph.gif (7.2 KB, 472 views)
File Type: gif 2.gif (8.8 KB, 463 views)

Last edited by Audio; 02-17-2006 at 02:46 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #118 (permalink)  
Old 02-17-2006, 03:07 AM
kohzadi's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Tehran-IR Iran
Posts: 110
kohzadi is on a distinguished road
A question

Hi codersguru and all members
I have a question and I am newbie in forex.
Can we use an EA in offline? or we must be online for using an EA?

Last edited by kohzadi; 02-17-2006 at 03:10 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #119 (permalink)  
Old 02-17-2006, 03:13 AM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 300
cockeyedcowboy is on a distinguished road
Coders Guru

I have quickly looked at the codeing of your new version and have a few questions about the code.




The first has to do with this block of code below;

Code:

static int TimeFrame;

   ...
   ...
   ...


int init()
  {
   TimeFrame=Period();
    return(0);
  }


   ...
   ...
   ...


int Crossed (double line1 , double line2)
   {
      static int last_direction = 0;
      static int current_direction = 0;
      
      if(TimeFrame!=Period())
      {
         TimeFrame=Period();
         return (0);
      }
      if(line1>line2)current_direction = 1; //up
      if(line1<line2)current_direction = 2; //down

   ...
   ...
   ...
What is the purpose of the TimeFrame Parameter in this content?






The second code block that is giving me some questions is the purpose of the function isNewSymbol?

Code:
bool isNewSumbol(string current_symbol)
  {
   //loop through all the opened order and compare the symbols
   int total  = OrdersTotal();
   for(int cnt = 0 ; cnt < total ; cnt++)
   {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      string selected_symbol = OrderSymbol();
      if (current_symbol == selected_symbol)
      return (False);
    }
    return (True);
}

   ...
   ...
   ...


   total  = OrdersTotal();

   if(total < 1 || isNewSumbol(Symbol())) 
     {
       if(isCrossed == 1)
 
   ...
   ...
   ...

I know that you are very busy but could you please explain the purpose of these and why they are needed.



Thanks for your time,

The CockeyedCowboy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #120 (permalink)  
Old 02-17-2006, 12:52 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Blocks of code!

Quote:
Originally Posted by cockeyedcowboy
Coders Guru

I have quickly looked at the codeing of your new version and have a few questions about the code.




The first has to do with this block of code below;

Code:

static int TimeFrame;

   ...
   ...
   ...


int init()
  {
   TimeFrame=Period();
    return(0);
  }


   ...
   ...
   ...


int Crossed (double line1 , double line2)
   {
      static int last_direction = 0;
      static int current_direction = 0;
      
      if(TimeFrame!=Period())
      {
         TimeFrame=Period();
         return (0);
      }
      if(line1>line2)current_direction = 1; //up
      if(line1<line2)current_direction = 2; //down

   ...
   ...
   ...
What is the purpose of the TimeFrame Parameter in this content?






The second code block that is giving me some questions is the purpose of the function isNewSymbol?

Code:
bool isNewSumbol(string current_symbol)
  {
   //loop through all the opened order and compare the symbols
   int total  = OrdersTotal();
   for(int cnt = 0 ; cnt < total ; cnt++)
   {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      string selected_symbol = OrderSymbol();
      if (current_symbol == selected_symbol)
      return (False);
    }
    return (True);
}

   ...
   ...
   ...


   total  = OrdersTotal();

   if(total < 1 || isNewSumbol(Symbol())) 
     {
       if(isCrossed == 1)
 
   ...
   ...
   ...
I know that you are very busy but could you please explain the purpose of these and why they are needed.



Thanks for your time,

The CockeyedCowboy
CockeyedCowboy,

I used the first block of code to be sure that the changing of the chart period will not affect the program.
For example: if you attached the expert advisor to M30 chart and the Short EMA line was above the Long EMA line in the M30 chart, Then you clicked the D1 button and changed the timeframe to daily timeframe and the you was unlucky and the Short EMA line in the D1 chart was below the Long EMA in this chart. The expert advisor will consider it a crossing and open a trade. But with the above code i give it a chance to remember the last time frame and wait for another tick.

I used the second block of code to check the currently opened trades and prevent the expert advisor to trade in the same pair twice.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
ema forex, ema_cross_2, ema cross, ema cross ea

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 Off
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/ema-cross/925-ema-cross.html
Posted By For Type Date
OzFx Forex System • View topic - MA cross_over signal [arrow] Post #54 Refback 03-25-2008 08:58 AM
OzFx Forex System • View topic - MA cross_over signal [arrow] Post #54 Refback 03-16-2008 04:14 PM
ืคื•ืจื•ื - STRATEGY BANK This thread Refback 03-08-2008 06:00 PM
ืคื•ืจื•ื - STRATEGY BANK This thread Refback 02-24-2008 05:34 PM
XP Worx - Custom MetaTrader (MQL4) Programming and Free Expert Advisors - Indicators - Libraries - Scripts - MetaTrader Extensions (c++ DLLs) This thread Refback 12-28-2007 05:05 PM
ืคื•ืจื•ื - STRATEGY BANK This thread Refback 12-07-2007 07:06 PM
BIGWAVE BBS Post #663 Refback 10-15-2007 05:57 PM
Firebird EA, please test this one, it is one of the greats - Page 15 This thread Refback 08-30-2007 11:15 PM
Firebird EA, please test this one, it is one of the greats - Page 15 @ Forex Factory This thread Refback 06-23-2007 05:21 PM
XP Worx - Custom MetaTrader (MQL4) Programming and Free Expert Advisors - Indicators - Libraries - Scripts - MetaTrader Extensions (c++ DLLs) This thread Refback 06-21-2007 10:53 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross! creative Indicators - Metatrader 4 159 09-20-2008 02:19 PM
MA cross/Price cross MA EA Pipsta_UK Expert Advisors - Metatrader 4 5 05-10-2007 08:50 PM
3 MA cross demontaz Indicators - Metatrader 4 2 04-15-2007 06:24 AM
ema cross 1f4 General Discussion 5 05-21-2006 03:13 PM


All times are GMT. The time now is 09:41 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.