PDA

View Full Version : Strategy Parameters


Json
03-30-2007, 12:55 PM
getting:

The type 'NinjaTrader.Strategy.duhwiz' already contains a definition for 'Tsize'

The type 'NinjaTrader.Strategy.duhwiz' already contains a definition for 'BidAskRatio'

The type 'NinjaTrader.Strategy.duhwiz' already contains a definition for 'STriggerPrice'

Defaults:

#region Variables

private int Tsize = 1;

private double BidAskRatio = 4.0;

private double STriggerPrice = 0.0;

#endregion

User Imputs:

#region Properties

[Description("Qty to be traded")]

[Category("Parameters")]

public int Tsize

{

get { return Tsize; }

set { Tsize = Math.Max(1, value); }

}

[Description("Ratio Threshold")]

[Category("Parameters")]

public int BidAskRatio

{

get { return BidAskRatio; }

set { BidAskRatio = Math.Max(1, value); }

}

[Description("TriggerPrice")]

[Category("Parameters")]

public double STriggerPrice

{

get { return STriggerPrice; }

set { STriggerPrice = Math.Max(1, value); }

}

#endregion



What do I need to change?

NinjaTrader_Dierk
03-30-2007, 04:00 PM
You can't have a private variable and a property with the same name. I suggest you go through the startegy wizard to initialy setup all properties you need on your strategy. The wizard will take care that there are no naming issues.

To fix your particular issue try:
private int tsize = 1;
and
[Description("Qty to be traded")]

[Category("Parameters")]

public int Tsize

{

get { return tsize; }

set { tsize = Math.Max(1, value); }

}

and so forth...

Note, that I changed TSize to tsize.

Json
04-01-2007, 03:38 PM
Thanks,