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

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?
    Paul H.NinjaTrader Customer Service

    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)).

        Paul H.NinjaTrader Customer Service

        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().

            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cre8able, 02-11-2023, 05:43 PM
            3 responses
            234 views
            0 likes
            Last Post rhubear
            by rhubear
             
            Started by frslvr, 04-11-2024, 07:26 AM
            8 responses
            111 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            44 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by traderqz, Today, 09:44 AM
            2 responses
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X