double congestionHighestValue = MAX(High, 4)[0];
double congestionLowestValue = MIN(Low, 4)[0];
double halfHighLow = (congestionHighestValue - congestionLowestValue);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Get price level from last 4 bars
Collapse
X
-
Get price level from last 4 bars
How can i get halfHighLow in price level? if i currently print halfHighLow it returns number of points but i want a price level.
Code:Tags: None
-
Hello tkaboris,
Thank you for your post.
Based on your snippet, you are currently calculating the difference between the highest high and lowest low in the last four bars. This is not a price level - you mention "halfHighLow" so I suspect you are looking for the price in between the highest high and lowest low from the last four bars. To calculate this, you will need to divide your current value for halfHighLow by 2 and then either add it to the lowest low or subtract it from the highest high.
You may verify this information with Print() statements. For example, if you print congestionhighestValue and the output is 1256 and then you print congestionLowestValue and the output is 1237, then it makes sense that halfHighLow would equal 1256 - 1237 so the output would be a "point value" of 19. If you wanted to get the price in between 1256 and 1237, you need to take 19 divided by 2 which is 9.5 then you could add that to 1237 or subtract it from 1256 and get 1246.5.
Please let us know if we may be of further assistance.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
74 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment