This is exactly what this EA needs. Someone to go through it with a fine tooth comb. When I started writing the code for this one it was my first time ever writing an EA. And as you can see I got allot of things wrong. Please post an updated ver with your fixes.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Gone 4 beer. Till tomorrow!
Please attach your modify version.
I'm Back!!
2 frantacech:
I didn't rewrite the code jet. First I need to receive agreement from Kurka. He's the author.
Now, let's go Further!
Mistake4
bool close_position=false;
int start() // was later, must be here
{
if (close_position) //was int
{
int i, cnt = OrdersTotal();
for (i=cnt-1; i>=0; i--)
{
if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)==true)
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
{
if (OrderType() == OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Red);
}
if (OrderType() == OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Green);
}
}
}
}
}
Mistake5
bool CCIUP = false;
bool CCIDOWN = false;
What are them 4? U don't use'em later.
Mistake6
if (SarCurrent SarCurrent) {SARBUY = true;}
if (SarCurrent <= Ask) {SARBUY = true;}
if (SarCurrent >= Bid && SarPrevious<SarCurrent) {SARSELL = true;}
if (SarCurrent >= Bid) {SARSELL = true;}
That means SarPreviousSarCurrent don't play a role.
Mistake7
if (sell_orders > 0) {close_position=true;Sleep(20000); return(0);}
else
{
OrderSend(Symbol(),OP_BUY,LongLots,Ask,3,Ask-StopLossLow*Point,Ask+TakeProfitLow*Point,"Go Long Low Trend",MagicNumber,0,Green);
return(0);
}
U cann't to close & to open simultaneously
Mistake8
if (up5 > 0 || up6 > 0 && buy_orders < 1){//was 2 and 5
If U have more, than 1 position why do U calculate LongLots?
Besides, look at my post #62.
And the Global Idea of EA is Definitely Good!
Mistake9
Your variant:
if (CCI = (-Cci_Level1)) {CCISELL = true;}
if (CCI = (-Cci_Level2)) {CCISELL = true;}
if (CCI = (-Cci_Level3)) {CCISELL = true;}
I think it must be:
if (CCI = (-Cci_Level1)) {CCISELL = true;}
if (CCI = (-Cci_Level2)) {CCISELL = true;}
if (CCI = (-Cci_Level3)) {CCISELL = true;}
Artemos,
This is exactly what this EA needs. Someone to go through it with a fine tooth comb. When I started writing the code for this one it was my first time ever writing an EA. And as you can see I got allot of things wrong. Please post an updated ver with your fixes.
Thanks,
KK