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 Shansen, 08-30-2019, 10:18 PM
        24 responses
        942 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        9 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by rocketman7, Today, 01:00 AM
        0 responses
        4 views
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        28 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        33 views
        0 likes
        Last Post wzgy0920  
        Working...
        X