Aggressive scalp ea - page 88

 

Any progress about escape?

@KAFETERO

Which broker you test ea?

 

so far i had added tp, sl, risk management...

but the problem is how to make it to open position only on certain time ??

that's my trouble now.

 
//+------------------------------------------------------------------+

//| escape.mq4 |

//| Copyright 2012, Abu. |

//| http://www.metaquotes.net |

//+------------------------------------------------------------------+

#property copyright "Copyright 2012, Abu."

#property link "http://www.metaquotes.net"

extern string Name_Expert = "escape";

extern bool UseTradingHours = true;

extern bool TradeAsianMarket = true;

extern int StartTime1 = 0000; // Start trades after time

extern int EndTime1 = 0759; // Stop trading after time

extern bool TradeEuropeanMarket = true;

extern int StartTime2 = 0800; // Start trades after time

extern int EndTime2 = 1859; // Stop trading after time

extern bool TradeNewYorkMarket = true;

extern int StartTime3 = 1900; // Start trades after time

extern int EndTime3 = 2359; // Stop trading after time

extern double LongTP1 = 80;

extern double ShortTP1 = 80;

extern double longSL1 = 150;

extern double ShortSL1 = 150;

extern double LongTP2 = 180;

extern double ShortTP2 = 180;

extern double longSL2 = 150;

extern double ShortSL2 = 150;

extern double LongTP3 = 50;

extern double ShortTP3 = 50;

extern double longSL3 = 150;

extern double ShortSL3 = 150;

extern double LotSize = 0.1;

extern double MaxOrders = 5;

extern double SafetyPercent = 50;

extern int Slippage = 1;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init()

{

if(AccountFreeMargin()<(SafetyPercent/100)*AccountBalance())

{

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if(Bars<50)

{

return(0);

}

if(OrdersTotal()>MaxOrders())

{

return(0);

}

}

int deinit()

{

int StartTime1; // Start trades after time

int EndTime1; // Stop trading after time

int StartTime2; // Start trades after time

int EndTime2; // Stop trading after time

int StartTime3; // Start trades after time

int EndTime3; // Stop trading after time

double diClose0=iClose(NULL,5,0);

double diMA1=iMA(NULL,5,5,0,MODE_EMA,PRICE_OPEN,1);

double diClose2=iClose(NULL,5,0);

double diMA3=iMA(NULL,5,4,0,MODE_EMA,PRICE_OPEN,1);

int NumOrders = 0;

bool YesStop;

NumOrders = CalculateCurrentOrders();

if(NumOrders == 0)

{

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP1(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL1(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

if (YesStop == false)

{

return(0);

}

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP2(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL2(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

return(0);

}

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP3(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL3(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

return(0);

}

}

}

}

}

}

return(0);

}

here is my code after editting the trading hours,

but it seem not work...

there are a lot of error there...

 

Lili Abu

Do not get this wrong, but since in your EA almost everything is wrong, please start from this thread : https://www.mql5.com/en/forum/173136 and then you can build your way up through this section : Lessons

As I said, don't get it wrong, but it is useless to explain some things till you get clear what init() deinit() and start() procedures do in EA. Please, take some time (as I already told you) and read those posts there - a lot is written there and all it takes is to read that and then slowly battle your way through coding. There are no shortcuts in learning how to code

Ld Abu:
//+------------------------------------------------------------------+

//| escape.mq4 |

//| Copyright 2012, Abu. |

//| http://www.metaquotes.net |

//+------------------------------------------------------------------+

#property copyright "Copyright 2012, Abu."

#property link "http://www.metaquotes.net"

extern string Name_Expert = "escape";

extern bool UseTradingHours = true;

extern bool TradeAsianMarket = true;

extern int StartTime1 = 0000; // Start trades after time

extern int EndTime1 = 0759; // Stop trading after time

extern bool TradeEuropeanMarket = true;

extern int StartTime2 = 0800; // Start trades after time

extern int EndTime2 = 1859; // Stop trading after time

extern bool TradeNewYorkMarket = true;

extern int StartTime3 = 1900; // Start trades after time

extern int EndTime3 = 2359; // Stop trading after time

extern double LongTP1 = 80;

extern double ShortTP1 = 80;

extern double longSL1 = 150;

extern double ShortSL1 = 150;

extern double LongTP2 = 180;

extern double ShortTP2 = 180;

extern double longSL2 = 150;

extern double ShortSL2 = 150;

extern double LongTP3 = 50;

extern double ShortTP3 = 50;

extern double longSL3 = 150;

extern double ShortSL3 = 150;

extern double LotSize = 0.1;

extern double MaxOrders = 5;

extern double SafetyPercent = 50;

extern int Slippage = 1;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init()

{

if(AccountFreeMargin()<(SafetyPercent/100)*AccountBalance())

{

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if(Bars<50)

{

return(0);

}

if(OrdersTotal()>MaxOrders())

{

return(0);

}

}

int deinit()

{

int StartTime1; // Start trades after time

int EndTime1; // Stop trading after time

int StartTime2; // Start trades after time

int EndTime2; // Stop trading after time

int StartTime3; // Start trades after time

int EndTime3; // Stop trading after time

double diClose0=iClose(NULL,5,0);

double diMA1=iMA(NULL,5,5,0,MODE_EMA,PRICE_OPEN,1);

double diClose2=iClose(NULL,5,0);

double diMA3=iMA(NULL,5,4,0,MODE_EMA,PRICE_OPEN,1);

int NumOrders = 0;

bool YesStop;

NumOrders = CalculateCurrentOrders();

if(NumOrders == 0)

{

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP1(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL1(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

if (YesStop == false)

{

return(0);

}

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP2(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL2(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

return(0);

}

YesStop = false;

if (TradeAsianMarket == true)

{

YesStop = CheckTradingTimes();

if (YesStop == true)

{

if ((diClose0<diMA1))

{

OrderSend(Symbol(),LongTP3(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

else

if ((diClose2>diMA3))

{

OrderSend(Symbol(),ShortSL3(),0.1,Ask,3,Bid-15*Point,Bid+15*Point); //----

return(0);

}

return(0);

}

}

}

}

}

}

return(0);

}

here is my code after editting the trading hours,

but it seem not work...

there are a lot of error there...
 

thanks for your advise...

 

Need help to create EA from custom indicator

Hallo all,

newbie here, can some one help to create simple EA using this custom indicator?

all i need is to automated this indicator to trade XAUUSD with TP, SL, ability to

re order if requote happen & i hope all the parameter are adjustable to find its

best performance. really appreciate if any one could give a hand here, thanks.

 

Is'nt this EA similar to bombshell Rc EA?

 

I do the same as you do but....

Hello!! any one can help me? I did the same set 1 direction as this picture do but still escape keep open buy+sell @ same time !! no matter how hard I try!! it nothing happen!! please show me the code setting 1 direction as I want anytime.. thanks!!!!

 
ken escape:
Hello!! any one can help me? I did the same set 1 direction as this picture do but still escape keep open buy+sell @ same time !! no matter how hard I try!! it nothing happen!! please show me the code setting 1 direction as I want anytime.. thanks!!!!

Hi Ken Escape,

Please just need to post your request once, am trying to work on these Ea's, if its out of my skill level maybe someone that will be in later will be able to fix, so please be a little patient.

 

Eae... faz tempo que não entro neste forum! Pelo que eu vejo me parece que teve muitas modificações nos EAs! Até mais!

Reason: