Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access Yearly Profit

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

    Access Yearly Profit

    I would like to access the Annual or Monthly Net Profit. Is there a way to do this?

    #2
    Hello starcd,

    From the strategies trade performance there is only the profit per month property: https://ninjatrader.com/support/help...itpermonth.htm

    This would generally be something you would need to calculate similar to finding the daily net profit. We have a sample that demonstrates accumulating the cumulative profit and then resetting it daily, that same type of logic could be used to reset monthly or annually if you wanted to calculate those values.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the super fast answer.
      Too bad, I had hoped to be able to access the values in the analysis display.
      But I think they are calculated at the end of the data series anyway, right?

      Comment


        #4
        Hello starcd,

        To clarify, are you trying to develop a strategy which uses those values in its logic or see this in a performance view (strategy performance, analyzer etc.) ?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Within the Logic. My strategy is day by day, with trades that can be up to a year long and run past the year limit. I want to calculate the tax due at the end of the year. I currently do this via a Time[0].Year query and calculations using the SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit.it.

          Comment


            #6
            Hello starcd,

            Thanks for that.

            In the performance views you can sort by yearly/monthly however in code you would have to do as you are and use the performance collections. For a longer timeframe like a month or year that would take some logic similar to the accumulating a value daily using the session information but instead on the monthly or yearly scales. The Time object could be used to know when months or years have elapsed and some additional logic surrounding that would be needed.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by elirion, Today, 01:36 AM
            0 responses
            3 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by gentlebenthebear, Today, 01:30 AM
            0 responses
            3 views
            0 likes
            Last Post gentlebenthebear  
            Started by samish18, Yesterday, 08:31 AM
            2 responses
            9 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by Mestor, 03-10-2023, 01:50 AM
            16 responses
            389 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            34 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Working...
            X