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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
265 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
169 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
171 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
259 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
210 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment