How can I adjust the settings or code to make OBV values start calculating on the first bar instead of 2nd bar?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
No Indicator Data on First Bar
Collapse
X
-
No Indicator Data on First Bar
upon loading the chart and indicators, some indicators like OBV and ADL show a value of "0" for the first bar. However, the first bar has volume data, so OBV and ADL should be populated with the volume number, but it's not. This really messes up calculations for the rest of the day.
How can I adjust the settings or code to make OBV values start calculating on the first bar instead of 2nd bar?Tags: None
-
Patrick, thanks for your reply. I've tried on each tick calculation as well. Doesn't work. Even for on bar close, there's volume data on bar close, so if bar closes with 10,000 volume, and the bar was positive, then OBV value on 1st bar should be 10,000. But it's 0 for both calculation methods.
Comment
-
Hello Ocean Zhang,
Thank you for your response.
Can you attach a screen shot of the charts so I may investigate this matter further?
To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.
Click here for instructions: http://windows.microsoft.com/en-us/w...#1TC=windows-8
Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment to this forum thread.
Click here for detailed instruction: http://take-a-screenshot.org/
I look forward to your response.
Comment
-
Comment
-
The logic is bad. 0 OBV on first bar can severely mess up the calculations the rest of the day. I've worked with 3 other platforms, and all of them retrieve volume data for OBV starting the 1st bar loaded. How can this be changed in NT to recognize the volume of the first bar?
ADL is a very similar concept as OBV. NT calculates ADL correctly, starting with volume of the 1st bar.
Comment
-
Hello Ocean Zhang,
Thank you for your response.
OBV compares the current close against the prior close. On CurrentBar 0 there is no prior close and therefore the value is set to 0.
The OBV determines whether to add to or subtract from the prior volume with the current volume based on the comparison of the current and prior close. On bar 0 there is no prior volume nor close.
Please let me know if you have any questions.
Comment
-
I understand the logic behind the calculations in NT, but it's not 100% correct because it doesn't have a starting value as the creator intended. NT code needs to assign a starting value equal to the positive/negative volume of the first bar and then start the calculations. This is how all other platforms do it.
relevant quote:
"Because OBV has to start somewhere, the first value (8200) is simply equal to first period's positive/negative volume."
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
7 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
9 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
4 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Comment