Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

when submitting order with StartAtmStrategy(), the order is stuck at "Initialized" st

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

    when submitting order with StartAtmStrategy(), the order is stuck at "Initialized" st

    please see attached indicator file.

    protected override void OnBarUpdate()
    {
    if (Toggle==true) return;

    myAccount=ChartControl.OwnerChart.ChartTrader.Acco unt;
    Order myEntryOrder = myAccount.CreateOrder(
    Instrument, OrderAction.Buy, OrderType.Market,
    OrderEntry.Manual,TimeInForce.Day,1,0, 0,string.Empty,String.Empty,
    Core.Globals.MaxDate,null);
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(
    ChartControl.OwnerChart.ChartTrader.AtmStrategy.Te mplate, myEntryOrder);
    //myAccount.Submit(new [] {myEntryOrder});
    Toggle=true;
    }

    as you see in the picture, when the order is submitted with
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(
    ChartControl.OwnerChart.ChartTrader.AtmStrategy.Te mplate, myEntryOrder);
    then it is stuck at initialized status.

    but when the order is submitted with
    myAccount.Submit(new [] {myEntryOrder});
    then it is immediately filled.

    more weirdly, when I tried to close those orders, they are stuck in "Cancel pending" status.

    what is wrong?
    Attached Files

    #2
    hi anyone could help, please?

    Comment


      #3
      Hello leontancfa,

      Thank you for your posts.

      I apologize for the belated reply - we had a glitch in the application that sends forum posts to our ticketing system yesterday that we've just discovered overnight and fixed.

      It looks like you're not specifying an ATM template or ATM ID, which would be necessary to create an ATM Strategy. I would advise looking over the section of our help guide on creating ATM Strategies in a NinjaScript Strategy using AtmStrategyCreate first:



      I would also advise looking at the built in Sample ATM Strategy which you can find in the NinjaScript Editor in the Strategies folder. That example script contains a number of comments that should help get you going in the correct direction.

      Please let us know if we may be of further assistance to you.

      Comment


        #4
        hi,
        1. the link you provided https://ninjatrader.com/support/help...tegycreate.htm
        is for coding a strategy; but I'm trying to code a manual entry approach with addon. so it's not relevant.

        2. FYI for all that the problem is resolved after I give a name to the order. it seems the code does not like an order with empty string. @support suggest to make the code throw clearer error when an order is stuck at initialized order.

        myEntryOrder = myAccount.CreateOrder(Instrument, OrderAction.Buy, OrderType.Limit,
        TimeInForce.Day, 1, convertedPrice, 0, string.Empty, "Entry", null);

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        663 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        376 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X