ea issue
Attach your source so that we can have a look at it.
Otherwise, can't help.
//+------------------------------------------------------------------+ //| GBPUSD trader.mq4 | //| Copyright © 2011, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "sergey antipin" #property link "http://www.metaquotes.net" extern double buffer=0; extern double stoploss=20; extern double takeprofit=350; extern double filter=50; extern double ma_value=218; double max_account_balance=0; double max_spread=400; extern double Z=1; double M=1; // risk bool price_above=true; bool trade_ok=true; int ticket1=-1; //------------------------------------------------------------------------------------------------~~~~~~!!!!!!!!!!!!!!!! //------------------------------------------------------------------------------------------------~~~~~~!!!!!!!!!!!!!!!! double entryprice=0; int K = 10 ; // point * K (in demo account use 10, in real account use 1) int init() { return(0); } int deinit() { return(0); } int start() { double SMA_10day=iMA(Symbol(),15,ma_value,0,MODE_SMA,PRICE_TYPICAL,0); // simple ma_value day moving average value double ATR=iATR(Symbol(),60,200,0); //double adx=iADX(Symbol(),30,14,PRICE_TYPICAL,MODE_SMA,0); //----- risk //Alert("lot size:",MarketInfo(Symbol(), MODE_LOTSIZE)); //Alert("minlot:",MarketInfo(Symbol(), MODE_MINLOT)); //Alert("lot step:",MarketInfo(Symbol(), MODE_LOTSTEP)); //Alert("max lot:",MarketInfo(Symbol(), MODE_MAXLOT)); //M = MathRound ( MathLog (AccountBalance()/(367.88/M+1) ) / MathLog (2.72) ); M=(AccountBalance()*0.002*Z)/(stoploss); if (M<1) M=1; //M=1; if (AccountBalance()>max_account_balance) max_account_balance=AccountBalance(); //-----end of risk //---------------- open new trades //--- * short trade if (trade_ok==true) { if ( ( Bid- SMA_10day < buffer*Point*K ) && ( price_above==true) && (ATR<0.0040) ) { ticket1=-1; while (MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_BID)<max_spread*Point*K) // spread < 4 { Alert(MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_BID)); RefreshRates(); ticket1 = OrderSend(Symbol() , OP_SELL , 0.1*M , Bid , 2 , Ask+stoploss*Point*K , Ask-takeprofit*Point*K); Sleep(2000); if (ticket1>0) { entryprice=Bid; break; } } trade_ok=false; } //--- * end of short trade else //--- * long trade if ( ( SMA_10day - Ask < buffer*Point*K ) && (price_above==false) && (ATR<0.0040)) { ticket1=-1; while (MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_BID)<max_spread*Point*K) //spread < 4 { Alert(MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_BID)); RefreshRates(); ticket1 = OrderSend(Symbol() , OP_BUY , 0.1*M , Ask , 2 , Bid-stoploss*Point*K , Bid+takeprofit*Point*K); Sleep(2000); if (ticket1>0) { entryprice=Ask; break; } } trade_ok=false; } //--- * end of long trade } //---- end of open new trades //-----x pip noice filter if (trade_ok==false) { if (price_above==true) //-- price currently above { if (Bid < entryprice - filter*Point*K) //-- price moved below and is not random noice { price_above=false; trade_ok=true; } else if (Ask > entryprice + filter*Point*K) //-- price stayed above and is not random noice trade_ok=true; } else if (price_above==false) //-- price currently below { if (Ask > entryprice + filter*Point*K) //-- price moved above and is not random noice { price_above=true; trade_ok=true; } else if (Bid < entryprice - filter*Point*K) //-- price stayed below and is not random noice trade_ok=true; } } //----- end of filter return(0); }
ok... I got you the code..
help pls :D
No-one here can answer that question for you man. Thats one of those thing u have to answer yourself. If you think it's good enough then demo-forward test it for about 3-months and go from there.
EAs must adjust for 5 digit brokers, TP, SL, AND slippage. On ECN brokers you must open and THEN set stops.
//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
ubzen:
No-one here can answer that question for you man. Thats one of those thing u have to answer yourself. If you think it's good enough the demo-forward test it for about 3-months and go from there.
No-one here can answer that question for you man. Thats one of those thing u have to answer yourself. If you think it's good enough the demo-forward test it for about 3-months and go from there.
I've forward tested it for 3 months and got positive returns ( maybe it was only by chance )
I believe monte carlo simulation could make a better indication but i don't know how to do it
thanks for all replies
I've programmed an ea which should do ok on EUR/USD ( backtested from 2000 - 2010 )
http://img851.imageshack.us/img851/6564/12314.jpg
but failes on all other pairs
should I throw it away ?