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

Problem buying GBTC

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

    Problem buying GBTC

    Hello!! I have a strategy that buys in GBTC, she has operated without problems, however today she could not execute the order and the log shows me this information. My execution is at the ask price. But I don't see any errors that describe what could have happened

    This is what the log shows:

    2021-05-11 19:44:59:931|1|16|NinjaScript strategy 'Percent_b_indicator_8_realtime/207013772' submitting order

    2021-05-11 19:45:00:164|1|32|Order='ec2a706a566c4dee97a3bdc69 d598ac9/ACCOUNTREMOVED' Name='Percent_b_indicator_8_EnterLong' New state='Submitted' Instrument='GBTC' Action='Buy' Limit price=44.98 Stop price=0 Quantity=12 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    2021-05-11 19:45:00:262|1|32|Order='288774649/ACCOUNTREMOVED' Name='Percent_b_indicator_8_EnterLong' New state='Accepted' Instrument='GBTC' Action='Buy' Limit price=44.98 Stop price=0 Quantity=12 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    2021-05-11 19:45:00:264|1|32|Order='288774649/ACCOUNTREMOVED' Name='Percent_b_indicator_8_EnterLong' New state='Working' Instrument='GBTC' Action='Buy' Limit price=44.98 Stop price=0 Quantity=12 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    2021-05-11 19:45:04:253|1|32|Order='288774649/ACCOUNTREMOVED' Name='Percent_b_indicator_8_EnterLong' New state='Cancel submitted' Instrument='GBTC' Action='Buy' Limit price=44.98 Stop price=0 Quantity=12 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    2021-05-11 19:45:04:383|1|32|Order='288774649/ACCOUNTREMOVED' Name='Percent_b_indicator_8_EnterLong' New state='Cancelled' Instrument='GBTC' Action='Buy' Limit price=44.98 Stop price=0 Quantity=12 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''


    Trace files:

    2021-05-11 19:45:04:248 NinjaScript.StrategyBase.CancelExpiredOrders: orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=Working instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:00' gtd='2099-12-01' statementDate='2021-05-11'

    2021-05-11 19:45:04:250 (EFT) Cbi.Account.Cancel0: realOrderState=Working orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=Working instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:00' gtd='2099-12-01' statementDate='2021-05-11'

    2021-05-11 19:45:04:250 (EFT) Cbi.Account.OrderUpdateCallback: realOrderState=CancelPending orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=CancelPending instrument='GBTC' orderAction=Buy limitPrice=44.98 stopPrice=0 quantity=12 orderType='Limit' filled=0 averageFillPrice=0 time='2021-05-11 19:45:04' statementDate='2021-05-11' error=NoError comment='' nr=-1

    2021-05-11 19:45:04:252 (EFT) Cbi.Account.Cancel1: realOrderState=CancelPending orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=CancelPending instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:04' gtd='2099-12-01' statementDate='2021-05-11'

    2021-05-11 19:45:04:253 (EFT) IB.Adapter.Cancel0: count=1
    2021-05-11 19:45:04:253 (EFT) IB.Adapter.Cancel: orderId='288774649' account='HIDE'

    name='Percent_b_indicator_8_EnterLong'orderState=C ancelPending instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:04' gtd='2099-12-01' statementDate='2021-05-11'

    2021-05-11 19:45:04:253 (EFT) Cbi.Account.OrderUpdateCallback: realOrderState=CancelSubmitted orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=CancelSubmitted instrument='GBTC' orderAction=Buy limitPrice=44.98 stopPrice=0 quantity=12 orderType='Limit' filled=0 averageFillPrice=0 time='2021-05-11 19:45:04' statementDate='2021-05-11' error=NoError comment='' nr=-1

    2021-05-11 19:45:04:302 (EFT) IB.Adapter.OnOrderStatus0: orderId='234' permId='288774649' filled='0' avgFillPrice='0' status='Cancelled' remaining='12'
    2021-05-11 19:45:04:303 (EFT) IB.Adapter.OnOrderStatus2: newState=Cancelled

    2021-05-11 19:45:04:303 (EFT) Cbi.Account.OrderUpdateCallback: realOrderState=Cancelled orderId='288774649' account='HIDE'name='Percent_b_indicator_8_EnterLon g' orderState=Cancelled instrument='GBTC' orderAction=Buy limitPrice=44.98 stopPrice=0 quantity=12 orderType='Limit' filled=0 averageFillPrice=0 time='2021-05-11 19:45:04' statementDate='2021-05-11' error=NoError comment='' nr=-1
    2021-05-11 19:45:04:384 NinjaScript.StrategyBase.Process.ExpiredOrder: orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=Cancelled instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:04' gtd='2099-12-01' statementDate='2021-05-11'

    2021-05-11 19:45:04:385 (EFT) IB.Adapter.OnError: id=234 errorCode='OrderCancelled' errorMessage='Orden cancelada. Motivo:'
    Starts
    05-09-2021
    Ends
    05-12-2021
    Last edited by NinjaTrader_Kate; 05-11-2021, 02:31 PM. Reason: Removed personally identifiable acct info

    #2
    Hello 7robert,

    Thank you for your reply.

    When using the Managed approach, by default a limit order would be cancelled if the conditions for entry are no longer true and it has not yet been filled. This appears to be what's occurring here:

    2021-05-11 19:45:04:248 NinjaScript.StrategyBase.CancelExpiredOrders: orderId='288774649' account='HIDE' name='Percent_b_indicator_8_EnterLong' orderState=Working instrument='GBTC' orderAction=Buy orderType='Limit' limitPrice=44.98 stopPrice=0 quantity=12 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=699 time='2021-05-11 19:45:00' gtd='2099-12-01' statementDate='2021-05-11'

    That being said, it is possible to submit orders that stay alive until explicitly cancelled. This example from our help guide illustrates how this may be done:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      But could there be any reason why the order was not completed on the first try?

      Comment


        #4
        Hello 7robert,

        Thank you for your reply.

        With limit orders you're not guaranteed a fill. If there isn't enough volume to fill your order at the price level specified or better, the order may not fill. With a market order, you'd be guaranteed a fill, but not the price the order fills at.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        2 responses
        20 views
        0 likes
        Last Post maybeimnotrader  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        22 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X