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

recursive parameter error

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

    recursive parameter error

    i


    am not sure why i get a recursive parameter error when i am trying to compile this. appreciate any help


    #region Properties
    [Description("")]
    [Category("Parameters")]
    publicdouble Stop1
    {
    get { return stop1; }
    set { stop1 = Math.Max(1, value); }
    }
    [Description("")]
    [Category("Parameters")]
    publicdouble Stop2
    {
    get { return stop2; }
    set { stop2 = Math.Max(1, value); }
    }
    [Description("")]
    [Category("Parameters")]
    publicdouble stopPrice
    {
    get { return stopPrice; }
    set { stopPrice = Math.Max(1, value); }
    }
    #endregion

    #2
    You are getting this error because your public METHOD is the same as your VARIABLE.

    It looks like you created them correctly except for the last one.

    Code:
    [SIZE=2][FONT=Courier New][Description([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New][Category([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"Parameters"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [COLOR=Red]stopPrice[/COLOR][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [COLOR=Red]stopPrice[/COLOR]; }[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [COLOR=Red]stopPrice [/COLOR]= Math.Max([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], value); }[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      For further clarification, your property should read:

      StopPrice instead of stopPrice (not the capitalization)
      RayNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      41 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      11 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      3 views
      0 likes
      Last Post port119
      by port119
       
      Started by Philippe56140, Today, 02:35 PM
      0 responses
      4 views
      0 likes
      Last Post Philippe56140  
      Started by 00nevest, Today, 02:27 PM
      0 responses
      2 views
      0 likes
      Last Post 00nevest  
      Working...
      X