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 judysamnt7, 02-03-2025, 12:42 PM
                4 responses
                30 views
                0 likes
                Last Post judysamnt7  
                Started by reynoldsn, Today, 08:54 PM
                0 responses
                5 views
                0 likes
                Last Post reynoldsn  
                Started by Powerbucker, Yesterday, 01:42 PM
                3 responses
                22 views
                0 likes
                Last Post Powerbucker  
                Started by cd0568491, Today, 05:57 PM
                1 response
                4 views
                0 likes
                Last Post cd0568491  
                Started by Parmenides48, Today, 04:37 PM
                1 response
                9 views
                0 likes
                Last Post Parmenides48  
                Working...
                X