| New signals service! | |
|
|||||||
| 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 |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
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); } |
|
|||
|
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... |
|
||||
|
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
__________________
“Risk comes from not knowing what you're doing” “Never argue with an idiot. They drag you down to their level then beat you with experience” |
|
||||
|
Quote:
__________________
“Risk comes from not knowing what you're doing” “Never argue with an idiot. They drag you down to their level then beat you with experience” |
|
|||
|
Many functions are here http://www.forex-tsd.com/general-dis...ing-forum.html
And alert_once thread is here Alert Once (Brain Damage)! |
|
|||
|
Quote:
the way you calculate lowest of indicator is not correct Last edited by asmdev; 03-21-2007 at 02:29 PM. |
|
||||
|
Quote:
PHP Code:
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 04:59 PM. |
![]() |
| Bookmarks |
| Tags |
| histogram, forex |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 09:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 11:46 AM | |