Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Beginner Question

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

    Beginner Question

    Good afternoon.. I am a beginning with NJ and i have a dumb question on creating custom indicator

    i want to learn how to setup custom indicator
    the manual said that i can refer to the value of the previous bars by using codes like Close[1] Close[2] Close[3] etc...

    I am trying to calculate a simple 14Day SMA with the following code...


    double temp = 0;
    for (int barsAgo = 0; barsAgo < 14; barsAgo++)
    {
    temp = temp + Input[barsAgo];
    }
    Plot0.Set(temp/14);



    I don't know why there is nothing on my plot after i use this complied indicator?
    but when I change Input[barsAgo] to Input[0], I do have a value of today times 14 (because i loop 14 times)

    can anyone advise? Thank you so much!

    Hiromichi

    #2
    Hiromichi,

    Welcome to NinjaTrader. You likely ran into issues discussed here: http://www.ninjatrader-support2.com/...ead.php?t=3170
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      thank you for your prompt reply.

      thank you so much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      585 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      340 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X