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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        78 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X