Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
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 kaywai, Today, 06:26 AM
|
1 response
6 views
0 likes
|
Last Post
by kaywai
Today, 06:35 AM
|
||
Started by ct, 05-07-2023, 12:31 PM
|
6 responses
205 views
0 likes
|
Last Post
by wisconsinpat
Today, 06:29 AM
|
||
Started by kevinenergy, 02-17-2023, 12:42 PM
|
118 responses
2,780 views
1 like
|
Last Post
by kevinenergy
Today, 05:41 AM
|
||
Started by briansaul, Today, 05:31 AM
|
0 responses
10 views
0 likes
|
Last Post
by briansaul
Today, 05:31 AM
|
||
Started by traderqz, Yesterday, 12:06 AM
|
11 responses
28 views
0 likes
|
Last Post Today, 05:11 AM |
Comment