Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancellation of stop loss order submitted twice

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

  • NinjaTrader_Brett
    replied
    Hello,

    In this case I would need to take a look at the code unfortunately.

    Can you please send in your strategy to support at ninjatrader dot com ATTN: Brett so that I can look further into this.

    -Brett

    Leave a comment:


  • Pourleau
    replied
    ExitShort(thisExit, LastTrade);

    where
    thisExit = "NIstop";

    thanks

    Leave a comment:


  • NinjaTrader_Brett
    replied
    Hello,

    Thanks for that information.

    I have your logs from Jason.

    Name='NIstop' New state=Filled Instrument='FGBL 12-11'

    What is NIstop order submitted by?

    I look forward to assisting you further.

    Leave a comment:


  • Pourleau
    replied
    Hi Brett,
    Thanks for looking into this for me.
    The short was entered on 2 lots via 'EnterLongLimit()'. This gave the entry line in the log file as follows:

    28/11/2011 08:31:01|1|32|Order='375086cdcc924defa79a07f0acc3b de8/DDT78244' Name='e1Short' New state=PendingSubmit Instrument='FGBL 12-11' Action=SellShort Limit price=134 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoErro

    As mentioned this was partfilled at 1 lot, then filled on the second lot, so there were 2 stop loss orders associated with this trade going forward, one for each fill:
    Order='0K7T6R386/DDTxxxxx' Name='Stop loss' New state=Working Instrument='FGBL 12-11' Action=BuyToCover Limit price=0 Stop price=134.27 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    and
    Order='0K7T6R388/DDTxxxxx' Name='Stop loss' New state=Accepted Instrument='FGBL 12-11' Action=BuyToCover Limit price=0 Stop price=134.27 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

    When I submit the stop loss and proftgt orders I use the same variable LastTrade='e1Short' so they are associated to that same trade:
    SetStopLoss(LastTrade, CalculationMode.Price, ShortLimitStopPrice, false);
    and
    SetProfitTarget(LastTrade, CalculationMode.Price, ShortLimitStopPrice - 1);

    The log file was sent to support desk but I can re-send to your mail direct if you prefer.
    thanks again

    Leave a comment:


  • NinjaTrader_Brett
    replied
    Hello,

    Thanks for the note.

    Can you tell me a little bit about how you are submitting the orders.

    Are you using two EnterLong() calls with different signal names?

    Also, what setting are you using in the strategy properties when running for Stop & target submission?

    I look forward to assisting you further.

    Leave a comment:


  • Pourleau
    replied
    Trace & log files have been sent to [email protected] - Jason at Support recommended the forum for further assistance with this issue. thanks

    Leave a comment:


  • Pourleau
    started a topic Cancellation of stop loss order submitted twice

    Cancellation of stop loss order submitted twice

    Hi,
    My strategy shut itself down after exiting a position today as there was a duplicate request to cancel the unused stop loss order after my short was exited using a market order to close the position.
    I was short 2 lots, and closed out the position by buying back 2 lots at market, all via an automated strategy. Upon closing a positon via my strategy NinjaTrader then automatically takes care of any associated stop loss and profit target orders that were not filled by cancelling those unused orders.
    As expected, it cancelled the stop loss order, thus:

    28/11/2011 09:15:01|1|32|Order='0K7T6R386/DDT78244' Name='Stop loss' New state=PendingCancel Instrument='FGBL 12-11' Action=BuyToCover Limit price=0 Stop price=134.27 Quantity=1

    (Note, the position was filled at entry separately by 1 lot, then a second lot (partfilled, then filled), so there were in fact 2 stop loss orders and 2 profit target orders associated with the position - I refer here only to the first stop loss order (0K7T6R386, 1 lot) as that was the first one to be duplicated and hence caused the strategy shut down.)

    ...but before the broker's system could confirm this stop loss order as cancelled and could update the order status, a few lines later in the log (still at 09:15:01) the cancellation was requested for the same order (0k7T6R386) a second time, with 'NewState' again as 'PendingCancel'.

    This caused the following error message:
    'Order rejected: Broker or exchange option
    From Gateway: pending terminal action already exists for order 0K7T6R386 affected Order: BuyToCover 1 Stop @ 134.27'

    The cancellation of stop loss and profit target orders associated with the original short trade is not explicitly managed by my code, but is dealt with by the Ninja internal managed orders set up.
    Can anyone give guidance as to why this duplicate cancellation may have occurred, and how to prevent a re-occurence?
    many thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by Newtrader101, Today, 03:22 PM
1 response
5 views
0 likes
Last Post NinjaTrader_JustinD  
Started by johnMoss, Today, 01:43 PM
5 responses
26 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by Trasss_Kenneth, Today, 01:49 PM
1 response
23 views
0 likes
Last Post NinjaTrader_BrandonH  
Started by qs121, Today, 12:24 PM
2 responses
41 views
0 likes
Last Post qs121
by qs121
 
Started by tonynt, Today, 01:11 PM
1 response
27 views
0 likes
Last Post NinjaTrader_Jim  
Working...
X