Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

N Bars Up/Down Input Series

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

    N Bars Up/Down Input Series

    Hello staff,

    The N Bars Up/Down will use the input series of the data series even if I have selected for the indicator to use a secondary indicator as its input series.
    Is there something I can do to make it use my indicator as input series instead of the data series?

    Thank you in advance for your time and help,

    Goldfox

    #2
    Hello GLFX005,

    Thanks for your post.

    The N Bars Up/down indicators are written to use the price types of Close, Open, High, Low. You would need to change those in the Ninjascript code to accommodate your indicators input.

    Can you clarify what you are wanting to do overall as perhaps there is an alternative way?

    Comment


      #3
      Hello Paul,

      Thank you for your reply.

      I am using the True Strength Index (TSI) indicator and I would like to receive a visual confirmation that the TSI has printed, or is printing, 1 or multiple consecutive up values and/or down values. Just as the N Bars Up/Down would measure it for the bar type, I would like to measure it for the TSI indicator.

      Comment


        #4
        Hello GLFX005,

        Thanks for your reply.

        The N Bars indicators can be set for any number of bars in the direction and will provide a signal when that selected number of bars in the direction have occurred. The N Bars indicators use the price types of Close and Open to determine direction of the bars and a for loop to look back at x number of bars to see if the N bars condition has been met.

        You would need to create a custom indicator to meet your goal. If you would like to create this yourself, we can provide you with some reference materials to help get you started.

        Alternative 1, if you would like it created for you, we can provide a link to 3rd party developers that would be able to provide that service.

        Alternative 2, you could accomplish this in the Strategy Builder which would allow you to create the conditions and draw on the chart when the conditions are true. (A strategy does not have to place trades).

        Alternative 3, you could also create a "Chart Alert" for this which like the strategy builder would allow you to configure the alert however if does not provide an on chart indication (you could play a sound, see the alert message, have a pop-up message or send an e-mail (or even place a trade)).

        Comment


          #5
          Hello Paul,

          I tried to create my own code in an indicator but it doesn't show any results even though it does compile. I've compared it to other indicators and copied their structure, for them it works but not for mine. What could be wrong?

          protected override void OnBarUpdate()
          {

          // Something
          double plot;

          if (TSI(20, 20)[0] > TSI(20, 20)[2]
          && TSI(20, 20)[1] > TSI(20, 20)[2])
          {
          plot = 1;
          }

          else

          {
          plot = 0.01;
          }

          Values[0][0] = plot;

          }

          #region Properties

          [Browsable(false)]
          [XmlIgnore]
          public Series<double> TSI5plot
          {
          get { return Values[0]; }
          }
          #endregion

          }


          Thank you in advance for your time, I'm looking forward to your reply.

          LG.

          Comment


            #6
            Hello GLFX005,

            Thanks for your reply.

            Even though it compiled fine, there could be run-time type errors, so checking the "log" tab of the control center should reveal any errors.

            Did you create the indicator using the Ninjascript indicator wizard? If not I recommend that you use that as it will help you create all the support structures needed such as AddPlot().

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            580 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            336 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X