Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Austiner87, Today, 03:42 PM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by cshox, Today, 11:11 AM
      2 responses
      16 views
      0 likes
      Last Post cshox
      by cshox
       
      Started by algospoke, Today, 06:53 PM
      0 responses
      11 views
      0 likes
      Last Post algospoke  
      Started by mlprice12, 12-21-2021, 04:55 PM
      3 responses
      298 views
      0 likes
      Last Post paypachaysa  
      Started by lorem, 04-25-2024, 09:18 AM
      20 responses
      87 views
      0 likes
      Last Post lorem
      by lorem
       
      Working...
      X