Download MetaTrader 5

Pending order "urgent help"

To add comments, please log in or register
Krieg
8
Krieg  
#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
10615
Keith Watford  
The entry for a Buy Stop order must be higher than the current Ask
To add comments, please log in or register