I have backtested this system, and it’s cool really.
My problem is that it can only execute 1 currency pair at a time eventhough indicators are met with the other currency pairs. I want to execute this simultaneously on different pairs.
I tried to modify the OrdersTotal<1 to a value more than 1 (e.g OrdersTotal<3…) but it only duplicates the current open pair.
Hi, I’m a new trader but I have a basic understanding of programming. It seems to me as if the latest ea version of this system makes all orders exit after gaining 40 pips. Looking back in the thread, it seems to me that only condition 2 orders (MACD agrees with the moving average crossover) have a set takeprofit level. Please correct me if I’m mistaken but the exit parameter for all types of orders is either when the moving averages cross over in the opposite direction or a loss of 30 pips whichever comes first. I’ve been playing around with the code and made it so that some orders would exit because of the moving average crossover before going so far as to hit the stoploss.
here is what I have so far in the exit section of the code
if(OrderType()==OP_BUY) // long position
{
if(OrderMagicNumber() == MagicNumber + 1 && Bid - OrderOpenPrice() >= TakeProfitNum) // long position is opened with Scen. #2
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
return(0); // exit
}
// should it be closed?
else if(ShortEmaCurrent < LongEmaCurrent && ShortEmaPrevious > LongEmaPrevious)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
return(0); // exit
}
}
else if(OrderType()==OP_SELL) // short position
{
if(OrderMagicNumber() == MagicNumber + 1 && OrderOpenPrice() - Ask >= TakeProfitNum)
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); //close position
}
// should it be closed?
if(ShortEmaCurrent > LongEmaCurrent && ShortEmaPrevious < LongEmaPrevious)
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
return(0); // exit
}
}
Good to see you martin. I hope all is going well for you.
I have been trading candle signals, pivot points and momentum/breakouts and been quite successful on DEMO and using one mini lot for live testing. Almost ready to get more aggressive.
Hi Martin, i am a newbie . I am using your system at demo account. Its working nicely… Thanks a lot ! I really wonder how much money u are making daily… .!! Great job…!
I know this thread is old, but I’ve tried to use the expert advisor with MT4 but it’s not working. Tried backtesting with the strategy tester, but the expert adviser doesn’t open positions…
I tried to compile it with the Meta Editor but there I’m getting some warning, f.e. return value of OrderSelect should be checked or return value of OrderClose should be checked…
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if(ShortEmaCurrent < LongEmaCurrent && ShortEmaPrevious > LongEmaPrevious)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
return(0); // exit
}
I think thats the problem why it’s not open positions.
Would be nice if someone could help.