Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

region variables/properties not recognized

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

    region variables/properties not recognized

    Watching the NT strategy video we are asked to create 'User Defined Inputs' something like this:
    private int rSIPeriod = 7; // Default setting for RSIPeriod
    private int stochDPeriod = 14; // Default setting for StochDPeriod
    private int mACDPeriod = 12; // Default setting for MACDPeriod
    private int aTMPeriod = 1; // Default setting for ATMPeriod
    private int smooth = 3; // Default setting for Smooth

    Yet when I go to compile it says these are not recognized (RSIPeriod, StochDPeriod, etc.) Is upper/lower case the cause or something else?

    #region Variables
    // Wizard generated variables
    private int rSIPeriod = 7; // Default setting for RSIPeriod
    private int stochDPeriod = 14; // Default setting for StochDPeriod
    private int mACDPeriod = 12; // Default setting for MACDPeriod
    private int aTMPeriod = 1; // Default setting for ATMPeriod
    private int smooth = 3; // Default setting for Smooth
    // User defined variables (add any user defined variables below)
    #endregion

    or

    #region Properties
    [Description("RSI period")]
    [GridCategory("Parameters")]
    public int RSIPeriod
    {
    get { return rSIPeriod; }
    set { rSIPeriod = Math.Max(1, value); }

    #2
    cowboy, with both parts in, it should compile fine. You would need to have both the variable declaration and public property, in your posted code you want to take extra care to ensure the closing bracket is added for your property i.e.

    [Description("RSI period")]
    [GridCategory("Parameters")]
    public int RSIPeriod
    {
    get { return rSIPeriod; }
    set { rSIPeriod = Math.Max(1, value); }
    }

    Probably just an issue as you copied it out of the region....

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X