In other words, I'm looking for the last trade price while in the OnBarUpdate() method.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Last trade on OnBarUpdate()
Collapse
X
-
Last trade on OnBarUpdate()
What is the equivalent of OnMarketData()'s MarketDataType.Price (of MarketDataType.Last data type) in the OnBarUpdate()? Is it Close[0] with CalculateOnBarClose = false?
In other words, I'm looking for the last trade price while in the OnBarUpdate() method.Tags: None
-
Yesterday, NinjaTrader_RyanM said:
You can work with CurrentBar in relation to Count to identify the last bar on the chart.
When CalculateOnBarClose = true:
if (Count - 2 == CurrentBar)
When CalculateOnbarClose = false:
if (Count - 1 == CurrentBar)
--EV
-
Correct, you would work with Close[0] and COBC = false, giving you the last tick value (since NT is multithreaded you can run into race conditions comparing it to OnMarketData's Last value though).Originally posted by emini.ninja View PostWhat is the equivalent of OnMarketData()'s MarketDataType.Price (of MarketDataType.Last data type) in the OnBarUpdate()? Is it Close[0] with CalculateOnBarClose = false?
In other words, I'm looking for the last trade price while in the OnBarUpdate() method.
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
559 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment