Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BarDelta calculation- Delta Bar
Collapse
X
-
BarDelta calculation- Delta Bar
Hi all, i am not sure why when i calculate current bar delta using this code (barsType.Volumes[CurrentBar].BarDelta ) it gives me the correct number but when try to calculate one bar ago using this code (barsType.Volumes[1].BarDelta ) it doesn't give me the correct number? can you please advise?Tags: None
-
Using '1' for 'one bar ago' is incorrect thinking.
The BarDelta value on the previous bar is this,
barsType.Volumes[CurrentBar-1].BarDelta
The documentation for Volumetric bars clearly states
that the index being used is not a BarsAgo reference,
so using an index of '1' is not appropriate here.
Scroll to the bottom of this page,
"Please note in the example above a CurrentBar
reference is used as index, and not a BarsAgo
reference."
-
Hello yosaam,
May I confirm you have a condition to confirm that CurrentBar is greater than 1?
if (CurrentBar < 1)
return;
Below is a link to a forum post on indexing errors.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
267 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
169 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
171 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
260 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
210 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment