Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

TD Ameritrade cancelling OCO order when a partial fill occurs

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

    TD Ameritrade cancelling OCO order when a partial fill occurs

    Hi guys,
    I have an event today where a stoploss and target order (OCO, in Unmanaged mode) were working on a position on stock TJX. Here are the submissions:

    11/18/2015 9:37:54 AM|1|32|Order='12009304300/865009022' Name='SE_TJX_msStockGroupRenkoScalpV2' New state=Accepted Instrument='TJX' Action=SellShort Limit price=0 Stop price=0 Quantity=735 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:54 AM|1|32|Order='12009304300/865009022' Name='SE_TJX_msStockGroupRenkoScalpV2' New state=Working Instrument='TJX' Action=SellShort Limit price=0 Stop price=0 Quantity=735 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:54 AM|1|32|Order='12009304300/865009022' Name='SE_TJX_msStockGroupRenkoScalpV2' New state=Filled Instrument='TJX' Action=SellShort Limit price=0 Stop price=0 Quantity=735 Type=Market Filled=735 Fill price=67.84 Error=NoError Native error=''
    11/18/2015 9:37:54 AM|1|16|Execution='12009304356' Instrument='TJX' Account='865009022' Exchange=Default Price=67.84 Quantity=735 Market position=Short Operation=Insert Order='12009304300' Time='11/18/2015 9:37:54 AM'
    11/18/2015 9:37:54 AM|1|32|Order='d001ca39258e49789f6be4346f301649/865009022' Name='SS_TJX_msStockGroupRenkoScalpV2' New state=PendingSubmit Instrument='TJX' Action=BuyToCover Limit price=0 Stop price=68.41 Quantity=735 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:54 AM|1|32|Order='NT-27/865009022' Name='ST_TJX_msStockGroupRenkoScalpV2' New state=PendingSubmit Instrument='TJX' Action=BuyToCover Limit price=67.42 Stop price=0 Quantity=735 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:54 AM|1|64|Instrument='TJX' Account='865009022' Avg price=67.84 Quantity=735 Market position=Short Operation=Insert Currency=UsDollar
    11/18/2015 9:37:56 AM|1|32|Order='12009304701/865009022' Name='SS_TJX_msStockGroupRenkoScalpV2' New state=Accepted Instrument='TJX' Action=BuyToCover Limit price=0 Stop price=68.41 Quantity=735 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:56 AM|1|32|Order='12009304701/865009022' Name='SS_TJX_msStockGroupRenkoScalpV2' New state=Working Instrument='TJX' Action=BuyToCover Limit price=0 Stop price=68.41 Quantity=735 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:56 AM|1|32|Order='12009304702/865009022' Name='ST_TJX_msStockGroupRenkoScalpV2' New state=Accepted Instrument='TJX' Action=BuyToCover Limit price=67.42 Stop price=0 Quantity=735 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 9:37:56 AM|1|32|Order='12009304702/865009022' Name='ST_TJX_msStockGroupRenkoScalpV2' New state=Working Instrument='TJX' Action=BuyToCover Limit price=67.42 Stop price=0 Quantity=735 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''

    Sometime later, the target received a partial fill (which was only fully filled over an hour later), but the stoploss was cancelled immediately (and not by my code). The position was now unprotected. I would have expected the stoploss order to be reduced by the amount of the fill rather than being cancelled.
    Is this standard procedure for the TD Ameritrade API? Can it be prevented?


    11/18/2015 11:06:15 AM|1|32|Order='12009304701/865009022' Name='SS_TJX_msStockGroupRenkoScalpV2' New state=Cancelled Instrument='TJX' Action=BuyToCover Limit price=0 Stop price=68.41 Quantity=735 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    11/18/2015 11:06:15 AM|1|32|Order='12009304702/865009022' Name='ST_TJX_msStockGroupRenkoScalpV2' New state=PartFilled Instrument='TJX' Action=BuyToCover Limit price=67.42 Stop price=0 Quantity=735 Type=Limit Filled=48 Fill price=67.42 Error=NoError Native error=''
    11/18/2015 11:06:15 AM|1|16|Execution='12009884486' Instrument='TJX' Account='865009022' Exchange=Default Price=67.42 Quantity=48 Market position=Long Operation=Insert Order='12009304702' Time='11/18/2015 11:06:15 AM'
    11/18/2015 11:06:16 AM|1|64|Instrument='TJX' Account='865009022' Avg price=67.84 Quantity=687 Market position=Short Operation=Update Currency=UsDollar
    11/18/2015 11:06:19 AM|1|32|Order='12009304702/865009022' Name='ST_TJX_msStockGroupRenkoScalpV2' New state=PartFilled Instrument='TJX' Action=BuyToCover Limit price=67.42 Stop price=0 Quantity=735 Type=Limit Filled=248 Fill price=67.42 Error=NoError Native error=''
    11/18/2015 11:06:19 AM|1|16|Execution='12009884715' Instrument='TJX' Account='865009022' Exchange=Default Price=67.42 Quantity=200 Market position=Long Operation=Insert Order='12009304702' Time='11/18/2015 11:06:19 AM'

    Thanks,
    saltminer

    #2
    Hello,

    Thank you for the inquiry.

    Can you please send in the Log and Trace files for the day in question along with the order# in question to platform support @ ninjatrader.com for further review?

    You can do this by going to the Control Center-> Help-> Mail to Platform Support.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    11 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    16 views
    0 likes
    Last Post AaronKoRn  
    Working...
    X