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
How to get official open and close price?
Collapse
X
-
How to get official open and close price?
I have a session template that shows me an hour before the market open and 30 minutes after the close (e.g. from 8:30am EST to 4:30pm EST). From within code how can I get the official exchange opening price at 9:30am EST and closing price at 4:00pm for stocks?Last edited by overflowing; 07-25-2012, 04:56 PM. -
overflowing, you can work with those OnMarketData event args - http://www.ninjatrader.com/support/h...aeventargs.htm
You would need to store the data needed to variables and access those in your OnBarUpdate() then.BertrandNinjaTrader Customer Service
-
Does this work with historical data or is this only realtime? I need to know historical opens and closes.
Comment
-
GetDayBar() docs say:
This bar is a virtual bar built off of the underlying data series. In some cases, the trading day bar can be used to represent a daily bar. Since this bar is virtual, its property values are calculated based on session definitions contained in the trading day only. This does not necessarily represent the actual day.
I'm wondering if I should add an additional Day type dataseries and use that to get the open and close?
Comment
-
With GetBar() I would be getting the open price at 9:30AM EST, however not all stocks open at precisely 9:30. So if I use this method then its possible I might get the price at 9:30AM but not the official opening price, correct?
If I use a Day series will this give me the correct opening? I believe day data is handled differently from intraday data. Assuming this gives the exchange opening price it seems this would be the only way to get the correct opening price.
Comment
-
Correct, with GetBar() you would need additional checks if you have a late opening stock then.
Besides using an added daily series, you can check into our pivots indicator - it loads Day bars asynchronously using non NinjaScript methods, check under it's custom methods implemented under the misc section in the code.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
55 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
3 responses
9 views
0 likes
|
Last Post Today, 03:23 PM | ||
Started by jordanq2, Today, 03:10 PM
|
2 responses
8 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
47 views
0 likes
|
Last Post Today, 02:36 PM |
Comment