Which is the correct method to reference the previous bar?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CurrentBars[1]
Collapse
X
-
Hello several,
You are using the Plural CurrentBars and not the singular CurrentBar, CurrentBars is used to get the index in a multi series script. For example CurrentBars[1] would represent the secondary series. In a single series script you have singular CurrentBar which does not take a bars ago, that's just the index of what bar is being processed. To know what the previous bars index was you would need to subtract 1 from CurrentBar.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
30 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment