• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 bosajin, Today, 06:27 PM
        0 responses
        2 views
        0 likes
        Last Post bosajin
        by bosajin
         
        Started by saltminer, Today, 06:11 PM
        0 responses
        2 views
        0 likes
        Last Post saltminer  
        Started by epitoma, Today, 05:21 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by BatBart, Today, 01:24 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by ezrakoper, Today, 03:05 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X