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

SystemPerformance.AllTrades.Count

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

    #16
    Hello staycool3_a,

    The IncludeTradeHistoryInBacktest does also block strategy performance with real-time trades as well when a strategy is added directly to the Strategies tab of the Control Center.

    We are further investigating if this is expected behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Hello staycool3_a,

      I have confirmed with development that IncludeTradeHistoryInBacktest must be true for the SystemPerformance collection to be populated.

      Below is a public link to where this is mentioned in the Notes of the SystemPerformance page of the help guide.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello staycool3_a,

        I have confirmed with development that IncludeTradeHistoryInBacktest must be true for the SystemPerformance collection to be populated.

        Below is a public link to where this is mentioned in the Notes of the SystemPerformance page of the help guide.
        https://ninjatrader.com/support/help...erformance.htm
        Thank you, Chelsea. But i'm confused.

        The issues discussed in this thread and the IncludeTradeHistoryInBacktest suggestion is only applicable for the strategy tab. If the strategy is added via chart, the tradesperformance statistics are populated regardless if the data is historical/marketreplay or real-time and regardless if the trades are paper trades or cash. Correct?

        Comment


          #19
          Hello staycool3_a,

          IncludeTradeHistoryInBacktest defaults to true when a strategy is added to a chart. It will default to false if added to anything other than a chart.

          IncludeTradeHistoryInBacktest must be true for StrategyPerformance to populate.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            hello. I try to implement the code in the strategy to determine the number of lots of the last transaction. but it doesn't output anything. can you test your zhtot code?
            Attached Files

            Comment


              #21
              Hello Arkadiy_B,

              Thank you for your note.

              To clarify, you're trying to find the number of contracts of the last trade, is that correct? Are you trying to get this for just a strategy or for an entire account?

              You don't need to subscribe to the account if you're just trying to get the information for the last trade taken by a strategy, but if you're wanting to monitor manual orders then you'd need to subscribe to account updates. The account itself doesn't have a concept of trades - NinjaTrader creates "trades" by matching executions first in, first out. So if you're wanting to find the last trade quantity on the overall account it'd be pretty complicated. I would recommend looking at execution quantity or the order associated with the execution, but there would not be a supported way to fetch a trade programmatically at account level - you could try designing your own logic to match executions together but that's going to get complex pretty quickly.

              I'm attaching an example of getting the last trade quantity for a strategy.

              Please let us know if we may be of further assistance to you.

              Attached Files
              Kate W.NinjaTrader Customer Service

              Comment


                #22
                Hi,

                just spent two hours (again) on the same issue.
                No way it works putting IncludeTradeHistoryInBacktest = true; under State.SetDefault.
                Eventually solved putting it under State.Configure

                else if (State == State.Configure)
                {
                IncludeTradeHistoryInBacktest = true;
                }

                NT8 version 8.0.25.0 64-bit
                Regards
                Last edited by simone.bern; 11-15-2021, 11:35 AM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DJ888, 04-16-2024, 06:09 PM
                4 responses
                12 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                8 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                6 views
                0 likes
                Last Post nandhumca  
                Started by The_Sec, Today, 03:37 PM
                0 responses
                3 views
                0 likes
                Last Post The_Sec
                by The_Sec
                 
                Started by GwFutures1988, Today, 02:48 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Working...
                X