Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
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

Reply
 
Thread Tools Display Modes
  #521 (permalink)  
Old 03-02-2007, 05:46 AM
Junior Member
 
Join Date: Oct 2006
Posts: 8
Greentooth is on a distinguished road
EA not working on forward testing

Dear Codersguru,
Could you please help look into my EA below. Its work perfectly fine in backtesting but not on live demo trading account. They is no buy or sell action at all after the crosses. Thank you very much.




//+------------------------------------------------------------------+
//| 5/13-v2-SOS.mq4 |
//+------------------------------------------------------------------+
extern int Unique_Ref_Number=513;
extern int TakeProfit = 5;
extern int StopLoss=5;
extern double Lots = 1;
extern int Max_Contracts = 1;
extern int emaShortPeriod=5;
extern int emaLongPeriod=13;
extern bool MoneyManagement=true;
extern int Risk=2;

int init() { return(0); }
int deinit() { return(0); }


int Crossed()
{


double emaLong_1=iMA(NULL,0,emaLongPeriod,0,1,PRICE_CLOSE ,2);
double emaLong=iMA(NULL,0,emaLongPeriod,0,1,PRICE_CLOSE,1 );
double emaShort_1=iMA(NULL,0,emaShortPeriod,0,1,PRICE_CLO SE,2);
double emaShort=iMA(NULL,0,emaShortPeriod,0,1,PRICE_CLOSE ,1);

if (emaShort_1<emaLong_1 && emaShort>emaLong ) return (1); //up trend
if (emaShort_1>emaLong_1 && emaShort<emaLong ) return (2); //down trend

return (0); //no action
}


int start()
{
double BuyStopLoss, SellStopLoss, Lotsize ;
int cnt, ticket;
static datetime ordertime;
int total=OrdersTotal();

if(MoneyManagement==true)
{Lotsize=NormalizeDouble((AccountFreeMargin()*Risk/10000),1);}
else
{ Lotsize=Lots; }


BuyStopLoss=MathMin(MathMin(MathMin(Low[1],Low[2]),Low[3]),Ask-StopLoss*Point);
SellStopLoss=MathMax(MathMax(MathMax(High[1],High[2]),High[3]),Bid+StopLoss*Point);



if(Time[0]>ordertime && total<Max_Contracts)

{
// check for long position (BUY) possibility
if(Crossed()==1 )
{
OrderSend(Symbol(),OP_BUY,Lotsize,Ask,1,BuyStopLos s,Ask+TakeProfit*Point,"5-13-Long",Unique_Ref_Number,0,Green);
ordertime=Time[0];
return(0);
}
// check for short position (SELL) possibility
if(Crossed()==2 )
{
OrderSend(Symbol(),OP_SELL,Lotsize,Bid,1,SellStopL oss,Bid-TakeProfit*Point,"5-13-Short",Unique_Ref_Number,0,Red);
ordertime=Time[0];
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
  #522 (permalink)  
Old 03-03-2007, 06:58 PM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
Codersguru,

I need yr help for a MT4 EA.

Day start at 0000 GMT.

1) Draw 5 horizontal lines (different colors). Yesterday OHLC and yesterday (H+L)/2 median line.

2) Sound and pop up alerts when price touches any of the 5 lines.

It would be great if u could help. 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
  #523 (permalink)  
Old 03-14-2007, 05:03 PM
MiniMe's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Montréal
Posts: 1,451
MiniMe is an unknown quantity at this point
Unhappy Line thick Control - Help pls

the indicator is for drawing trend line
all I want is to be able to change the thinkness of the trend line

Help pls
Alan
__________________


Last edited by MiniMe; 11-15-2009 at 11:00 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
  #524 (permalink)  
Old 03-14-2007, 05:14 PM
Senior Member
 
Join Date: Mar 2006
Posts: 793
Maji is on a distinguished road
Quote:
Originally Posted by MiniMe
the indicator is for drawing trend line
all I want is to be able to change the thinkness of the trend line

Help pls
Alan

Here it is. Hope this is what you wanted.
Attached Files
File Type: mq4 ang_AutoCh_HL-v2.mq4 (5.4 KB, 43 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
  #525 (permalink)  
Old 03-14-2007, 06:05 PM
MiniMe's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Montréal
Posts: 1,451
MiniMe is an unknown quantity at this point
Quote:
Originally Posted by Maji
Here it is. Hope this is what you wanted.
Thanks a lot Maji, exactly what I was looking for
__________________

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
  #526 (permalink)  
Old 03-16-2007, 08:33 AM
Member
 
Join Date: Oct 2006
Posts: 59
Jovager is on a distinguished road
Alarm

How write an alarm for having it only 1 time and not again and again ?

Thanks for help.

Jo
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
  #527 (permalink)  
Old 03-16-2007, 10:37 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,058
Blog Entries: 241
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Many functions are here http://www.forex-tsd.com/general-dis...ing-forum.html

And alert_once thread is here Alert Once (Brain Damage)!
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
  #528 (permalink)  
Old 03-21-2007, 03:18 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Question Please check this statement - Need confirmation Please!

PHP Code:
iLow(NULL,0,Lowest(NULL,0,MODE_LOW,1,4)<=0
Does this say that the Lowest of my indicator (4 bars back) should be less than or equal 0?? If not, how should it be stated?

Dave

Thanks in advance!
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
  #529 (permalink)  
Old 03-21-2007, 04:01 PM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by iscuba11
PHP Code:
iLow(NULL,0,Lowest(NULL,0,MODE_LOW,1,4)<=0
Does this say that the Lowest of my indicator (4 bars back) should be less than or equal 0?? If not, how should it be stated?

Dave

Thanks in advance!
that's not right, you can look post 516 on page 52
the way you calculate lowest of indicator is not correct

Last edited by asmdev; 03-21-2007 at 04:29 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
  #530 (permalink)  
Old 03-21-2007, 05:44 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Question

Quote:
Originally Posted by asmdev
that's not right, you can look post 516 on page 52
the way you calculate lowest of indicator is not correct

PHP Code:
double lowestFG=9999highestFG=-9999;//FG short for Forex_Grail, the name of my indicator histogram file.
int currentBar=0;
int endBar=4;
for(
currentBar=0;currentBar<endBarcurrentBar++)
lowestFG=MathMin(lowestFGiForex_Grail(Symbol(),0,17,PRICE_CLOSE,currentBar)); //0 = anytime, 17 = maperiod of indicator.

if lowestFG <= 0 then go to next statement 

Does this read right??

Dave

When I put this into my EA program, it says the iForex_Grail - function is not defined?? Forex_Grail is the name of my custom indicator.


Maybe it is to be stated: lowestFG=MathMin(lowestFG, iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,currentBar)); ??

Last edited by iscuba11; 03-21-2007 at 06:59 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
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


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


All times are GMT. The time now is 02:01 PM.



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