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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
41 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
28 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
45 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
37 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment