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 morrnel, 05-12-2024, 06:07 PM
      4 responses
      52 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by xepher101, 05-10-2024, 12:19 PM
      6 responses
      68 views
      0 likes
      Last Post xepher101  
      Started by gbourque, Today, 04:11 PM
      0 responses
      1 view
      0 likes
      Last Post gbourque  
      Started by James650, 05-07-2024, 08:25 AM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by Vitamite, Yesterday, 12:48 PM
      3 responses
      19 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X