The following reference sample will provide you with guidance to accomplish what you are looking to do.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Better Volume Indicator HELP
Collapse
X
-
No, the data you need does not sit in a local variable called bc. 'bc' is merely an index value that references one of the 6 plots in the indicator. You can use a number in its place. The number 5 corresponds to LowChurnBar. That is, BetterVolume(5,false,true).Values[5][0] should contain the current value of LowChurnBar.Originally posted by suburban View PostBen
I know the data I need sits in a local variable called bc. How can I make that variable global or create a global variable which would have the information contained in local variable bc. This new global variable would have to be accessable by another indicator.
Try removing the 'if' statement and testing it by printing out the results:
Print(CurrentBar.ToString()+" "+BetterVolume(5,false,true).Values[5][0]);
or
Print(CurrentBar.ToString()+" "+BetterVolume(5,false,true).LowChurnBar[0]);
That would verify whether the results are being returned properly. If they are, then the bit you call 'CODE' is probably the problem.
-Alex
Comment
-
Mission Accomplished
It works now. What I did was create a dataseries call Btype which was global in the BetterVolumeIndicator. Then I have my customer indicator calling Btype and it is getting the proper response.
BetterVolume(5,false,true).Btype[0]==5
within the BetterVolume Indicator I amended the if statements to include my new btype dataseries which is then set by each condition.
vxr.Set(v * range);
vdr.Set((range != 0.0) ? v / range : 0.0);
if (v == MIN(Volume, lookback)[0]) {bc = 1;btype.Set(1);} //LowBar;
if (vxr[0] == MAX(vxr, lookback)[0]) { bc = 2; ++cc;btype.Set(2);} //ClimaxBar
if (vdr[0] == MAX(vdr, lookback)[0]) { bc = 3; ++cc;btype.Set(3);} //ChurnBar
if (cc == 2) {bc = 4;btype.Set(4);} //ClimaxChurnBar;
if (vdr[0] == MIN(vdr, lookback)[0]) {bc = 5;btype.Set(5);} //LowChurnBar
Thank you all for your help. It is greatly appreciated.
Comment
-
You could have made 'bc' a series too.
Either way, I'm not sure why that's necessary, but at least it's working for you.
-Alex
Comment
-
??
...would this version allow to reference one of the 6 plots in market analyzer? for instance, lowchurnbar would return "5"....Originally posted by anachronist View PostNo, the data you need does not sit in a local variable called bc. 'bc' is merely an index value that references one of the 6 plots in the indicator. You can use a number in its place. The number 5 corresponds to LowChurnBar. That is, BetterVolume(5,false,true).Values[5][0] should contain the current value of LowChurnBar.
Try removing the 'if' statement and testing it by printing out the results:
Print(CurrentBar.ToString()+" "+BetterVolume(5,false,true).Values[5][0]);
or
Print(CurrentBar.ToString()+" "+BetterVolume(5,false,true).LowChurnBar[0]);
That would verify whether the results are being returned properly. If they are, then the bit you call 'CODE' is probably the problem.
-Alex
Comment
-
I don't know, I don't use Market Analyzer. In any case, the indicator being discussed in this thread is out of date. The author of BetterVolume updated his algorithm, and some time ago I ported it to NinjaTrader. It may be in the NT7 file area.
(Note, I don't use this indicator myself, so I have no recommendation about its suitability for anything).
-Alex
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment