Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Working with ATM Strategy IDs

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

    Working with ATM Strategy IDs

    I am developing a strategy with the ATM functions.

    What I want to do is develop the code that closes all atm strategies that were not filled on the last bar. The problem that I am having is that I do not know what the strategyID is since it was created on the last bar.

    Is there a way to get all past strategyIDs that are still active as in either have a current order in or a market position?

    #2
    JamesMH, you will have to manually keep track of the strategyIDs throughout the life of the strategy. What exactly do you mean by you don't know what the strategyID is since it was created on the last bar?

    With ATM strategies, you can generate a new unique ID like this:
    Code:
    protected override void OnBarUpdate() 
    {    
        string orderId = GetAtmStrategyUniqueId(); 
    }
    You could then create an ArrayList or something similar to store all of your orderIds.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Since the DataSeries cannot hold string values for the IDs how could I access the ArrayList over multiple bars?

      Comment


        #4
        James, an ArrayList is not a DataSeries. Please see this page for a quick reference for ArrayLists. Once you create an ArrayList, it will remain throughout the duration of the strategy/backtest/indicator/whatever. It doesn't get reset unless you say so.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        574 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X