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

AtmStrategy.StartAtmStrategy(atm, order) does NOT start ATM strategy

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

    AtmStrategy.StartAtmStrategy(atm, order) does NOT start ATM strategy

    In indicator class, using line AtmStrategy.StartAtmStrategy(atm, order) does not start Atm strategy. The order is created but does not submit, it hangs with "initialized" state.

    Adding line account.Submit(new[] { order }) does submit the order. But it is not associated with an Atm strategy.

    Order is created using Order order​ = account.CreateOrder(...)
    AtmStrategy atm = ChartControl.OwnerChart.ChartTrader.AtmStrategy;

    #2
    Originally posted by yubo27 View Post
    In indicator class, using line AtmStrategy.StartAtmStrategy(atm, order) does not start Atm strategy. The order is created but does not submit, it hangs with "initialized" state.

    Adding line account.Submit(new[] { order }) does submit the order. But it is not associated with an Atm strategy.

    Order is created using Order order​ = account.CreateOrder(...)
    AtmStrategy atm = ChartControl.OwnerChart.ChartTrader.AtmStrategy;
    Using StartAtmStrategy() requires the "name" argument in the CreateOrder()
    method be named "Entry" for the Atm Strategy to be started successfully.​

    Can you confirm you are doing this?

    Can you provide a minimal working indicator
    with the exact code that is causing this problem?​

    Comment


      #3
      Hello yubo27,

      Thanks for your notes.

      From the StartAtmStrategy() help guide page:

      "The "name" argument on the CreateOrder() method MUST be named "Entry" for the ATM Strategy to be started successfully."

      To clarify, are you setting the "name" argument to be "Entry" when calling CreateOrder() to create the order?

      If the "name" argument of the CreateOrder() method is not "Entry" then StartAtmStrategy() will not start.

      StartAtmStrategy(): https://ninjatrader.com/support/help...tmstrategy.htm
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Renaming order name to "Entry" solves the problem.
        But this kind of hard-coded condition is not a well-designed API. Order name could be anything, which is what I used to track which order is which.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, Today, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        7 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Today, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        151 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Working...
        X