Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem creating indicator

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

    Problem creating indicator

    I'm trying to create a Momentum dots indicator but have never done this before. Would appreciate if someone could take a look and see where I went wrong.

    The formula is ((High[2]+Low[2]+Close[2])/3 + (High[4]+Low[4]+Close[4])/3 + (High[3]+Low[3]+Close[3])/3)/3;

    Thanks,

    Mpe
    Attached Files

    #2
    How about:

    Mom.Set(((High[2]+Low[2]+Close[2])/3 + (High[4]+Low[4]+Close[4])/3 + (High[3]+Low[3]+Close[3])/3)/3);
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Originally posted by eDanny View Post
      How about:

      Mom.Set(((High[2]+Low[2]+Close[2])/3 + (High[4]+Low[4]+Close[4])/3 + (High[3]+Low[3]+Close[3])/3)/3);
      Thanks for the reply. Now it compiles without errors but it doesn't plot on my charts. I guess there's still something wrong.

      Mpe

      Comment


        #4
        Check your Log tab on your Control Center for some yellow highlighted error.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          mpe66,

          add the CurrentBar line where shown.


          protected override void OnBarUpdate()

          {

          if (CurrentBar < 5) return;



          RJay
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            That would be it RJay, I can see in the picture it needs that. Dan
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              Originally posted by mpe66 View Post
              Thanks for the reply. Now it compiles without errors but it doesn't plot on my charts. I guess there's still something wrong.

              Mpe
              eDanny and RJay have the right answer for you mpe66. Basically you just need to make sure there are enough bars loaded on your chart before running calculations. On the very first bar of a chart (left-most bar), for example, it wouldn't make sense to access the High of the 3rd bar back because it doesn't exist. Here is a link to a post by Ray that further describes what is happening.
              AustinNinjaTrader Customer Service

              Comment


                #8
                Thanks a lot guys. That solved it.

                Mpe

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                571 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                330 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                548 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                549 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X