Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Parameters updating problem

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

    Parameters updating problem

    Hello.
    I am writting an indicator with a input parameter called "indicatorType" and defined like an Enum:

    Code:
     
    #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:
    Code:
     
    #region Variables
        <...>
        private int intIndicatorType = (int)ZeIndicatorType.RSI;
        <...>
    #endregion
    Add these declarations in Properties region:
    Code:
     
    #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.

    #2
    Category attribute needs to be "Parameters". Anything else is not supported.
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RookieKiwi, Today, 06:53 PM
    0 responses
    2 views
    0 likes
    Last Post RookieKiwi  
    Started by kazisl, Today, 05:52 PM
    0 responses
    4 views
    0 likes
    Last Post kazisl
    by kazisl
     
    Started by andrewjoseph939, Today, 02:39 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by trader252, Today, 02:09 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by mballagan, Today, 01:19 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X