NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-12-2006, 06:18 AM   #1
guy
Member
 
Join Date: Dec 2004
Location: , ,
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

On line 65 you have:

double tradeVol = previousVol == 0 ? Volume[0] : Volume[0] - previousVol;

I believe that this line can be simplified to:

double tradeVol = Volume[0] - previousVol;

but I'm guessing that you have a good reason why you've done it the way that you have - (or I've made a mistake and you can't simplify it like that).
guy is offline  
Reply With Quote
Old 04-12-2006, 11:34 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Thanks Guy,

If I am not mistaken, I believe this to initiliaze the value properly in the event that the indicator has not see a volume value before.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-12-2006, 11:44 AM   #3
guy
Member
 
Join Date: Dec 2004
Location: , ,
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

double tradeVol = previousVol == 0 ? Volume[0] : Volume[0] - previousVol;

Expanded out:

Code:
double tradeVol;

if(previousVol == 0) {

 tradeVol = Volume[0];

} else {

 tradeVol = Volume[0] - previousVol;

}


which implies that if previousVol was 0 then the tradeVol = Volume[0] - previousVol statement would result in the first assignment anyway.
guy is offline  
Reply With Quote
Old 04-19-2006, 02:15 AM   #4
Antraman
Senior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

The Split Vol indicator is a nice little tool. However, I notice that after opening the Indicator dialog window and pressing either OK or APPLY and when the chart screen resets, all the other price bars and indicators will flash back on as before, but all the volume bars have disappeared, and they begin to appear only from the time after pressing these buttons.

This means that hours of generated volume bar data is lost any time you wish to add or change any of the indicators on your chart window. Bummer...:X

Antraman



8-0
Antraman is offline  
Reply With Quote
Old 04-19-2006, 02:31 AM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Correct, the indicator is designed to work with real-time data only not historical.
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-20-2006, 01:44 AM   #6
Antraman
Senior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Understood, but even in real time charting, is it supposed to blank out all the bars in the middle of a session if you simply open the indicator dialogue and press OK or APPLY?

It seems to me the chart refreshes and everything else stays but the vol bars start over anew...if thats the way it is supposed to be, so be it. I just thought it may have been an glitch.

cheers,



0
Antraman is offline  
Reply With Quote
Old 04-20-2006, 01:55 AM   #7
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

That is the way it suppose to be. When you hit apply you are resetting all indicators. There is no way to get the data required historically to build this indicator.
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-20-2006, 03:31 AM   #8
Alfred
Senior Member
 
Join Date: Nov 2004
Location: Northern California
Posts: 981
Thanks: 14
Thanked 36 times in 30 posts
Post imported post

How do you access this indicator ? Is it in the idicator list ?

Thanks....
Alfred is offline  
Reply With Quote
Old 04-20-2006, 05:20 AM   #9
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

http://ninjatrader.mywowbb.com/forum14/873.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-23-2006, 05:32 PM   #10
Antraman
Senior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Not meaning to sound like a pain, but the VOL and VOLColored indicator bars both remain showing after applying any changes within the Indicator Properties dialog...I don't understand why the Split Volume bars have to disappear...

cheers,

Antraman


0
Antraman is offline  
Reply With Quote
Old 04-24-2006, 12:13 AM   #11
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Split volume is calculated in realtime since it requires the current bid/ask price as part of its calculations. Current bid/ask price is not available as historical data from any data provider I know of therefore historical bars can't be calculated.
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-24-2006, 01:17 AM   #12
guy
Member
 
Join Date: Dec 2004
Location: , ,
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

This could be partially resolved by writing this information to disk (I believe). Problem is that if you switch to a new instrument then there'd be no historic info.
guy is offline  
Reply With Quote
Old 04-24-2006, 01:28 AM   #13
Antraman
Senior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

But how come VOL and VolColoured are visible as historical data?



0
Antraman is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:34 AM.