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



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


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

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

(login for full post details)
  #1 (permalink)
 aligator 
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,057 given, 5,842 received

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 futures io Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
For the experts of Metastock
Platforms and Indicators
TradingView help in improving Anchored Vwap
Platforms and Indicators
Is there inherently more opportunity in smaller markets?
Traders Hideout
TD Sequential for NT or MW?
Platforms and Indicators
Experience with AGN (Introducing Broker)
Brokers
 
 
(login for full post details)
  #2 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,129 since Jun 2009
Thanks: 32,601 given, 98,784 received


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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #3 (permalink)
 aligator 
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,057 given, 5,842 received



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 futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 Fat Tails 
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,858 since Mar 2010
Thanks: 4,238 given, 26,770 received


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
 
(login for full post details)
  #5 (permalink)
 aligator 
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,057 given, 5,842 received

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

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
 aligator 
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,057 given, 5,842 received


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
Register to download File Type: cs DoubleFisherTransform.cs (8.2 KB, 16 views)
Visit my futures io Trade Journal Started this thread Reply With Quote
The following user says Thank You to aligator for this post:
 
(login for full post details)
  #7 (permalink)
 Fat Tails 
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,858 since Mar 2010
Thanks: 4,238 given, 26,770 received


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
The following 2 users say Thank You to Fat Tails for this post:
 
(login for full post details)
  #8 (permalink)
 aligator 
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,057 given, 5,842 received


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 futures io Trade Journal Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Multi-plots of the same oscillator in one panel, how?


Last Updated on October 30, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts