Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Last trade print
Collapse
X
-
Tags: None
-
Hello texasnomad,
Thanks for writing in and I am happy to assist you.
If CalculateOnBarClose is set to false then Close[0] will return you the last traded price which you can call from the OnBarUpdate event.
If CalculateOnBarClose is set to true, then you can get the last traded price from the OnMarketData event.
Code:protected override void OnMarketData(MarketDataEventArgs e) { if (e.MarketDataType == MarketDataType.Last) { double lastPrice = e.Price; } }
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
-
Hi Joydeep,
Thank you for the quick reply. I'll give this a shot.
Are there any brokers where the Last data type is not supported?Last edited by texasnomad; 03-01-2012, 03:09 PM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
169 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
324 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
250 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
353 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
180 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment