Ojala EA - page 14

 
Mohammed:
Salam,

Could we forward test this version together!

Settings: Default

Pairs: Any

TF: H4

Note:Please download Coders Guru Pop Alert if you want to use MSN Style Pop Alert:

http://www.metatrader.info/node/82

This is a new version or what?

 

Pop out!

BrunoFX:
hello Mohammed,

I want to test this new but without : Coders Guru Pop Alert Plugin, but i have an error:

2;76;C:\Forex\StrategyBuilderFX 400\experts\Ojala.mq4;7:1;'Pop.mqh' - cannot open program file

Hello Bruno,

If you don't want to use the Coder Guru Pop Please use this code:

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

//| Ojala.mq4 |

//| Mohammed |

//| https://www.forex-tsd.com |

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

#property copyright "Mohammed"

#property link "https://www.forex-tsd.com"

extern double TakeProfit=85;

extern double TrailingStop=10;

extern double StopLoss=35;

extern double Lots = 1; //0.01

extern int EmaPeriod = 6;

// Thanks going to Coders' Guru!

bool isNewSumbol(string current_symbol)

{

//loop through all the opened order and compare the symbols

int total = OrdersTotal();

for(int cnt = 0 ; cnt < total ; cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

string selected_symbol = OrderSymbol();

if (current_symbol == selected_symbol)

return (False);

}

return (True);

}

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

//| expert start function |

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

int start()

{

//----

int cnt, ticket, total;

if(Bars<100)

{

Print("bars less than 100");

return(0);

}

if(TakeProfit<5)

{

Print("TakeProfit less than 10");

return(0); // check TakeProfit

}

total = OrdersTotal();

if(total < 1 || isNewSumbol(Symbol()))

{

if(iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,2)0)

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Ojala",12345,0,Green);

if(ticket>0)

{

if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))

{

Print("BUY order opened : ",OrderOpenPrice());

}

}

else Print("Error opening BUY order : ",GetLastError());

return(0);

}

if(iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,2)>0 && iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,1)<0)

{

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Ojala",12345,0,Red);

if(ticket>0)

{

if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))

{

Print("SELL order opened : " , OrderOpenPrice());

}

}

else Print("Error opening SELL order : ",GetLastError());

return(0);

}

return(0);

}

for(cnt=0;cnt<total;cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())

{

if(OrderType()==OP_BUY) // long position is opened

{

if(iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,1)>0 && iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,0)<0)

{

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position

return(0); // exit

}

if(TrailingStop>0)

{

if(Bid-OrderOpenPrice()>Point*TrailingStop)

{

if(OrderStopLoss()<Bid-Point*TrailingStop)

{

OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);

return(0);

}

}

}

}

else // go to short position

{

if(iCustom(NULL,0,"EMAOsMA",EmaPeriod,0,1)0)

{

OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position

return(0); // exit

}

if(TrailingStop>0)

{

if((OrderOpenPrice()-Ask)>(Point*TrailingStop))

{

if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);

return(0);

}

}

}

}

}

}

return(0);

}

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

 
JoZo:
This is a new version or what?

Jozo,

It's a little modification to the orginal EA that I hope it works better!

 
Mohammed:
Hello Bruno, If you don't want to use the Coder Guru Pop Please use this code:

Hello mohammed,

THX

 
Mohammed:
Jozo, It's a little modification to the orginal EA that I hope it works better!

Can you explain the modifications?

Thanks

 
JoZo:
Can you explain the modifications? Thanks

Salam Jozo!

These are the modifications:

1- The period of the Moving Average now is 6 instead of 12.

2- The calculation for opening trades now for the previous two bars not the current bar (1 and 2 not 0 bar).

3- The StopLoss applied!

4- Closing positions applied!

Attached my 2 days statement! (Please ignore the manual 2 trades).

 
Mohammed:
Salam Jozo!

These are the modifications:

1- The period of the Moving Average now is 6 instead of 12.

2- The calculation for opening trades now for the previous two bars not the current bar (1 and 2 not 0 bar).

3- The StopLoss applied!

4- Closing positions applied!

Attached my 2 days statement! (Please ignore the manual 2 trades).

Really nice statement!

I have started on 9.3.2005 to forward the old Ojala and starting balance was 10k. Today is 13.900 and equity 12k I'm waiting USD/CHF to go UP and EUR to go down.

Which time Frame for the new Ojala?

 
JoZo:
Really nice statement!

I have started on 9.3.2005 to forward the old Ojala and starting balance was 10k. Today is 13.900 and equity 12k I'm waiting USD/CHF to go UP and EUR to go down.

Which time Frame for the new Ojala?

Thanks Jozo!

The Time Frame must be H4

Could I see the statement of yours?

 
Mohammed:
Thanks Jozo!

The Time Frame must be H4

Could I see the statement of yours?

Hello,

The ea is it planned for a multi currencies? and how much?

 
BrunoFX:
Hello, The ea is it planned for a multi currencies? and how much?

Hello,

I'm testing it with the most of the currencies and didn't elect the best currencies that work better with the new EA (See attached workspace!).

I don't believe in backtesting anymore, that's why I'm forward testing it.

Files:
screen.gif  53 kb
Reason: