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

GetAtmStrategyMarketPositon method error: ATM strategy ID does not exist

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

    GetAtmStrategyMarketPositon method error: ATM strategy ID does not exist

    I created a strategy and it works it well but I get GetAtmStrategyMarketPositon method error: ATM strategy ID does not exist once in a while.

    Do I put a try catch to get rid of this error?

    If this error happens my strategy still runs but it will not continue set up my pending orders

    #2
    Hello ballboy11,

    Thanks for your post.

    How you would like to deal with the error would be subjective to your strategy and how it is written. Some questions that may be relevant while you take debugging steps:
    • What circumstances lead the strategy to report that this ID did not exist?
    • Was this ID different than the ID used to generate the Atm strategy?

    Adding prints for the AtmStrategyID's that you create, use and reference can help you track down what ID is being sent to the method which fires the error.

    When I test our bundled SampleAtmStrategy, I don't encounter such errors. I'd recommend referencing this strategy for a working example that may provide further direction. Specifically, please note how this strategy uses "atmStrategyId" and "isAtmStrategyCreated."

    This code is openly available. I would also advise testing this strategy along side your strategy and then to model this strategy's behavior in your own works before changing the implementation.

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cls71, Today, 04:45 AM
    0 responses
    1 view
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Working...
    X