Forex



Go Back   Forex Trading > Trading systems > Ema Cross
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

View Poll Results: What do you think about Counter-Trend strategies?
They are good. 233 30.66%
They are bad. 122 16.05%
Good strategies! But have to be well programmed. 268 35.26%
I don’t know what you are talking about. 154 20.26%
Multiple Choice Poll. Voters: 760. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #31 (permalink)  
Old 02-06-2006, 06:27 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow TimeFrame: Daily

Quote:
Originally Posted by BrunoFX
hello codersguru,

which FT, please ?
Thx
hello BrunoFX,

TakeProfit: 130
Lots: 1
TrailingStop: 20
TimeFrame: Daily
__________________
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #32 (permalink)  
Old 02-06-2006, 06:29 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Ema Cross Version?

Quote:
Originally Posted by SpecII
Hi,

My foward test from EMACross D1 TF

Cheers
hello SpecII,

Thank you very much for sharing us!
What's the version of EMA_CROSS you have used?
__________________
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #33 (permalink)  
Old 02-06-2006, 06:57 PM
Junior Member
 
Join Date: Dec 2005
Posts: 15
SpecII is on a distinguished road
Quote:
Originally Posted by codersguru
hello SpecII,

Thank you very much for sharing us!
What's the version of EMA_CROSS you have used?
Hi Codersguru

i'm use version no SL but i have modified the code for multiple pairs and made bug for double lots hehe.
i will fix the bug for double lots later.

Cheers

Last edited by SpecII; 02-06-2006 at 07:42 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #34 (permalink)  
Old 02-06-2006, 06:59 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up Multiple pairs!

Quote:
Originally Posted by SpecII
Hi Codersguru

i'm use version no SL but i have modified the code for multiple pairs and made bug for double lots hehe.
i will fixed the bug for double lots later.

Cheers
Thanks again ! Could I see your code for multiple pairs?
__________________
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #35 (permalink)  
Old 02-06-2006, 07:34 PM
Junior Member
 
Join Date: Dec 2005
Posts: 15
SpecII is on a distinguished road
Quote:
Originally Posted by codersguru
Thanks again ! Could I see your code for multiple pairs?
Hi,I'm posting the code.It's right?

Thanks

PHP Code:
//+------------------------------------------------------------------+
//|                                                    EMA_CROSS.mq4 |
//|                                                      Coders Guru |
//|                                         http://www.forex-tsd.com |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| TODO: Add Money Management routine                               |
//+------------------------------------------------------------------+

#property copyright "Coders Guru"
#property link      "http://www.forex-tsd.com"

//---- input parameters
extern double    TakeProfit=130;
extern double    Lots=1;
extern double    TrailingStop=20;

extern int ShortEma 10;
extern int LongEma 80;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//---- 
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   
return(0);
  }

