• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

charting custom series/ indicators

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

    charting custom series/ indicators

    Hello. I'm confused around how to add custom series to my chart from my NinjaScript. I was looking at the AddPlot / Values methodology, but wasn't clear to me how I specify which panel the value gets displayed on.

    Specifically, I would like to plot a value on the main panel which is an arithmetic function of the SMA, and another value in a separate panel which is an arithmetic function of the RSI.

    So two questions:
    1) Do i need to set these up as custom indicators/ ISeries, or is it sufficent to just define them using Values[x][y]?
    2) How do i specify where they get plotted? I don't see any parameters in the AddPlot/ Values framework that would enable me to say which panel they show up on.

    Thanks

    #2
    Hello stewarco,

    Thanks for the post.

    An indicator can only plot to one panel with the exception that Drawing Objects. For two separate panels with plots to be used you could use two indicators. You can also use a strategy to host two indicators with separate settings to automate applying them.

    The panel will be controlled by the indicators IsOverlay property, if you set that to false a new panel is generated by default when it is applied. You could create two indicators, one which uses IsOverlay and a second which does not. A strategy can also use AddChartIndicator to automate adding two indicators in its code to be displayed. https://ninjatrader.com/support/help..._a_ninjasc.htm

    If you can use drawing objects for one of the datas you want to display you could use IsOverlay = false and DrawInPricePanel = true to draw the plot in a second panel and the drawing objects in the price panel.

    I look forward to being of further assistance.


    JesseNinjaTrader Customer Service

    Comment


      #3
      thanks these are good ideas

      Comment


        #4
        Hey Jesse. So far I've been able to draw plots on my Price panel, so thanks for that. However, I'm trying to do something else which should be basic, I think, but after reviewing the sample strategy and trying to incorporate the snippets I'm still running into trouble.

        I have two indicator panels showing separate RSIs. All I'm looking to do is draw a horizontal line on the RSI panels, but can't figure out how to do it. Is there a simple command to do this from within NinjaScript?

        Thanks

        Comment


          #5
          Hello stewarco,

          Thanks for the post.

          This would be a situation where you would want to make a custom RSI indicator for that purpose. The strategies drawings are going to be placed in the price panel or panel the strategy resides in. The indicator would need to draw the line for it to show up in that specific indicators panel.

          If your strategy is the reason the line is being triggered and the RSI doesn't contain the logic to make the line you could make an input in a custom RSI to accept some type of input from the strategy to know when to draw the line. It can be as simple as duplicating the RSI and renaming it and adding the line also.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            hey Jessie. I was just about to suggest a similar idea... so if I understand you correctly, the easiest approach would probably be for me to customize the existing RSI indicator, just adding some logic where I pass an additional parameter that's used to calculate my line, and then add an additional Value output corresponding to that line?

            Comment


              #7
              Hello stewarco,

              Right you would just draw the line from the custom RSI. You could pass anything needed in as a parameter like you mentioned and then do the calculation/drawing right from that indicator.

              As long as the custom RSI draws the object it should be able to show up in that panel as long as the custom RSI also has DrawInPricePanel = false.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                thanks. I think I'm converging on what I need. last question:
                My indicator is returning the correct values, and the indicator panel shows that the values I want to display are configured, but the actual panel is empty. what is the actual command I use within the indicator. Draw?

                Comment


                  #9
                  Hello stewarco,

                  Can I clarify, do you mean that you can see the price marker on the right but the Plot is not appearing? Can you provide an image?


                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment


                    #10
                    never mind, everything is working now. thanks!

                    Comment


                      #11
                      hey Jesse. one last (I hope) related question: how do I specify the scale for the indicator y-axis? it appears to be auto-scaling somehow, but I would prefer to have it fixed.
                      thanks

                      Comment


                        #12
                        Hello stewarco,

                        You can adjust the Y scale using the OnCalculateMinMax override:
                        https://ninjatrader.com/support/help...ightsub=minmax

                        If you mean instead to manipulate the charts properties to become fixed that would require other syntax, using the OnCalculateMinMax is generally the suggested route to make a fixed or otherwise different scale from what autoscale provides
                        ​​​​​​​

                        I look forward to being of further assistance.

                        JesseNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by pol133, Today, 02:35 AM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_Marco  
                        Started by JAtrades, Today, 05:20 AM
                        1 response
                        3 views
                        0 likes
                        Last Post JAtrades  
                        Started by timko, Today, 05:12 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post timko
                        by timko
                         
                        Started by collagen, 06-18-2020, 05:55 AM
                        6 responses
                        51 views
                        1 like
                        Last Post timko
                        by timko
                         
                        Started by giulia_brotzu, Yesterday, 10:09 PM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_ChrisSch  
                        Working...
                        X