Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
indicator on different values
Collapse
X
-
Hello Boonfly8,
Thanks for your post.
If you are looking for previous values you can just use the barsago of the MACd.diff plot
If you are looking for the maximum movement during the current bar, the currently forming bar (and diff plot) may well change during the bar formation and the diff plot may grow larger or smaller depending on the relationship of the MACD and MACD.avg lines. If you are wanting to find the maximum movement of the plot during the current bar formation then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
-
Hi Paul, thx for your note. I thought of simply using MACD.Diff[BarsAgo] but in this case if the strategy is set to Calculate.OnEachTick, the bars ago are tick changes where I need the maximum value of the bar of the histogram completed from my 1min chart.Originally posted by NinjaTrader_Paul View PostHello Boonfly8,
Thanks for your post.
If you are looking for previous values you can just use the barsago of the MACd.diff plot
If you are looking for the maximum movement during the current bar, the currently forming bar (and diff plot) may well change during the bar formation and the diff plot may grow larger or smaller depending on the relationship of the MACD and MACD.avg lines. If you are wanting to find the maximum movement of the plot during the current bar formation then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
Comment
-
Hello Boonfly8,
Thanks for your reply.
Just to be sure we are saying the same thing, MACD.Diff[0] will provide the current (tick) value of the MACD diff plot and may change on each tick until the bar closes at which point the diff value will be fixed and would be seen as historical. MACD.Diff[1] would be the prior bar completed and unchanging diff value, MACD.Diff[2] would be the completed bar before that, etc. etc.
If you need the maximum that the diff plot was during the forming bar then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
110 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
37 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
78 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment