Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

no user input recognition

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

    no user input recognition

    I have replaced my RSI periods with input variables, to see if i can optimize the periods i chose.
    But now somehow NT does not recognize my input variables for optimization:
    (there is nothing to optimize)


    {
    #region Variables
    // Wizard generated variables
    private int rSI01 = 4; // Default setting for rSI01
    private int rSI02 = 9; // Default setting for rSI02

    // User defined variables (add any user defined variables below)
    #endregion

    /// <summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    /// </summary>
    protected override void Initialize()
    {
    Add(RSI(rSI01, 0));
    Add(RSI(rSI02, 0));

    Add(EMA(21));
    Add(EMA(55));
    Add(EMA(200));
    Add(ATR(14));
    //SetStopLoss("",CalculationMode.Ticks, (ATR(14)[0]) * (250), false);

    CalculateOnBarClose = true;

    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (EMA(21)[0] > EMA(55)[0]
    && EMA(55)[0] > EMA(200)[0]
    && EMA(55)[0] > EMA(55)[1]
    && EMA(200)[0] > EMA(200)[1]
    // CrossBelow(Low, EMA(21), 1))
    && CrossBelow(RSI(rSI01, 0).Avg, 30, 1))
    {
    EnterLong(DefaultQuantity, "");
    }
    SetStopLoss("",CalculationMode.Ticks, (ATR(14)[0]) * (250), false);

    // Condition set 2
    if (CrossAbove(RSI(rSI01, 0).Avg, 75, 1))
    {
    ExitLong("");
    }

    #2
    Hello sosMsos,

    In addition to the private declaration there, you need it declared as public in the properties region. This structure is provided for you automatically when you create inputs through the wizard, but you can also add with code. This post can help with the needed properties structure.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    144 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X