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

Indicator help

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

    Indicator help

    Hello I would like to use an indicator that looks like the bottom of the attached screenshot. I would like to plot an instrument to be traded in the main pane. And then in lower planes, I would like to plot additional instruments and apply an indicator to each instrument that would apply a colored square if the instrument is above or below a certain threshold. I don’t actually want to plot the instrument, but just the indicator. The goal is to have multiple narrow panes at the bottom of the chart that together act as a traffic light type indicator. A constellation of red and green lights. The indicator would ideally have the ability to toggle > < and threshold value so it could be used for any instrument.

    how would I go about this? Much thanks.

    tom

    #2
    Hello tffmd123,

    Thank you for your inquiry.

    There's several different ways you could achieve this, you could certainly custom render the squares, but the simplest way would be to use a block style plot, one for each color per instrument, and assign values to the different plots at the same price level depending on if your conditions have determined if the plot for that instrument on that bar should be red/green. I've created a relatively bare bones indicator that does this - it will plot green if the current price of the instrument assigned to that price level (based on the BarsInProgress index of the instrument) is within the high and low threshholds that are offset from the current day open for the instrument and red if the current price is outside of that. If you scroll into the future a few bars you'll see labels for each row of squares with the name of the instrument used for that row. This is just a bit of a bare bones example, you could certainly add code to automatically adjust the scaling, but I found just adjusting the y-axis a bit makes it look much like your example.

    I've added some prints so you can see what's getting assigned on each bar for each instrument as well.

    A note that this should only be used on time based bars, as tick based bars will not match up between separate instruments and you'd get your boxes all over the place.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Wow! Thanks. I imported and noticed that the parameters for high and low are listed in ticks. The instruments that I want to use as the input series are iqfeed breadth indices such as:
      VI5.Z, JT5T.Z, RI5T.Z, M205B.Z, M505B.Z, IR5T.Z, JT5T.Z, JV5T.X, TCQET.Z, TCQED.Z, IPQEA.Z, IPQED.Z, IPQED.Z, VPQEA.Z, VPQED.Z, VPQET.Z, SPQET.Z, DIVA.Z, II5A.Z, II5D.Z, PRNQ.Z

      If these instruments plot an extreme value, i'd like to show that as a green or red light. But is ticks the appropriate measurement?

      Thanks again.,

      Comment


        #4
        Hello tffmd123,

        Thank you for your reply.

        I'm not able to pull up any of these using our test IqFeed connection, and one of my colleagues said he wasn't able to do so either. I'm unsure if this is simply an issue with these not being enabled on our test connection or not. Are you able to pull these symbols up within NinjaTrader? If so, could you provide a screenshot of the symbol mapping you have set up for one of these from the Tools > Instruments > find instrument in the list and double click to open the instrument settings > scroll down to symbol mapping section?

        Also, if you are able to pull them up in NinjaTrader can you export some data of that symbol (just a day or two of data would be fine) and provide that here so we can assess it?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hi Kate

          Firstly, the symbols map in NT8 as, for example VI5T_Z. The iqfeed symbol is with . not _.

          Are you able to view the symbols as such? Please let me know. If not, I'll export and send data.

          Much thanks again.

          Tom

          Comment


            #6
            Hello tffmd123,

            Thank you for your reply.

            Looks like it's an enablement issue on our end most likely as I still cannot pull up data for any of these. Would you be able to provide some exported data for us to analyze?

            Thanks in advance; I look forward to assisting you further.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Hi Please see attached.
              Attached Files

              Comment


                #8
                Hello tffmd123,

                Thank you for your reply.

                Looks like at least for this instrument, the smallest unit of movement is 1, so as long as the Tick Size in the Instrument properties is set to 1, you should be fine to use ticks:



                Please let us know if we may be of further assistance to you.

                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  Please forgive my ignorance. Because I have trouble reading the code that was written, I am unsure that I understand what is represented by the colored squares coded in the sample indicator. You have plotted three lines. My hope was to plot extreme values of the input series on the NQ chart. This would only require 1 line of square per input series. none of the line appear to plot the threshold values that input. Can you kindly clarify? Much thanks.

                  Comment


                    #10
                    Hello tffmd123,

                    Thank you for your reply.

                    The example plots a green square if the current price of the instrument associated with that line is between the high and low threshold, and red if the current price is outside of those boundaries. The high and low thresholds are the number of ticks input for those away from the current day's open price determined from the Current Day OHL indicator.

                    This is simply an example of how you could make plots in this way, you could modify this to plot a different color when it's below the high threshhold than below the low threshhold, you could change the point it uses as the central point, there's a lot of ways you could modify this.

                    There is one square per bar per instrument in a horizontal line.

                    Please let us know if we may be of further assistance to you.
                    Kate W.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by MacDad, 02-25-2024, 11:48 PM
                    7 responses
                    157 views
                    0 likes
                    Last Post loganjarosz123  
                    Started by Belfortbucks, Today, 09:29 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post Belfortbucks  
                    Started by zstheorist, Today, 07:52 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post zstheorist  
                    Started by pmachiraju, 11-01-2023, 04:46 AM
                    8 responses
                    151 views
                    0 likes
                    Last Post rehmans
                    by rehmans
                     
                    Started by mattbsea, Today, 05:44 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post mattbsea  
                    Working...
                    X