Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to have an indicator calculate every other bar?

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

    Is it possible to have an indicator calculate every other bar?

    I downloaded a wonderful indicator from the other section of this forum. However, I found that for me... it's best used on a chart that is twice as long as the chart I used for entries (ie... if I was looking at a 1000 tick chart, then the 2000 tick chart readings of the indicator would be the base of my signal).

    normally, i would just put both charts in one window... however, because of the quirk that NT has where it doesn't evenly space bars out... my chart gets bungled in a hurry.

    Is there a way to mod the indicator to calculate every other bar? if so, can you help? thanks

    #2
    Hello SinatraFan,
    You have to modify the indicator and create a multi series indicator to do it.

    Unfortunately we do not do custom NinjaScript coding. To develop your custom indicator/strategies you can contact any of our independent NinjaScript consultants. You can get the list of our NinjaScript consultants from here http://www.ninjatrader.com/partners#...pt-Consultants
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      is there a tutorial or example code for this multi series?

      Comment


        #4
        Hello SinatraFan,
        Yes, you can refer to our help guide to know more about the multi-series codes.



        You can also refer to the NinjaScript codes which comes natively with NinjaTrader.
        • In Control Center menu bar goto Tools>Edit NinjaScript>Strategies
        • In the Strategies dialog please refer to the code SampleMultiTimeFrame/SampleMultiInstrument.


        You can also refer to this sample code
        Note: In NinjaTrader 8 It is no longer needed to use an indicator to sync a secondary series. This can be done directly from the Series<T> (https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?seriest.htm) constructor. This post is left for historical purposes. Series objects are useful for
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I might be misunderstanding what you want to do, but if you just want to have the indicator calculate every other bar, couldn't you just do something like:

          if (CurrentBar % 2 == 0) return;

          Comment


            #6
            while I am no expert on Ninjacode, another possible method is to create code that counts bars.

            divide the count by 2, check remainder - if no remainder (even bars) then you execute the indicator code.

            Inside this loop put the indicator code.

            Comment


              #7
              i think the challenge is... you have to create "virtual bars" because even if you told the code to wait until every other bar... it would still calculate off of EACH close value. this would generate the wrong outcome

              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
              549 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