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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment