Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Managing multiple ATMStrategies

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

    Managing multiple ATMStrategies

    Hi, have worked out how to programmatically create ATMStrategies ok and they work, I am able to create multiple discrete ATMstrategies in a ninjascritp strategy and I now need to have a way to manage those ATMstrategies. I believe i need to create a dictionary or a List to store the unique IDs and i know i can use GetATMStrateyEntryOrderStatus to see which orders have been filled. But how can i tell which Strategies are actually open positions or are completed ATMstrategies and the position closed by a corresponding Stop or Limit? Can you please set me on the right path to achieve this? If i need to use OnOrderUpdate or OnExecution, how do I reference an ATMStrategy Order?

    #2
    Hello, thanks for writing in. You will need to save each OrderID and ATMStrategyId that you generate from GetAtmStrategyUniqueId();​ In the SampleATMStategy script you will see this method is used two times, once to generate the OrderID variable and once to generate the ATMStrategyId variable so you would need to save both of these to associate them with one order with one ATM attached to that order. You can then use these ID variables in any of the ATM strategy status methods e.g.

    GetAtmStrategyEntryOrderStatus(string orderId)
    GetAtmStrategyMarketPosition(string atmStrategyId)

    To keep track of the order that is filled you will need C# logic like simple boolean flags and use these in conjunction with the ATM status methods that will keep track of the order of events. E.g. step 1 is submitting the entry order, checking its state, and monitoring the position after it has reached the Filled state.

    Comment


      #3
      Thanks i can see how that will work.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X