Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 00:37:02 +0000



Post From: BuyEntry signal is ignored because working orders exists

[2020-06-05 07:01:21]
yellowandy - Posts: 20
Hello, we are getting the error message "BuyEntry signal is ignored because working orders exists" when submitting multiple orders while one is 'open'. According to the documentation if we specify a target/stop attached orders are automatically used and we should be able to use multiple attached orders even if they are still open. Our use case is simple, under a certain condition we want to submit an order with a target but not a stop. The buy order code is as follows:

s_SCNewOrder createOrder(SCStudyInterfaceRef sc, float currentPrice, int quantity, float stopOffset, float targetOffset, bool isLong)
{
  SCString DebugMessage;
  DebugMessage.Format("*************** ************* Creating new order. Quantity=%d Current Price %f- Stop=%f, Traget=%f, TickSize=%f", quantity, currentPrice, stopOffset, targetOffset, sc.TickSize);
  sc.AddMessageToLog(DebugMessage, 0);
    
  s_SCNewOrder NewOrder;
  NewOrder.OrderQuantity = quantity;
  NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED;
  NewOrder.OrderType = SCT_ORDERTYPE_MARKET;
  NewOrder.OCOGroup1Quantity = 1;

  NewOrder.Target1Offset = targetOffset;
  NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
  //NewOrder.Stop1Offset = stopOffset;
  
  return NewOrder;
}

Then we just send that to a buyEntry call, any ideas as to what may be wrong?