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

Error in code while developing Full Spectrum of Pivots

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

    Error in code while developing Full Spectrum of Pivots

    Hello,

    I've taken the stock NinjaTrader Pivots indicator and added the full range of Classic Floor Pivots (through 5 levels) and Camarilla levels 3 through 5 as I had been unable to find indicators for these anywhere, and I HAVE looked.

    I redid the equations and am very close to finished, but I'm getting this error message on several lines...

    Hoping that it's a quick fix?

    'Ninjatrader.Custom.Resource' does not contain a definition for 'PivotsH5' (and so forth)

    Is this a definition I need to add within the NinjaTrader program itself or are there lines of code still needed or need to be modded?

    Thanks for your expertise!

    Tripp

    #2
    Hello BarefootHank,

    In the public input definitions there is likely a call to that custom resource in the Display attribute.

    If you see something like:
    Code:
    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display([B]ResourceType = typeof(Custom.Resource)[/B], Name = "Period", GroupName = "NinjaScriptParameters", Order = 0)]
    public int Period
    { get; set; }
    remove it
    Code:
    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display(Name = "Period", GroupName = "NinjaScriptParameters", Order = 0)]
    public int Period
    { get; set; }
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Chelsea.
      The only place I see that combination of code is under "Misc" #region Properties.

      Am I on the right track.

      Sorry for being such a .NET C# noob.

      Tripp

      Comment


        #4
        Hi Tripp,

        Its likely to be in the #region Properties.

        But it could be anywhere within the scope of the class.. It depends on if the person who wrote the script sticks to the NinjaScript conventions..

        That said, anywhere you see 'ResourceType = typeof(Custom.Resource)' remove it.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I did that.
          I'm still getting the error message 'NinjaTrader.Custom.Resource' does not contain a definition for:
          and it references my new pivots:

          PivotsR4
          PivotsR5
          PivotsS4
          PivotsS5
          PivotsH3
          PivotsH4
          PivotsH5
          PivotsL3
          PivotsL4
          PivotsL5

          Comment


            #6
            Hello Tripp,

            Have you removed all of them?

            If you double click an error message does it take you to an input that still has that resource in the Display attribute?

            If you certain this is not in your code, can you post the .cs script so that we may confirm?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Under Namespace where it defines what color the lines are to be:


              AdPlot(Brushes.RoyalBlue, NinjaTrader.Custom.Resource.PivotsPP);

              There is a line for each pivot and the new custom ones I added are the ones creating error messages.

              Comment


                #8
                Hello Tripp,

                Don't use custom resources in your script.

                Remove these and use strings.

                AddPlot(Brushes.RoyalBlue, "PivotsPP");
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks!

                  I think I am very close now.

                  Getting error messages of a different type.

                  Emailed Platform support just now attention to you.

                  Thanks!!!

                  Comment


                    #10
                    Chelsea is THE BOMB!!!

                    My TrippPivots full Classic Floor Pivot and Camarilla Pivot indicator is working flawlessly... I'm easily saving an hour every day of mindless number crunching between YM, NQ, CL, GC, HG & the all new BTC bitcoin contract CME will introduce on Dec 18...

                    Thank you so much Chelsea!

                    You went waaay far above and beyond the call of duty here.

                    In helping me, I am now inspired and developing another new indicator, actually writing my own code! I never would have taken that step without your patience and professionalism.

                    So grateful in Rochester, NY

                    Tripp

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Skifree, Today, 03:41 AM
                    1 response
                    2 views
                    0 likes
                    Last Post Skifree
                    by Skifree
                     
                    Started by usazencort, Today, 01:16 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post usazencort  
                    Started by kaywai, 09-01-2023, 08:44 PM
                    5 responses
                    603 views
                    0 likes
                    Last Post NinjaTrader_Jason  
                    Started by xiinteractive, 04-09-2024, 08:08 AM
                    6 responses
                    23 views
                    0 likes
                    Last Post xiinteractive  
                    Started by Pattontje, Yesterday, 02:10 PM
                    2 responses
                    22 views
                    0 likes
                    Last Post Pattontje  
                    Working...
                    X