Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need some help

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

    #16
    I've already did that. It's still the same error .

    Message I get says:

    Strategy\PSAR.cs 'NinjaTrader.Strategy.TradeCollection' does not contain a definition for 'Performance' CS0117 - click for info 46 42

    What do I do with this ??

    Thanks

    Comment


      #17
      There is a bug in the PSAR strategy implementation. Please remove this strategy or contact the author for a fix. Thanks

      Comment


        #18
        I'm the author and I don't know where the bug is. Where is a mistake in such statement ?

        // Condition set 1
        if (ParabolicSAR(0.02, 0.2, 0.02)[0
        ] <= GetCurrentBid()
        && Performance.AllTrades.Performance.Points.CumProfit < Variable0)



        Comment


          #19
          NS editor intellisense and the docs will tell you that it should read:
          Performance.AllTrades.TradesPerformance.Points.CumProfit

          Comment


            #20
            I don't understand, what exactly you suggest I should do ? CS0117 error appears when I'm trying to use a method or access an exposed property that does not exist for your particular object.

            Comment


              #21
              Not sure what the confusion is. You should have TradesPerformance and not Performance for your code is what Dierk is suggesting.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                That's exactly waht I have, it doesn't changeanything

                Comment


                  #23
                  >> Strategy\PSAR.cs 'NinjaTrader.Strategy.TradeCollection' does not contain a definition for 'Performance' CS0117 - click for info 46 42
                  Please delete the PSAR strategy and try to compile -> should work.

                  Comment


                    #24
                    publicclass PSAR1 : Strategy - Is this what you want me to remove ??

                    Comment


                      #25
                      Tools->Edit NinjaScript->Strategy->Select PSAR strategy->press Delete button

                      Comment


                        #26
                        Do you want me to delete the whole strategy and write it from the beginning ? How is this going to help ??

                        Comment


                          #27
                          >> How is this going to help ??
                          Yes will help. Or edit the strategy and apply changes as per my post #19.

                          Comment


                            #28
                            I can not delete the strategy. Pop up message says that file is likely referenced by other Ninja Script files and those dpendencies need to be removed first. How do I do this ?

                            Comment


                              #29
                              Then edit the strategy according my post #19.

                              Comment


                                #30
                                Dierk, I did that - still doesn't work. Here's the code:

                                publicclass PSAR1 : Strategy
                                {
                                #region Variables
                                // Wizard generated variables
                                // User defined variables (add any user defined variables below)
                                #endregion
                                ///<summary>
                                /// This method is used to configure the strategy and is called once before any strategy method is called.
                                ///</summary>
                                protectedoverridevoid Initialize()
                                {
                                Add(ParabolicSAR(
                                0.02, 0.2, 0.02));
                                SetProfitTarget(
                                "", CalculationMode.Ticks, Variable1);
                                CalculateOnBarClose =
                                true;
                                }
                                ///<summary>
                                /// Called on each bar update event (incoming tick)
                                ///</summary>
                                protectedoverridevoid OnBarUpdate()
                                {
                                // Condition set 1
                                if (ParabolicSAR(0.02, 0.2, 0.02)[0] < GetCurrentBid()
                                && Performance.AllTrades.TradesPerformance.Points.Cum Profit < Variable0)
                                {
                                ExitShort(
                                "", "");
                                EnterLong(DefaultQuantity,
                                "");
                                }
                                // Condition set 2
                                if (ParabolicSAR(0.02, 0.2, 0.02)[0] > GetCurrentBid()
                                && Performance.AllTrades.TradesPerformance.Points.Cum Profit < Variable0)
                                {
                                ExitLong(
                                "", "");
                                EnterShort(DefaultQuantity,
                                "");
                                }

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                88 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                48 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                30 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                33 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                68 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X