Quickie: How to access multi-plot indicator's values SEPARATELY?? - futures io
futures io futures trading



Quickie: How to access multi-plot indicator's values SEPARATELY??


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one chrisflow with 5 posts (1 thanks)
    2. looks_two zeller4 with 2 posts (0 thanks)
    3. looks_3 max-td with 1 posts (2 thanks)
    4. looks_4 eDanny with 1 posts (3 thanks)
      Best Posters
    1. looks_one eDanny with 3 thanks per post
    2. looks_two max-td with 2 thanks per post
    3. looks_3 gregid with 1 thanks per post
    4. looks_4 chrisflow with 0.2 thanks per post
    1. trending_up 6,441 views
    2. thumb_up 7 thanks given
    3. group 4 followers
    1. forum 10 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
 

Quickie: How to access multi-plot indicator's values SEPARATELY??

(login for full post details)
  #1 (permalink)
New Orleans, LA
 
Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Trading: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 5 received

This is simple but I can't find the answer anywhere:

I'm programming my own indicator and I want to access another indicator that plots two values (ie MACD Bollinger Bands, or the QQE].

For example how would I access the value of the upper bollinger band independently of the lower one?

For example, the QQE indicator, if you look at the code, uses two public variables, Value0 and Value1 for the two plots it produces. When I access the QQE externally this code only returns one of the plots:

works, but accesses only one of the QQE's two plots:
double tempVariable = QQE(14, 10)[0] // returns only one of the plots data points

I want to access it like this (but all of these tries have returned compiling error):
fails:
double tempVariable = QQE.Value[0](14,10)[0]; // to access Plot 0 data
double tempVariable = QQE.Value[1](14,10)[0]; // to access Plot 1 data

fails:
double tempVariable = Value0.QQE(14,10)[0];
double tempVariable = Value1.QQE(14,10)[0];

fails:
double tempVariable = QQE.(14,10)[0].Value0
double tempVariable = QQE.(14,10)[0].Value1

Aaaargh....



Here is partial code from the QQE in reference to Value0 and Value1:
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Value1
{
get { return Values[0]; }
}

