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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        87 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        47 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        105 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X