IQ Feed
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Opening and Last Close
Collapse
X
-
Thank you for your patience, Occam.
I looked at CurrentDayOpen values.
I was able to get correct values for this in the market analyzer, and saw how incorrect values can be seen.
The default bars lookback is 50. If you're using 1 minute bars, for example, this won't be enough bars to go back to the beginning of the day and get the correct open.
The solution here is to increase the lookback period or change the time interval so that there are enough bars loaded to go to the start of the session. You could use 60 minute bars and then should see correct values with lookback = 50. The same principle will apply if you're trying to access current day high or prior day close - You have to ensure enough bars are loaded.
The SMA should be applied to a daily series. CurrentDayOHL and PriorDayOHLC are intended for intraday series. Please be sure to evaluate these with separate indicators / columns. I was not able to see the issue where it is updated continuously. Let us know if you're still having trouble with this and any specific setup details.Last edited by NinjaTrader_RyanM1; 09-09-2010, 03:12 PM.Ryan M.NinjaTrader Customer Service
Comment
-
Ok,
How do I set the bars so that they are daily or 60 min as you suggest? Both in the Market Analyzer and in code.
I see how to change look back in the Market Analyzer, is that the control point for the underlying code as well or do I need to alter the code also?
Comment
-
Hi Occam,
This is set when you create/edit the column. You can right Click > Columns to adjust this. For each column you can select the data series interval that is used to calculate the indicators.
You don't set this within the code. It's all done within market analyzer settings.Ryan M.NinjaTrader Customer Service
Comment
-
Ok, subscribed to intra day.
Add column Indicator Set Data series/Type = Day
Add a line in code
Print(CurrentDayOHL().CurrentOpen[0].ToString());
Check the output and I see a number that keeps changing and is not equal to the open??
So how I get today's open?Last edited by occam; 09-29-2010, 12:57 PM.
Comment
-
Originally posted by NinjaTrader_RyanM View PostYou would want to apply CurrentDayOHL to an intraday ( < daily) series.
I'm not sure where to post this but I have an issue with setting the bar calculation mode. I am wanting to apply the typical or median price calculation to an obv indicator on a tick chart, but when I swap out the different calculation options, open, close. median, typical etc, there is no change in the line graph, they are all the same. Why doesn't it work? Thanks
Comment
-
Hello syxforex,
It depends how the indicator is setup. The default OBV for example, is hard coded to use Close values.
You can make changes to this indicator to allow price input.
Click Tools > Edit NinjaScript > Indicator > Open OBV.
Save a copy by Right Clicking > Save as.
Add this line to Initialize():
PriceTypeSupported = true;
Then, replace any reference to Close with InputRyan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
587 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
341 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
555 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment