Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyUnrealizedProfitLoss

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

    GetAtmStrategyUnrealizedProfitLoss

    Good morning.

    This sentence of the strategy seems not working, strategy is compiled but not workiing in strategy analizer or playback connection.

    Unrealized= GetAtmStrategyUnrealizedProfitLoss("AACartera6E1Fi xRat")+GetAtmStrategyUnrealizedProfitLoss("AACarte ra6E3FixRat") ;

    AACartera6E1FixRat and AACartera6E3FixRat are 2 strategies and Unrealized is a double value.


    #2
    Hello Chuso,

    I see you are posting in the NinjaTrader 7 section of the forums.

    To confirm, your script is created in NinjaTrader 7 and not NinjaTrader 8 Desktop?

    If so, unfortunately Atm Strategy methods are not available in NinjaTrader 7. These were a new edition to NinjaTrader 8.

    If you were referring to NinjaTrader 8 please let me know and I will move this thread to the NinjaTrader Desktop > Strategy Development section of the forums.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea.

      It´s Ninja Trader 8, please move this thread to the correct place

      Comment


        #4
        Hello Chuso,

        Thank you for confirming this is for NinjaTrader 8.

        May I confirm that "AACartera6E1Fi xRat" is a generated id for the atm instance created with AtmStrategyCreate() and is not the atm template name?
        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


        Is this ID unique for every new atm instance created with AtmStrategyCreate()?

        Included with NinjaTrader is the SampleAtmStrategy which has sample code of using AtmStrategy methods.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea, is the template name, can you tell me how to get the ID of some strategies in order to get the unrealized profit loss of all of them?

          Comment


            #6
            Hello Chuso,

            You must generate a new unique id for every atm strategy instance and every entry order.

            GetAtmStrategyUniqueId() can be used to generate a unique string.

            Please look at the documentation I have linked in post # 4. This includes sample code.

            Please also look at the SampleAtmStrategy included with NinjaTrader. This includes sample code.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello Chelsea.
              I am having a lot of problems with AtmStrategy methods, is possible to get realized and unrealized profit loss by instrument?

              Comment


                #8
                Hello Chuso,

                Unfortunately not with Atm Strategy methods in a NinjaScript strategy. The orders submitted with AtmStrategyCreate() will only be created for the instrument and account selected for the NinjaScript Strategy, and GetAtmStrategyUnrealizedProfitLoss() and GetAtmStrategyRealizedProfitLoss() require the atmStrategyId string that was generated by the strategy.
                Chelsea B.NinjaTrader Customer Service

                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