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 andrewtrades, Today, 04:57 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      6 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      9 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      20 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X