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.62%
They are bad. 122 16.03%
Good strategies! But have to be well programmed. 269 35.35%
I don’t know what you are talking about. 154 20.24%
Multiple Choice Poll. Voters: 761. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #741 (permalink)  
Old 02-02-2009, 08:51 AM
Junior Member
 
Join Date: Nov 2008
Posts: 1
farloco is on a distinguished road
hi,
please, someone can add MM to this version of ema cross ?
thanks

//+------------------------------------------------------------------+
//| EMA_CROSS.mq4 |
//| Coders Guru |
//| Forex TSD| Metatrader Indicators and Experts Advisors |
//+------------------------------------------------------------------+

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

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

//---- input parameters
extern double TakeProfit=110;
extern double StopLoss=100;
extern double TrailingStop=30;
extern int ShortEma = 1;
extern int LongEma = 13;
extern bool UseStopLoss = false;
extern double Lots=1;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

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

//----
return(0);
}

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);
//Print( "OrderSymbol = " + OrderSymbol() + ": Symbol = " + current_symbol);
string selected_symbol = OrderSymbol();
if (current_symbol == selected_symbol)
return (False);
}
return (True);
}

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(last_direction == 0) //first use
{
last_direction = current_direction;
return(0);
}

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

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----

int cnt, ticket, total;
double SEma, LEma;


if(Bars<100)
{
Print("bars less than 100");
return(0);
}
if(TakeProfit<10)
{
Print("TakeProfit less than 10");
return(0); // check TakeProfit
}


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(total < 1 || isNewSumbol(Symbol()))
{
if(isCrossed == 1 )
{

if(UseStopLoss)
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"EMA_CROSS",12 345,0,Green);
else
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)
{
if(UseStopLoss)
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+S topLoss*Point,Bid-TakeProfit*Point,"EMA_CROSS",12345,0,Red);
else
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<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
//OrderPrint();
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY) // long position is opened
{
/*
// should it be closed?
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?
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+Poi nt*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
  #742 (permalink)  
Old 03-16-2009, 05:11 AM
Junior Member
 
Join Date: Mar 2009
Posts: 1
golad is on a distinguished road
Quote:
Originally Posted by codersguru View Post
Hi folks,

Could somebody tell me what does he think about this simple EA?
It works good in metatrader back tester .

Note: The back testing optimized for the maximum accuracy results.
Hi Codersguru,

This forum is great! May I know is EMA_CROSS.mq4 the latest updated version
that we can test??

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
  #743 (permalink)  
Old 04-11-2009, 04:31 AM
Junior Member
 
Join Date: Dec 2008
Posts: 2
duanchzhu is on a distinguished road
Ema 12-144 cross

Traders and programmers,

Im looking for an EA with the specifics are below.

-EMA12 up cross EMA144 to open long and EMA12 down cross EMA144 to the open short
-open 4×0.1 lots in one trade, close separately when orders get 55, 89, 144, 233 points profit
-take stop below(or up) 40 points of the EMA144 for all orders, when the first trade closed, take the rest orders stop at EMA144
-any pair and time frame, any pair of currency

Thanks in advance for any help.
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
  #744 (permalink)  
Old 05-01-2009, 07:12 AM
Junior Member
 
Join Date: May 2009
Posts: 1
yogesh is on a distinguished road
Auto robot

HEllo friends, i want you all to help me, can some one send me the best AUTO ROBOT available with any of you all bez i need it bez i have lost lot of money and need to recover it and i am not able to find a good AUTO ROBOT for the forex trading.. if some one can help me do so.. mail me you EA to bhavsar.y@gmail.com
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
  #745 (permalink)  
Old 05-03-2009, 09:00 AM
Elminster's Avatar
Junior Member
 
Join Date: Apr 2008
Posts: 5
Elminster is on a distinguished road
how does EAs work? :)

I am new to forex and am currently using EMA_CROSS_6 attached below.

I switch between 15mins and 4hr timeframes a lot. I want the EA to work only on the 15mins timeframe even though i am currently viewing the 4hr timeframe.

I need to know if the EA will change settings and start monitoring or enter/exit trades on the new 4hr Timeframe i am currently on, or on the initial 15min Timeframe which i was on when i first started using the EA.
Attached Files
File Type: mq4 EMA_CROSS_6.mq4 (11.9 KB, 186 views)

Last edited by Elminster; 05-13-2009 at 12:21 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
  #746 (permalink)  
Old 05-05-2009, 03:45 PM
Junior Member
 
Join Date: May 2009
Location: Beograd-Jagodina Serbiaaa
Posts: 3
Petar_Serbia is on a distinguished road
I have problems woth EMA Cross...I dont know how to setup with my account 500 % and i find error ...Plz help

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
  #747 (permalink)  
Old 05-07-2009, 04:43 PM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 513
Shinigami is on a distinguished road
Quote:
Originally Posted by Elminster View Post
I am new to forex and am currently using EMA_CROSS_6 attached below.

I switch between 15mins and 4hr timeframes a lot. I want the MA to work only on the 15mins timeframe even though i am currently viewing the 4hr timeframe.

I need to know if the EA will change settings and start monitoring or enter/exit trades on the new 4hr Timeframe i am currently on, or on the initial 15min Timeframe which i was on when i first started using the EA.
Please don't touch the chart with the EA, simply roll it down and keep it that way. Each time you switch time frame the EA is restarted.
At the same time, it does not matter what you do with the chart as long as you don't close it and don't change time frame, meaning you can attach as many indicators as you like (but only 1 EA).

Petar_Serbia
Error 131 is "invalid trade volume", check lot size.
__________________
MQL4 programming is easy ^^

Last edited by Shinigami; 05-07-2009 at 06:21 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
  #748 (permalink)  
Old 05-09-2009, 08:27 PM
Elminster's Avatar
Junior Member
 
Join Date: Apr 2008
Posts: 5
Elminster is on a distinguished road
Quote:
Originally Posted by Shinigami View Post
Please don't touch the chart with the EA, simply roll it down and keep it that way. Each time you switch time frame the EA is restarted.
At the same time, it does not matter what you do with the chart as long as you don't close it and don't change time frame, meaning you can attach as many indicators as you like (but only 1 EA).
Thank you for this very important clarification
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
  #749 (permalink)  
Old 05-09-2009, 09:31 PM
Member
 
Join Date: Jun 2008
Posts: 60
uthai is on a distinguished road
Thank you for this very important clarification,too
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
  #750 (permalink)  
Old 05-18-2009, 10:09 AM
camisa's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Portugal
Posts: 349
camisa is on a distinguished road
Can somone remove repaint from this indicator? (5-8 EMA openEMA cross)

Can someone help me out? Should be pretty straightforward...

Sometimes an arrow appears and then disappear...
Attached Files
File Type: mq4 5-8openEMA_Cross_Arrow_with_Alerts.mq4 (4.2 KB, 90 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: 1 (0 members and 1 guests)
 
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 09:17 AM.



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