OrderSend() error - invalid price

 

My EA trades at a set time.

For some reason if the minute is set to 0, the trade gives an "OrderSend() error - invalid price" error on Alpari UK. There is no number reference for the error such as 129.

It trades fine on other brokers when the minute is set to 0. I do have a slippage filter, but even with that set to 999 the trade will not be placed on the hour.


The trade is triggered on the hour during back testing aswell. It's almost as if the broker does not want me to trade at that time!

I am specifying to buy at the ask and it works fine on a few other brokers that I have tested, just not on Alpari UK when the minute is set to 0?

I have just got a trade timeout error whilst testing it the past hour. It's a pain because to test it live I have to wait every hour.


void TradeTime() {
  int hour = TimeHour(TimeCurrent());
   int minute = TimeMinute(TimeCurrent());
   if (DayOfWeek() != gdayofweek && hour == hour_trade && minute == minute_trade) {
      gdayofweek = DayOfWeek();
   }
}
 
Try refreshing the price before ordersend.
RefreshRates( )
 
gangsta1:
For some reason if the minute is set to 0, the trade gives an "OrderSend() error - invalid price" error on Alpari UK.
  1. If you are looping instead of returning from start, you must RefreshRates() after the sleep.
  2. Otherwise, post the OrderSend code.
 

Thanks for the replies guys.

I found a work-around solution. The hour is called from the broker server and the minute from the local time, which allows the trade to execute at 0 minutes on Alpari UK.

Not ideal, but I believe it is more of a broker error as it does not happen on my other brokers.