Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 mjairg, 07-20-2023, 11:57 PM
|
3 responses
213 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
||
Started by TheWhiteDragon, 01-21-2019, 12:44 PM
|
4 responses
544 views
0 likes
|
Last Post
by PaulMohn
Today, 04:09 AM
|
||
Started by GLFX005, Today, 03:23 AM
|
0 responses
3 views
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
||
Started by XXtrader, Yesterday, 11:30 PM
|
2 responses
12 views
0 likes
|
Last Post
by XXtrader
Today, 03:07 AM
|
||
Started by Waxavi, Today, 02:10 AM
|
0 responses
7 views
0 likes
|
Last Post
by Waxavi
Today, 02:10 AM
|
Comment