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 03-09-2011, 01:37 PM   #1
dkrumholz
Member
 
Join Date: Aug 2009
Location: Princeton NJ
Posts: 83
Thanks: 10
Thanked 0 times in 0 posts
Default Current Price Not Equal to Close[0]

I have an indicator that runs on each tick (on bar close = false) that does several calculations based on the current price which I have coded as Close[0]. If I run the indicator I get a set of values based on Close[0] (the current price) but if I remove the indicator from the chart and re-add it, the calculations are now different because presumably Close[0] is the single closing price for the bar, not the current price at each tick. Is that true and is there a way around that?
dkrumholz is offline  
Reply With Quote
Old 03-09-2011, 01:53 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi dkrumholz,

Yes, Close[0] represents only the last tick of a bar. It sounds like you designed your indicator to work on the change in close values within a bar that is currently forming. If this is the case, it's not really applicable to historical data. You'll only have the four data points of the bar, and not any of the price changes that were made to create the bar. To look within the bar in an historical sense would require a secondary series smaller that your primary.

This style of indicator may work best working in real time only, and using OnMarketData(). to drive it. You then can access the stream of last traded prices directly.

Please let me know if I've misunderstood your request.
Last edited by NinjaTrader_RyanM; 03-09-2011 at 02:11 PM.
NinjaTrader_RyanM 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can strategy enter/exit at current day's close price rnhoo ATM Strategies (Discretionary Trading) 13 02-11-2011 03:41 AM
Making Close[0] == current price dsraider Strategy Development 9 06-19-2010 07:08 AM
Possible Bug - trace execution price does not equal trade log price? Bluepoint Strategy Analyzer 3 02-13-2010 10:37 AM
Startegy involving previous day close price and current open price kirankksimon General Programming 3 03-11-2009 08:59 AM
how to sendmail() with current symbol and close price tbtrades Miscellaneous Support 3 10-17-2008 12:28 PM


All times are GMT -6. The time now is 10:20 AM.