Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need some help

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

    #31
    What compile error do you get where?

    Comment


      #32
      "Error on generating strategy" It's the same one I've already quoted in my post #16

      Matt

      Comment


        #33
        Right. So what compile errors do you get where?

        Comment


          #34
          Error CS0117 in those two lines:

          if (ParabolicSAR(0.02, 0.2, 0.02)[0] < GetCurrentBid()

          as well as

          if (ParabolicSAR(0.02, 0.2, 0.02)[0] > GetCurrentBid()

          Message says: NinjaTrader.Strategy.TradeCollection' does not contain definition for Performance

          Comment


            #35
            These lines definitely will no throw these errors below. Double click on the error message to get to the erroneous line and fix the coding bugs there.

            Comment


              #36
              Sorry, those were not correct lines. After double clicking on error message word Performance gets highlighted in both of those lines (below):

              && Performance.AllTrades.Performance.Points.CumProfit < Variable0)


              and this


              && Performance.AllTrades.Performance.Points.CumProfit < Variable0)

              Comment


                #37
                Right, you need to change these lines accordingly my post #19.

                Comment


                  #38
                  I did that, clicked compile botton and still the same errors come up

                  Comment


                    #39
                    Of course. You need to edit the erroneous lines as per my post #19 before compiling.

                    Comment


                      #40
                      Thanks Dierk, it works now, however I have two user defined variables in my strategy that need to be optimized. When I right click on product and click backtest I can't see those in the window with wizard settings. Do I have to declare them first somehow ? Thanks

                      Comment


                        #41

                        Comment


                          #42
                          One more quick question Dierk. How do I reset value of my user defined imput at the end of the session ? From what I see there is no way to add condition (using wizard) like: if time value = 15:15 then Realized P/L =0.
                          Thanks for help

                          Comment


                            #43
                            I suggest browsing the available tips and reference samples on this forum first in case you have NinjaScript related questions:

                            Comment


                              #44
                              Dierk, I checked all this stuff but still can't make it work. I'm trying to reset (at 3:14pm) a variable (pL) that calculates realized P/L so I added condition:
                              // Condition set 3
                              if (ToTime(Time[0]) >= 151400
                              set { pL = 0 }

                              which I guess is correct, however an error comes up few lines below:

                              #region Properties
                              [Description(
                              "")]
                              {[Category(
                              "Parameters")] - message says }expected
                              publicint TG

                              How do I correct it ?

                              Comment


                                #45
                                Not sure what wanted to do but your code snippet below is not C#. I suggest reading a book on C# to understand the basic syntax concept (e.g. check on Amazon or free web ressources).

                                Unfortunately we can't provide support down to the level of C# coding basics. However here is a hint; your code below probably should read like
                                Code:
                                [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) >= [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]151400)
                                    [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]pL = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New];[/FONT][/SIZE]

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                110 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                59 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                37 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                41 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                78 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X