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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment