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.08%
They are bad. 100 15.27%
Good strategies! But have to be well programmed. 240 36.64%
I don’t know what you are talking about. 133 20.31%
Multiple Choice Poll. Voters: 655. You may not vote on this poll

Reply
 
LinkBack (10) Thread Tools Display Modes
  #31 (permalink)  
Old 02-06-2006, 05:27 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 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!
Reply With Quote
  #32 (permalink)  
Old 02-06-2006, 05:29 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 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!
Reply With Quote
  #33 (permalink)  
Old 02-06-2006, 05: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 06:42 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 02-06-2006, 05:59 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
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!
Reply With Quote
  #35 (permalink)  
Old 02-06-2006, 06: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!
Reply With Quote
  #36 (permalink)  
Old 02-06-2006, 08: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!
Reply With Quote
  #37 (permalink)  
Old 02-06-2006, 09: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!
Reply With Quote
  #38 (permalink)  
Old 02-07-2006, 11:12 AM
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!
Reply With Quote
  #39 (permalink)  
Old 02-07-2006, 11:31 AM
BrunoFX's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 819
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, 593 views)
File Type: htm Statement-emacross.07.02.2006.htm (6.5 KB, 429 views)
__________________
All long voyages always start from the first small steps ...

Last edited by BrunoFX; 02-07-2006 at 07:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #40 (permalink)  
Old 02-07-2006, 07:53 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
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, 572 views)
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, coders guru ema cross, Sidus, forex

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