However, is there any other technique to exclude the current bar from the calculation? Specifically, I am looking at applying this to an Indicator, not just a single Price point (i.e. Open, High, Low, Close).
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using GetMedian()
Collapse
X
-
Using GetMedian()
The syntax GetMedian() seems to include the current bar in the calculation, which might skew the result if the bar is early in development. One might assume that you could use calculate = OnBarClose to resolve this (but unsure).
However, is there any other technique to exclude the current bar from the calculation? Specifically, I am looking at applying this to an Indicator, not just a single Price point (i.e. Open, High, Low, Close).Tags: None
-
Hello tradeologist,
Unfortunately, there is not a barsAgo index that can be used with this.
What you could do though, is save the median value to a variable on each update except for when IsFirstTickOfBar is true, and when true, the value would be for the previous bar.
You might also consider creating your own method that does not include the current bar.
A community member has shared a general formula in the thread below.
Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
127 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
72 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
112 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
109 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
88 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment