Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Current Price Not Equal to Close[0]
Collapse
X
-
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?Tags: None
-
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_RyanM1; 03-09-2011, 03:11 PM.Ryan M.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment