Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Can you change color of a candle on price change and finalize the color on BarClose?
Collapse
X
-
Let me know what you find. It only happens once in a while, the time we know it happened is range 6 on ES on Jan 13th 2021 at around 8:51am
-
Hello WeyldFalcon,
Thank you for your reply.
I suspect the difference is because you're checking if the lastPrice variable you've saved matches Close[0] or not - should they match at the time you're checking, you could see a delay. Is there a reason you've changed it from IsFirstTickOfBar?
Thanks in advance; I look forward to assisting you further.
Comment
-
When IsFirstTickOfBar did not work NinjaTrader_Jim suggested a different way in post #6 at 02-03-2021, 11:19 AM.
Comment
-
Hello WeyldFalcon,
Thank you for your reply.
Jim was referring to if you want some of it to only function on a price change, then you could use that. If there isn't a price change, there would be a delay in the updating. We'd want to look further into why you're not seeing IsFirstTickOfBar working. IsFirstTickOfBar should work on most bar types that do not redraw the open as long as the bar type does not redraw the open. For range bars, this would be expected to work if you are running the indicator OnEachTick. Are you using the built in Range bars?
Thanks in advance; I look forward to assisting you further.
- Likes 1
Comment
-
Just to clarify
use
IsFirstTickOfBar
if
Calculate = Calculate.OnEachTick;
use
lastPrice != Close[0]
if
Calculate = Calculate.OnPriceChange;
?
Thank you for clarifying, tested both, and both worked. I think I will go with OnPriceChange since that is what my original plan was.
Comment
-
Hello WeyldFalcon,
Thank you for your reply.
You'd use the first one if you want to finalize the bar once, just on the first tick of the next bar if using either OnPriceChange or OnEachTick.
You'd use the second one if you're running on each tick and you'd like to re-finalize the bar with each price change of the currently forming bar.
Please let us know if we may be of further assistance to you.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment