Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing last close price of an Atm Strategy trade

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

    Accessing last close price of an Atm Strategy trade

    Needed to access the last close price or PnL of a trade when using the Atm Strategy format. Currently, I have to use the unrealized pnl (GetAtmStrategyUnrealizedProfitLoss(atmStrategyId) ) and calculate it from this last known value that is stored. It works, but is a tick or 2 off occasionally. I know that GetAtmStrategyRealizedProfitLoss(atmStrategyId) will return the last trade's value, however, it has to be a Flat period in the strategy.My strategy is such that it is never actually is flat as it executes right after an exit on the next bar. It works well, but GetAtmStrategyUnrealizedProfitLoss(atmStrategyId) will only work when flat, I believe. Therefore, I need to access the last stored value somehow, maybe using another property or variable? I have this set up on an Non Atm strategy and it works flawlessly because I can access "Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1]" data. Thank you for your help.

    #2
    Hello 1sebddn1,

    The only values that you can access from an ATM are the values you can get from the methods like GetAtmStrategyUnrealizedProfitLoss. Your strategy can access the current market price but any atm specific values would be limited to the values returned by the methods because that is an external strategy.

    Comment


      #3
      Thank you for your quick reply, Jesse.

      So are you saying there is no way to access the data stored in "SystemPerformance.AllTrades[SystemPerformance.AllTrades]" for an ATM strategy? Only the monitored functions in the ATM Strategy Monitoring section of the Help guide are available? I think there are only 8 of them. Just to clarify. Thank you.

      Comment


        #4
        Hello 1sebddn1,

        SystemPerformance is not used for ATM's, ATM's area a external strategy separate from the script used to start them. None of the strategy properties or methods apply to ATM's, the only methods that apply to ATM's are the specific items shown here: https://developer.ninjatrader.com/do...rategy_methods

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        547 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        323 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        99 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        545 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X