![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Aug 2009
Location: Princeton NJ
Posts: 83
Thanks: 10
Thanked 0 times in 0 posts
|
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?
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service
Last edited by NinjaTrader_RyanM; 03-09-2011 at 02:11 PM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |