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

Stop loss / profit taker orders disappeared after partial fill

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

    Stop loss / profit taker orders disappeared after partial fill

    Hello!

    I am running tests on live data. The script for exit uses simple stop and profit taker order from strategy builder section:

    SetProfitTarget("", CalculationMode.Percent, Profit_taker);
    SetTrailStop("", CalculationMode.Percent, Trail, false);


    In 99% of cases all works fine. However, sometimes when the order is filled partially, eg. the current position 332 but short sell was filled as 100 and 232 in 2 orders, then stop order fills only 100 quantity and status in orders tab for stop order changes into "filled" and no more stop orders are followed remaining 232 shares.This is really annoying, because I am stuck with the shares that already should be sold. Please see below attached image from order tab.

    Here are also the all logs i have:
    Once the partially filled share short order is filled (blue highlighted part) the script thinks that there is only 100 quantity, so the stop order and profit taker is all the time in logs updated for quantity 100. Even though after few milliseconds the order short sell is filling another 232 quantity. (green higlighted)

    Could you please advise how to repair it?

    9:30:04 AM Order Order='e157b16faa1645bf8332cc1e18bc612d/SimStrateg_C_D_profit_taker' Name='Sell short' New state='Submitted' Instrument='CLIR' Action='Sell short' Limit price=0 Stop price=0 Quantity=332 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='e157b16faa1645bf8332cc1e18bc612d/SimStrateg_C_D_profit_taker' Name='Sell short' New state='Accepted' Instrument='CLIR' Action='Sell short' Limit price=0 Stop price=0 Quantity=332 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='e157b16faa1645bf8332cc1e18bc612d/SimStrateg_C_D_profit_taker' Name='Sell short' New state='Working' Instrument='CLIR' Action='Sell short' Limit price=0 Stop price=0 Quantity=332 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='e157b16faa1645bf8332cc1e18bc612d/SimStrateg_C_D_profit_taker' Name='Sell short' New state='Partially filled' Instrument='CLIR' Action='Sell short' Limit price=0 Stop price=0 Quantity=332 Type='Market' Time in force=GTC Oco='' Filled=100 Fill price=3.01 Error='No error' Native error=''
    9:30:04 AM NinjaScript NinjaScript strategy 'shortpremarket113realtimeprofitstop/203694206' submitting order
    9:30:04 AM Execution Execution='b9d654501a93412fa3a7ac548d50c77e' Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Exchange=Default Price=3.01 Quantity=100 Market position=Short Operation=Operation_Add Order='e157b16faa1645bf8332cc1e18bc612d' Time='6/17/2020 9:30 AM'
    9:30:04 AM Order Order='cb73d3b3661047289c9bcc9c20d1282b/SimStrateg_C_D_profit_taker' Name='Trail stop' New state='Submitted' Instrument='CLIR' Action='Buy to cover' Limit price=0 Stop price=3.61 Quantity=100 Type='Stop Market' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM NinjaScript NinjaScript strategy 'shortpremarket113realtimeprofitstop/203694206' submitting order
    9:30:04 AM Position Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Average price=3.01 Quantity=100 Market position=Short Operation=Operation_Add
    9:30:04 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Submitted' Instrument='CLIR' Action='Buy to cover' Limit price=2.41 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='e157b16faa1645bf8332cc1e18bc612d/SimStrateg_C_D_profit_taker' Name='Sell short' New state='Filled' Instrument='CLIR' Action='Sell short' Limit price=0 Stop price=0 Quantity=332 Type='Market' Time in force=GTC Oco='' Filled=332 Fill price=3.0030120481927711 Error='No error' Native error=''
    9:30:04 AM Execution Execution='ca6fbddcb1f24c0e893e68b1d1181ca6' Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Exchange=Default Price=3 Quantity=232 Market position=Short Operation=Operation_Add Order='e157b16faa1645bf8332cc1e18bc612d' Time='6/17/2020 9:30 AM'
    9:30:04 AM Position Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Average price=3.0030120481927711 Quantity=332 Market position=Short Operation=Update
    9:30:04 AM Order Order='cb73d3b3661047289c9bcc9c20d1282b/SimStrateg_C_D_profit_taker' Name='Trail stop' New state='Accepted' Instrument='CLIR' Action='Buy to cover' Limit price=0 Stop price=3.61 Quantity=100 Type='Stop Market' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Accepted' Instrument='CLIR' Action='Buy to cover' Limit price=2.41 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Change submitted' Instrument='CLIR' Action='Buy to cover' Limit price=2.4 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Accepted' Instrument='CLIR' Action='Buy to cover' Limit price=2.4 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:30:04 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Working' Instrument='CLIR' Action='Buy to cover' Limit price=2.4 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''


    9:32:22 AM Order Order='cb73d3b3661047289c9bcc9c20d1282b/SimStrateg_C_D_profit_taker' Name='Trail stop' New state='Filled' Instrument='CLIR' Action='Buy to cover' Limit price=0 Stop price=3.56 Quantity=100 Type='Stop Market' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=100 Fill price=3.56 Error='No error' Native error=''
    9:32:22 AM Order Order='cb73d3b3661047289c9bcc9c20d1282b/SimStrateg_C_D_profit_taker' Name='Trail stop' New state='Working' Instrument='CLIR' Action='Buy to cover' Limit price=0 Stop price=3.56 Quantity=100 Type='Stop Market' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:32:22 AM Position Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Average price=3.0030120481927711 Quantity=232 Market position=Short Operation=Update
    9:32:22 AM Execution Execution='c597b473e42b4ff1b3d24bc4715c963d' Instrument='CLIR' Account='SimStrateg_C_D_profit_taker' Exchange=Default Price=3.56 Quantity=100 Market position=Long Operation=Operation_Add Order='cb73d3b3661047289c9bcc9c20d1282b' Time='6/17/2020 9:32 AM'
    9:32:22 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Cancel submitted' Instrument='CLIR' Action='Buy to cover' Limit price=2.4 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''
    9:32:22 AM Order Order='c74f18ebefc74ad28a5865db608bfb06/SimStrateg_C_D_profit_taker' Name='Profit target' New state='Cancelled' Instrument='CLIR' Action='Buy to cover' Limit price=2.4 Stop price=0 Quantity=100 Type='Limit' Time in force=GTC Oco='b9d654501a93412fa3a7ac548d50c77e' Filled=0 Fill price=0 Error='No error' Native error=''

    #2
    Hello lea04,

    Is this reproducible with all part filled entry orders?

    If yes, please send an email to platformsupport [at] ninjatrader [dot] com so that we may request further information.
    In the email please include ticket ID 2609782.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    22 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    21 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Working...
    X