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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
152 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
131 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
127 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment