Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time estimate
Collapse
X
-
Time estimate
Good day, please tell me how to compare the time of the opening of the last two bars prices using bartype "range"?Tags: None
-
Hello Papercut, and thank you for your question.
With NinjaScript, we do not actually have to filter any data through our bars. We have access to raw, uninterpreted price data. The difference between the price of the last two bars is simply
Last[0] - Last[1]
The order I picked is the price of the most recent bar, minus the price of the 2nd most recent bar, so that a positive value means the market is trending upward, and a negative value means the market is trending downward. If you do not care which way the market is trending and just want to know how big the change was, that is
Math.Abs(Lasts[0] - Last[1])
Please let us know if there are any other ways we can help.Jessica P.NinjaTrader Customer Service
-
NinjaTrader_JessicaP, thanks a lot!Originally posted by NinjaTrader_JessicaP View PostHello Papercut, and thank you for your question.
With NinjaScript, we do not actually have to filter any data through our bars. We have access to raw, uninterpreted price data. The difference between the price of the last two bars is simply
Last[0] - Last[1]
The order I picked is the price of the most recent bar, minus the price of the 2nd most recent bar, so that a positive value means the market is trending upward, and a negative value means the market is trending downward. If you do not care which way the market is trending and just want to know how big the change was, that is
Math.Abs(Lasts[0] - Last[1])
Please let us know if there are any other ways we can help.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment