PDA

View Full Version : recursive parameter error


junkone
11-20-2008, 03:34 AM
http://content.screencast.com/users/junkone/folders/Jing/media/054bf5f6-03de-4d33-bbf1-1d87ad9723e3/2008-11-20_0532.pngi


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

mrlogik
11-20-2008, 05:22 AM
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.


[Description("")]
[Category("Parameters")]
public double stopPrice
{
get { return stopPrice; }
set { stopPrice = Math.Max(1, value); }
}

NinjaTrader_Ray
11-20-2008, 07:08 AM
For further clarification, your property should read:

StopPrice instead of stopPrice (not the capitalization)