int Crossed (double line1 double line2)
   {
      static 
int last_direction 0;
      static 
int current_direction 0;
      
      
//Don't work in the first load, wait for the first cross!
      
static bool first_time true;
      if(
first_time == true)
      {
         
first_time false;
         return (
0);
      }
      
      if(
line1>line2)current_direction 1//up
      
if(line1<line2)current_direction 2//down

      
if(current_direction != last_direction//changed 
      
{
            
last_direction current_direction;
            return (
last_direction);
      }
      else
      {
            return (
0); //not changed
      
}
   }

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
int OrdersPerSymbol=0;  
//---- 

   
int cntticket;
   
double SEmaLEma;
   
   
   if(
Bars<100)
     {
      Print(
"bars less than 100");
      return(
0);  
     }
   if(
TakeProfit<10)
     {
      Print(
"TakeProfit less than 10");
      return(
0);  // check TakeProfit
     
}
     
     
OrdersPerSymbol=0;
    for(
cnt=OrdersTotal();cnt>=0;cnt--)
     {
      
OrderSelect(cntSELECT_BY_POSMODE_TRADES); 
      if (
OrderSymbol()==Symbol() )
     {
     
OrdersPerSymbol++;
     }
   }
     
     
   
SEma iMA(NULL,0,ShortEma,0,MODE_EMA,PRICE_CLOSE,0);
   
LEma iMA(NULL,0,LongEma,0,MODE_EMA,PRICE_CLOSE,0);
   
   
   static 
int isCrossed  0;
   
isCrossed Crossed (LEma,SEma);
   
  
// total  = OrdersTotal(); 
   
if(OrdersPerSymbol 1
     {
       if(
isCrossed == 1)
         {
            
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"EMA_CROSS",12345,0,Green);
            if(
ticket>0)
              {
               if(
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
              }
            else Print(
"Error opening BUY order : ",GetLastError()); 
            return(
0);
         }
         if(
isCrossed == 2)
         {

            
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"EMA_CROSS",12345,0,Red);
            if(
ticket>0)
              {
               if(
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
              }
            else Print(
"Error opening SELL order : ",GetLastError()); 
            return(
0);
         }
         return(
0);
     }
     
     
   for(
cnt=0;cnt<OrdersTotal();cnt++)
     {
      
OrderSelect(cntSELECT_BY_POSMODE_TRADES);
      
//OrderPrint();
      
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
        {
         if(
OrderType()==OP_BUY)   // long position is opened
           
{
            
// should it be closed?
           
           /* REMOVED - Trailling stop only close
           if(isCrossed == 2)
                {
                 OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
                 return(0); // exit
                }
           */
           
            // check for trailing stop
            
if(TrailingStop>0)  
              {                 
               if(
Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(
OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                     return(
0);
                    }
                 }
              }
           }
         else 
// go to short position
           
{
            
// should it be closed?
            
            /* REMOVED - Trailling stop only close
            if(isCrossed == 1)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
               return(0); // exit
              }
            */
            
            // check for trailing stop
            
if(TrailingStop>0)  
              {                 
               if((
OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((
OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                     return(
0);
                    }
                 }
              }
           }
        }
     }

   return(
0);
  }
//+------------------------------------------------------------------+ 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #36 (permalink)  
Old 02-06-2006, 09:48 PM
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
Inverse

To me it looks like an inverse.
The code is set to buy when the long EMA becomes greater then the short EMA
and to sell when the long EMA moves below the short EMA.

I suppose that is why it is successful - as one is taught to do the exact opposite elsewhere.

I am also getting multiple trades, on the first version of the EA, I still have to try the second version. Is this due to incorrect history data?

I will test tonight.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #37 (permalink)  
Old 02-06-2006, 10:01 PM
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
so

so one buys when the Sema moves below the Lema
and sells when the Sema moves above the Lema

Or am I confused again?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #38 (permalink)  
Old 02-07-2006, 12:12 PM
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
when I attach ea

When I attach the ea to a chart I get a 'X' - no smilling face - on the ea or on me.

got it working - had to hit the play experts button.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #39 (permalink)  
Old 02-07-2006, 12:31 PM
BrunoFX's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 816
BrunoFX will become famous soon enough
Smile

Hello,

I am spirit to test this EA with an account demonstration. The first impressions are very good. For the moment it opens only one pair in spite of 4 open diagrams. But with each opening of Trades it is in the good positive direction and it rest. I statement attach you since yesterday.
Attached Files
File Type: htm Statement-EMA-Cross-Daily-07.02.06.htm (5.5 KB, 680 views)
File Type: htm Statement-emacross.07.02.2006.htm (6.5 KB, 488 views)
__________________
All long voyages always start from the first small steps ...

Last edited by BrunoFX; 02-07-2006 at 08:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #40 (permalink)  
Old 02-07-2006, 08:53 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 722
Kalenzo is on a distinguished road
Quote:
Originally Posted by BrunoFX
Hello,

I am spirit to test this EA with an account demonstration. The first impressions are very good. For the moment it opens only one pair in spite of 4 open diagrams. But with each opening of Trades it is in the good positive direction and it rest. I statement attach you since yesterday.
I modified this EA to use magic number. That will provide trade on multi pairs at one time. Change maigc param for to be difrent for every pair.
Attached Files
File Type: mq4 EMA_CROSS.mq4 (5.8 KB, 721 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
ANG3110@latchess.com, coders guru ema cross, Cross, cross ema, cross forex, ema 34, ema cross, ema cross ea, ema cross expert, ema cross expert advisor, ema cross indicator, ema cross signal, ema ea, ema forex, EMACross3, ema_cross_2, forex, forex EMA, forex ema cross, forex ema cross ea, forex ema ea, Sidus, universalmacross


Currently Active Users Viewing This Thread: 3 (2 members and 1 guests)
bibbob, irsae0466001
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross! creative Indicators - Metatrader 4 191 11-15-2009 04:51 PM
3 MA cross demontaz Indicators - Metatrader 4 3 09-21-2009 06:36 PM
MA cross/Price cross MA EA Pipsta_UK Expert Advisors - Metatrader 4 5 05-10-2007 09:50 PM
ema cross 1f4 General Discussion 5 05-21-2006 04:13 PM


All times are GMT. The time now is 10:17 AM.



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