Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on try to add parameter

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

    Error on try to add parameter

    I am trying to add a parameter to a user Ninja 8 indicator but get a "class, delagate, enum, interface struct expected" error. Not sure what it is telling me it doesn't like about it other than it is clearly not happy. I copied the statements from an exiting indicator that compiles normally.

    ----------------------
    region Properties

    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "Smooth", GroupName = "NinjaScriptParameters", Order = 0)]
    public int Smooth
    { get; set; }

    #endregion
    ------------------

    Any idea what I am doing wrong? After 10 years of Ninja 7 still learning about Ninja 8 so most likely a rookie error by me.


    Screen shot from the editor.
    Click image for larger version  Name:	image.png Views:	0 Size:	151.0 KB ID:	1233099


    Last edited by ct; 01-29-2023, 08:28 AM.

    #2
    Hello ct,

    Move your property declaration inside of your indicator class. (Between the curly braces for the class)

    See the NinjaScript Editor 401 training video if you are not familiar with scope.

    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.Download NOW at http://ninjatrader.com/GetStarted fo...
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chesea

      That did the trick. I get to wear the dunce cap now for a while. Double rookie error. I thought I tried that but i didn't. You are an absolute star.

      Many thanks.

      Cheers from the far side of the planet.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      160 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      9 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X