NexusFi: Find Your Edge


Home Menu

 





Multi-plots of the same oscillator in one panel, how?


Discussion in NinjaTrader

Updated
    1. trending_up 3,811 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,183

How do you get (or edit) an oscillator (i.e, CCI, etc.) to plot itself twice in the same panel, let's say once as a line and anther time as a histogram without applying the indicator twice? All other setting are the same. The idea is to add a boundary to the histogram.

Thanks a bunch!


Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


aligator View Post
How do you get (or edit) an oscillator (i.e, CCI, etc.) to plot itself twice in the same panel, let's say once as a line and anther time as a histogram without applying the indicator twice? All other setting are the same. The idea is to add a boundary to the histogram.

Thanks a bunch!

If you don't want to simply add the indicator twice, and delete the duplicate plots (make them transparent), while leaving the useful plot and setting it how you want (histogram) --- then the only other option is to make a new indicator and add the Plots to the code.

You can find a webinar that covers it:

Webinar: C# and NinjaScript Overview

and

Webinar: Basic NinjaTrader Programming

and

Webinar: NinjaTrader Advanced Strategies and Programming

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,183



Big Mike View Post
the only other option is to make a new indicator and add the Plots to the code.


Mike

Thanks Mike. I actually did try to modify, as an example, the default fisher transform indi by adding an extra add new plot statement for a second plot of the indicator, however, it plotted the end "Value" only once. Also, tried to use the Value.Set() twice and did not worked either.

Do I need to add a new data series also for the second plot?

Thanks.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


aligator View Post
Thanks Mike. I actually did try to modify, as an example, the default fisher transform indi by adding an extra add new plot statement for a second plot of the indicator, however, it plotted the end "Value" only once. Also, tried to use the Value.Set() twice and did not worked either.

Do I need to add a new data series also for the second plot?

Thanks.

Just add a second plot in Initialize() and add a property for the that plot in the Properties section. When you add a plot, the plot series is added automatically, you do not need to define a separate variable for the data series.

Set the values for the second plot in OnBarUpdate() exactly as you have set them for the first plot and the plot should display correctly.


Reply With Quote
  #5 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,183

Thanks Fat Tails. I will try that today after the Gators have whooped the Dogs, starting in few minutes


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,183


Fat Tails View Post
Just add a second plot in Initialize() and add a property for the that plot in the Properties section. When you add a plot, the plot series is added automatically, you do not need to define a separate variable for the data series.

Set the values for the second plot in OnBarUpdate() exactly as you have set them for the first plot and the plot should display correctly.

Thanks again Fat Tails. I tried your suggestion as an example for FT. It compiles fine but I can't get it to plot twice. Attached is what I have done.


Attached Files
Elite Membership required to download: DoubleFisherTransform.cs
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


aligator View Post
Thanks again Fat Tails. I tried your suggestion as an example for FT. It compiles fine but I can't get it to plot twice. Attached is what I have done.

(1) You have called your two plots the same name. If you have two children, would you give them the same name?

-> Give your two plots different names, for example "PlotLine" and "Histogram"
 
Code
            Add(new Plot(new Pen(Color.DodgerBlue, 6), PlotStyle.Bar, "PlotLine"));
            Add(new Plot(new Pen(Color.White, 2), PlotStyle.Line, "Histogram"));
(2) You have neither defined a property for the first nor for the second plot.

-> Define properties for both plots in the Properties section - I have told you so in my last post.


 
Code
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries PlotLine
        {
            get { return Values[0]; }
        }

        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Histogram
        {
            get { return Values[1]; }
        }
(3) You have not set any value to the second PlotSeries, but have set a value to the first PlotSeries twice.

-> Once you have defined properties you can use them for setting values.

 
Code
PlotLine.Set(fishValue);
Histogram.Set(fishValue);
Not tested.


Reply With Quote
Thanked by:
  #8 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,183


Fat Tails View Post
(1) If you have two children, would you give them the same name? I have told you so in my last post.
.

Thanks a bunch Fat Tails. It worked fine.

Yes, you told me so, but I thought the properties were already defined under the add plot statement, as in the default version.

By the way, I was told Germans can't be funny, but that is no longer true.

And no, I usually call my babies "Come", and usually one of them will show up for a treat


Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on October 30, 2011


© 2026 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 - Downloads - Top
no new posts