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 plotting on price panel and indicator panel

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

    Indicator plotting on price panel and indicator panel

    I'm building an indicator that uses modified code of Bollinger Bands and MACD to make additional calculations.
    I'm trying to have my indicator plot the BB on the price panel as usual and the MACD in the indicator panel. Note that the modified BB plotting code, and modified MACD plotting code are inside my indicator code.
    The plots for the upper/middle/lower band of BB need to be on price, and the MACD need to be on the indicator panel. So, I guess I need the DrawOnPricePanel to work for the BB part of the code only.

    It seems to me that the only way to do that is to use something like DrawDot or DrawLine for the BB values which wouldn't look as nice as a plot. It seems that there is no way for one plot of my indicator to go over the price (BB) and the other not (MACD).

    Any ideas how I can do my indicator to plot on both indicator and price panels? If that is not possible what would be the best workaround? Is it possible to use DrawLine and make it look exactly like the original BB plot?

    I don't want to add a separate BB indicator, because my indicator changes the BB settings depending on certain conditions and that would mean that I would have to go to the BB indicator and change manually (or is there a way to pass that value?)

    #2
    Originally posted by ds1111 View Post
    I don't want to add a separate BB indicator, because my indicator changes the BB settings depending on certain conditions and that would mean that I would have to go to the BB indicator and change manually (or is there a way to pass that value?)
    You can always write another indicator that uses the BB, and you can change the inputs as needed inside the code. You could also, if you prefer, copy the BB code itself into a new indicator and use code to modify that as necessary.

    Comment


      #3
      I still would rather be able to plot at both the indicator and price panel. This is just the beginning of what will be a very complex indy, and having all the parameters inside the same program would definitely help. Unless that is not possible. Let's see what NT support and others can recommend. Hard to believe I'm the first one running into this problem.

      Thanks!

      Comment


        #4
        Hello,

        Currently, you can only plot an instance of a single indicator on one panel.

        You can use Draw methods to draw on a separate panel, however all plots will be displayed in the same panel.

        The only way to accomplish this is to use a second indicator for the plot in the additional panel.
        MatthewNinjaTrader Product Management

        Comment


          #5
          There's a work around

          Well, you can't do it in an indicator but you can do it via a strategy. What you do is to write your indicator and set up your plots. Then you write your strategy and add your indicator via Add(). You also add your other plots this way and this way your first indicator plots in the lower panel and the other plots on top.

          The advantage of doing that is that you can expose the indicator settings in your strategy, thus everything is centrally managed. You then use the strategy's params to initialize your indicator and you're done. The strategy does not have to buy or sell anything, so no worries there, it's just a container that runs your indicator collection.

          I also recall that you can store sets of indicators but then you still need to separately configure them.

          I'm attaching an example screenshot - hope that makes it clear.
          Attached Files
          Last edited by molecool; 10-21-2012, 01:48 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by traderqz, Today, 12:06 AM
          6 responses
          12 views
          0 likes
          Last Post traderqz  
          Started by Skifree, Today, 03:41 AM
          3 responses
          12 views
          0 likes
          Last Post Skifree
          by Skifree
           
          Started by traderqz, Yesterday, 09:06 AM
          5 responses
          33 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by guillembm, Today, 11:25 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by owensd, 04-21-2024, 11:34 PM
          9 responses
          34 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X