MQL4 - automated forex trading   /  

Forum

Problem with Strategy Tester and Entry Orders

Back to topics list To post a new topic, please log in or register

avatar
14
rbhuet 2006.10.04 09:49 

I have been unable to get the Strategy Tester to work properly with entry orders. I have replicated the problem with a bare-bones Expert (see code below). When this is run on the Strategy tester for EURUSD 5 min chart, the program creates an entry Buy Stop order on the open of the 6:55 candle on June 27. The Strategy Tester shows it activating at 6:57, but the price only reaches 1.2602, which should not activate the order which is at 1.2611. Any help you can provide would be much appreciated. I am running version 4.0, build 191. Thanks.

int start()
{
//----

if ( TimeDay(Time[0]) == 27 && TimeMonth(Time[0]) == 6 && TimeHour(Time[0]) == 6 && TimeMinute(Time[0]) == 55 )
{
Alert("Price=",Bid);
if ( noTrades )
{
noTrades = false;
executeTrade(OP_BUYSTOP, 1, 1. 2611, 1.2580, 1.2616);
}

}
//----
return(0);
}

//+------------------------------------------------------------------+
//| Execute a Trade |
//+------------------------------------------------------------------+
int executeTrade( int op, double lots, double entryPrice, double stop, double limit)
{

//----

int ticket=OrderSend(Symbol(),op,lots,entryPrice,3,stop,limit,"expert comment", 255,0,CLR_NONE);
if(ticket<1)
{
int error=GetLastError();
Alert("Error Code= ", error);
return(-1*error);
}

return(0);
}

What about Hedging Daily?

What about Hedging Daily?

A trading strategy using hedging system created for trading the intra-day style of GBPJPY / EURJPY and for daily trading.


avatar
Moderator
5198
stringo 2006.10.04 10:18 
Please use latest build of client terminal!

And don't forget check "Recalculate" button

avatar
14
rbhuet 2006.10.05 09:07 
stringo wrote:
Please use latest build of client terminal!

And don't forget check "Recalculate" button
Yes, going to Build 197 fixed the problem. Thanks!
Back to topics list  

To add comments, please log in or register