Quickie: How to access multi-plot indicator's values SEPARATELY?? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Quickie: How to access multi-plot indicator's values SEPARATELY??
Updated: Views / Replies:3,065 / 10
Created: by chrisflow Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 1  
 
Thread Tools Search this Thread
 

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

  #1 (permalink)
Elite Member
New Orleans, LA
 
Futures Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Favorite Futures: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 4 received

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

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]

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 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:
 
  #4 (permalink)
Elite Member
New Orleans, LA
 
Futures Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Favorite Futures: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 4 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]; }
        }************************************************************ 


Last edited by sam028; May 30th, 2010 at 01:06 PM. Reason: add code tag
Reply With Quote
The following user says Thank You to chrisflow for this post:
 
  #5 (permalink)
 Vendor: www.integrity-traders.com 
East Rochester, NY
 
Futures Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 327 since Jul 2009
Thanks: 17 given, 419 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 2 users say Thank You to eDanny for this post:
 
  #6 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 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...

http://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, 20 views)
Reply With Quote
 
  #7 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 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:
 
  #8 (permalink)
Elite Member
New Orleans, LA
 
Futures Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Favorite Futures: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 4 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?

Reply With Quote
 
  #9 (permalink)
Elite Member
New Orleans, LA
 
Futures Experience: Intermediate
Platform: xtrader ADL, NinjaTrader7
Favorite Futures: Guitar and CL
 
chrisflow's Avatar
 
Posts: 15 since Feb 2010
Thanks: 54 given, 4 received

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

Reply With Quote
 
  #10 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 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

Reply



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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Hi/Lo points for indicator values? zacharydw00 NinjaTrader Programming 18 August 20th, 2011 05:36 AM
Printing TradeStation indicator values to file RambleDog EasyLanguage Programming 5 April 11th, 2011 11:28 PM
Printing values from Fractal Indicator eurostoxx NinjaTrader Programming 1 December 14th, 2009 08:22 AM
Referencing values in another indicator or Saroj NinjaTrader Programming 0 September 5th, 2009 12:02 AM
Translating EMA-values to ZN-values or visaversa max-td NinjaTrader Programming 17 June 22nd, 2009 04:42 PM


All times are GMT -4. The time now is 02:33 PM.

Copyright © 2017 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
Page generated 2017-12-16 in 0.14 seconds with 20 queries on phoenix via your IP 54.163.209.109