[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Value2
{
get { return Values[1]; }
}

.... [more]

Started this thread Reply With Quote

 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
111 thanks
Selling Options on Futures?
109 thanks
Rank your Futures vs Stocks trading priority
37 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Bitcoin storage wallet recommendations
18 thanks
 
(login for full post details)
  #3 (permalink)
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 320 given, 620 received


Try these:

double tempVariable = QQE(14,10).Value1[0]
double tempVariable = QQE(14,10).Value2[0]

Reply With Quote
The following user says Thank You to gregid for this post:
 
(login for full post details)
  #4 (permalink)
New Orleans, LA
 
Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Trading: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 5 received

Thanks for the help!

I found this to work. Hopefully it doesn't use more resources than necessary but this got it done:

First of all, the variables I was calling from QQE are *DataSeries* so I must create a DataSeries from the calling indicator in which to put the QQE vars (using a type double was like putting a dozen eggs into a the space of one egg and doesn't work):

First I defined a new DataSeries variable:

 
Code
                            
Initialize() 
{
myDataSeries_QQE_PlotA = new DataSeries(this);   
myDataSeries_QQE_PlotB = new DataSeries(this);
}

Then copy the data from the QQE into my current indicator:

OnBarUpdate()
{
// Pull the first plot data out of the QQE
// Values[0] references the QQE public DataSeries variable Value1 which is returned as Values[0]
// The second [0] tells NT to use the CurrentBar (the newest bar)
myDataSeries_QQE_PlotA.Set(QQE(145).Values[0][0]);   

// Pull the second plot data out of the QQE
// Values[1] references the QQE public DataSeries variable Value2 which is returned as Values[1]
// The second [0] tells NT to use the CurrentBar (the newest bar)
myDataSeries_QQE_PLotB.Set(QQE(145).Values[1][0]);


//To print the QQE's latest values in the output window:
Print("Last PlotA value from QQE: " myDataSeries_E_QQE_Value0[0]);
Print(
"Last PlotB value from QQE: " myDataSeries_E_QQE_Value1[0]);
}

[
end]




QQE code referenced here:
******************************************************
region Properties
        
public DataSeries Value1
        
{
            
get { return Values[0]; }
        }



        public 
DataSeries Value2
        
{
            
get { return Values[1]; }
        }************************************************************ 

Started this thread Reply With Quote
The following user says Thank You to chrisflow for this post:
 
(login for full post details)
  #5 (permalink)
East Rochester, NY
 
Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 329 since Jul 2009
Thanks: 17 given, 423 received

That works fine except you are creating two DataSeries for nothing. You could just call the QQE values as you need them like this:

//To print the QQE's latest values in the output window:
Print("Last PlotA value from QQE: " + myDataSeries_E_QQE_Value0[0]);
Print(
"Last PlotB value from QQE: " myDataSeries_E_QQE_Value1[0]);


or do this in Variables:

private Indicator qqeLines;

in OnBarUpdate():

if(CurrentBar == 0)
qqeLines = QQE(14, 5);

//To print the QQE's latest values in the output window:
Print("Last PlotA value from QQE: " +
qqeLines.Values[0][0]);
Print(
"Last PlotB value from QQE: "
+ qqeLines.Values[1][0]);

// Do other stuff with qqeLines below



Reply With Quote
The following 3 users say Thank You to eDanny for this post:
 
(login for full post details)
  #6 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received


eDanny View Post
That works fine except you are creating two DataSeries for nothing. You could just call the QQE values as you need them like this:

//To print the QQE's latest values in the output window:
Print("Last PlotA value from QQE: " + myDataSeries_E_QQE_Value0[0]);
Print("Last PlotB value from QQE: " myDataSeries_E_QQE_Value1[0]);


or do this in Variables:

private Indicator qqeLines;

in OnBarUpdate():

if(CurrentBar == 0)
qqeLines = QQE(14, 5);

//To print the QQE's latest values in the output window:
Print("Last PlotA value from QQE: " +
qqeLines.Values[0][0]);
Print("Last PlotB value from QQE: "
+ qqeLines.Values[1][0]);

// Do other stuff with qqeLines below



Thanks eDanny!

I'm using this and sometimes getting plotvalues in the output and sometimes it's plotting zero...

https://screencast.com/t/MGUyMWY0Z


Not sure what else to change for that. I have the COBC=false...
Thanks for your help.
Kirk

Attached Files
Register to download File Type: cs Other_Indicator_Called.cs (5.2 KB, 22 views)
Reply With Quote
 
(login for full post details)
  #7 (permalink)
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

hey chrisflow,

have you ever tried it with the Ninja-Startegy-wizard, to find out the exact code of the plot you like to grab when using indicators with multiple plots / values like Macd, Boll-bands, QQe etc ?

thats a fast + easy help in my eyes !

max-td
Reply With Quote
The following 2 users say Thank You to max-td for this post:
 
(login for full post details)
  #8 (permalink)
New Orleans, LA
 
Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Trading: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 5 received

That's neat. Now can this type "Indicator" be declared using the "(this): in order to sync with historical data and so that it updates with each tick?

Started this thread Reply With Quote
 
(login for full post details)
  #9 (permalink)
New Orleans, LA
 
Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Trading: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 5 received

Yeah but that would be too easy! Good thinkin'!

Started this thread Reply With Quote
 
(login for full post details)
  #10 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received



chrisflow View Post
That's neat. Now can this type "Indicator" be declared using the "(this): in order to sync with historical data and so that it updates with each tick?

Hey Chrisflow,

You got an example for this?

kz

Reply With Quote
 
(login for full post details)
  #11 (permalink)
New Orleans, LA
 
Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Trading: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 5 received

I am curious if declaring a type "Indicator" with "(this)" as I do in the following code for DataSeries works the same:

Initialize()
{
myDataSeries_QQE_PlotA = new DataSeries(this);
myDataSeries_QQE_PlotB = new DataSeries(this);
}


Does anyone know of official documentation for type "Indicator" declared as public or private can be found?

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Quickie: How to access multi-plot indicator's values SEPARATELY??


Last Updated on June 2, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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