Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Indicator: How to plot in two different panels with one indicator?
I have an indicator that will be calculating/generating values on the price panel, it is also drawing there. However, I want to use some of the calculated values to be plotted in a separate panel on the same chart.
(Don't really like the idea of flipping variables that belong in Initialize.)
Is there a way to do this?
Another option would be to expose these values from indicator 1 (primary) and have a secondary indicator pick those values up and plot them in the second panel...not sure how to do this...I don't think instantiating the indicators inside each other will accomplish this?
Ideas?
I have global variables being set, but these are globals for all chart and strategy scripts. I want to share this data only between indicators on the same chart, but different panels.
Always good to see existing code, if there is any....
Thanks
Can you help answer these questions from other members on NexusFi?
You can do it several ways with shared variables, but to be honest the easiest way is just to run two copies of the same indicator, and switch a parameter dialog option on/off between them to enable/disable what gets drawn. Rarely do you see much cpu impact, unless it's poor code or a beast.
NT7 certainly does not work well switching drawing between two panels using the DrawOnPricePanel variable, so don't waste any time on that route.
That was my first thought, to have two indicators draw on different panels and duplicate the calculations in the second one instead of trying shared variables to pass data.
this way I could also run the indicator stand alone in Market Analyzer without any chart plots, against more than one instrument, if I wanted alerts, etc.
Unless I hear of a better solution I'll go that direction.