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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      43 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      25 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      157 views
      2 likes
      Last Post CaptainJack  
      Working...
      X