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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      307 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      348 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      178 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X