Download MetaTrader 5
To add comments, please log in or register
Share your program via Code Base. Gain access to millions of traders!
Krieg
8
Krieg 2016.05.03 16:41 
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

extern int starthour = 9; 

void OnStart()
  {
  if ( Hour() == starthour)
  {
ordersendbuy();

}
else
Alert(GetLastError());

  }

void ordersendbuy()
{
double ticket;
double price = (Open[0]-(1000*Point));
ticket = OrderSend(Symbol(),OP_BUYSTOP,0.01,price ,0,0,price +(50*Point));
}


can anyone help me to solve this error.

the above script give error 130 when we attach it to a chart.

Need help in urgent

Keith Watford
Moderator
7990
Keith Watford 2016.05.03 17:14  
The entry for a Buy Stop order must be higher than the current Ask
/
To add comments, please log in or register