PDA

View Full Version : Parameters updating problem


cls71
08-27-2008, 02:29 AM
Hello.
I am writting an indicator with a input parameter called "indicatorType" and defined like an Enum:


#region Variables
<...>
private ZeIndicatorType indicatorType = ZeIndicatorType.RSI;

public enum ZeIndicatorType
{
RSI,
RSX,
StochasticD,
StochasticK,
ROC,
Price,
}
<...>
#endregion


I want to use this indicator into strategies however I can't use the Category "Parameters" because its customizable structure ( I donīt want to use public files - userDefinedMethods) . So I create one INT mirror
parameter:

Add this declaration for the mirror variable in Variables region:

#region Variables
<...>
private int intIndicatorType = (int)ZeIndicatorType.RSI;
<...>
#endregion


Add these declarations in Properties region:

#region Properties
<...>
[Description("Tipo de indicador")]
[Category("00. Parameters Plus")]
[Gui.Design.DisplayName("02. IndicatorType")]
public ZeIndicatorType IndicatorType
{
get { return indicatorType; }
set {
indicatorType = value;
intIndicatorType = (int)value;
}
}

[Description(" INT Tipo de indicador")]
[Category("Parameters")]
[Gui.Design.DisplayName("02. IntIndicatorType")]
public int IntIndicatorType
{
get { return intIndicatorType; }
set {
intIndicatorType = value;
indicatorType = (ZeIndicatorType)value;
}
}
<...>
#endregion


When I run the indicator and change the ZeIndicatorType parameter, the INT parameter is updated instantaneously. However if I change the INT parameter, the ZeIndicatorType parameter isn't updated instantaneously.
I don't know why. Could you help me, please ?
Thanks very much.

NinjaTrader_Dierk
08-27-2008, 02:36 AM
Category attribute needs to be "Parameters". Anything else is not supported.