Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Order rejected: Broker or exchange option"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    "Order rejected: Broker or exchange option"

    I was running a live automated strategy at 3:06 AM central time, which fired off a Short Limit Entry order for 2 contracts with profit and stop targets using the code below. This normally works, but caused an error this morning.

    contractQuantity = 2;
    entryPriceShortRedCount = 12867;

    protectedoverridevoid OnBarUpdate()
    {
    ShortRedCtEntryOrder = EnterShortLimit(contractQuantity, entryPriceShortRedCount, "Short Red Count : 0");
    }

    protectedoverridevoid OnExecution(IExecution execution)
    {
    if (ShortRedCtEntryOrder != null && ShortRedCtEntryOrder.Token == execution.Order.Token)
    {

    if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
    {
    ShortRedCtTargetOrder = ExitShortLimit(
    0, true, execution.Order.Filled, execution.Price - 40 * TickSize, "Profit Target", "Short Red Count : 0");
    ShortRedCtStopOrder = ExitShortStop(
    0, true, execution.Order.Filled, execution.Price + 75 * TickSize, "Stop Loss", "Short Red Count : 0");
    ShortRedCtEntryPrice = execution.Price;

    }
    // Resets ShortRedCtEntryOrder object to null after order has been fully filled
    // or partially filled with the remaining orders cancelled
    if (execution.Order.OrderState != OrderState.PartFilled // fully filled/cancelled
    )
    {
    ShortRedCtEntryOrder =
    null;
    }
    }
    }

    The Entry order was partially filled with 1 contract, then fully filled with the second contract.
    The Profit target order was submitted for 1 contract, then the Stop target was accepted for 2 contracts. It looks like the Profit Target then was modified to have 2 contracts as needed, but the broker rejected that modification.

    Not sure what happened exactly, but the log file is attached. Can you please help me understand the sequence of events that lead to my strategy being shut down and the trade being exited instantly. I lost a large sum of $ because this crashed and missed not only this profit, but the subsequent trade, which never fired because the strategy had crashed.
    Attached Files

    #2
    Hello,

    Thank you for your post and for reporting.

    This would be a native error from the broker or the exchange servers. In order to determine what occurred, we will need more information than you provided in your log.

    Can you please email us your complete log and trace files. You can do this by going to Help--> Mail to Support and checking "log and trace"

    Please also include "Attn: Matthew" and a reference to this thread url.

    Thanks
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X