Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
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]
Can you help answer these questions from other members on NexusFi?
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):
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]);
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 ?