NexusFi: Find Your Edge


Home Menu

 





Indicator: How to plot in two different panels with one indicator?


Discussion in NinjaTrader

Updated
    1. trending_up 2,309 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Indicator: How to plot in two different panels with one indicator?

  #1 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
  #3 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


is for NT version 7

Started this thread Reply With Quote
  #4 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426


vantojo View Post
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

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.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


ratfink View Post
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.

Cheers

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.

Thanks

Started this thread Reply With Quote




Last Updated on September 25, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts