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

Ignored SubmitOrderManaged() method

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

    Ignored SubmitOrderManaged() method

    Hello,

    I have two Long Positions of the same instrument in NinjaTrader. I can see this in the Positions tab of NinjaTrader. The reason, why there are two positions, is unclear form me anyhow.

    I use the following code to exit the long position:

    "targetOrder = ExitLongLimit(0, true, 1, LongExitLimit, "myLongExit", "myLongEntry");"

    In my strategy, I use in OnStateChange also

    "IsAdoptAccountPositionAware = true;
    StartBehavior = StartBehavior.AdoptAccountPosition;"

    Unfortunately, I get the error message in the NinjaScript Output with the reason "This was an exit order but no position exists to exit'.

    What did I do wrong?

    Kind you
    Gerik

    #2
    Hello Gerik,

    Thank you for your reply.

    CRITICAL — If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

    If your trades are with NinjaTrader Brokerage, you can contact NinjaTrader Brokerage Order Desk here:
    • Phone: 312.423.2234
    • Email: orders [at] ninjatrader [dot] com
    That exit order wouldn't be able to exit an existing position - it could only exit an order generated by the strategy with the name "myLongEntry". So when the conditions to trigger that exit for an adopted position are true, you would get that error. You'd need a different exit to exit an adopted position that didn't use the signal names.

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

    Comment


      #3
      Hello Kate,

      thank you for your response.

      Originally posted by NinjaTrader_Kate View Post
      You'd need a different exit to exit an adopted position that didn't use the signal names.
      How can I exit an adopted position without signal names?

      Gerik

      Comment


        #4
        Hello Gerik,

        Thank you for your reply.

        You'd need to submit the stop loss and target for it without specifying the FromEntrySignal. I've attached an example one of my colleagues created that shows how to submit those only for the initial order when it starts up.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rhyminkevin, Today, 04:58 PM
        3 responses
        48 views
        0 likes
        Last Post Anfedport  
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        50 views
        0 likes
        Last Post futtrader  
        Working...
        X