BackBrushes[-1] = backBrush;
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Background color (backBrush) of future bar
Collapse
X
-
Hello cutzpr,
Drawing objects use slots in the chart which is a little different of a concept so technically those can draw to a certain extent into the future although that is not supported in NinjaScript and has issues with rendering in certain use cases. In general there is no ability to reference future bars because they have not been processed yet. All scripts are intended to process bars as they come in and reference bars in the past that are available at the time of processing.
Comment
-
Hello cutzpr,
No there is no support for drawing into the future with NinjaScript, you can with some objects technically use negative bars ago but that can also cause problems. I wouldn't be able to assist with that type of logic. If you want to draw into the future with a drawing object you can use a Ray which does a rendering projection with the chart coordinates rather than using bars. That renders to the edge of the chart so if you scroll ahead its still visible. In that use case you would use 1 bars ago as the start anchor and 0 bars ago as the end anchor to point the ray to the right.
Comment
-
So after some test, I noticed that if paint a future backbrush with an index in the future, eventually when I get to that bar, the background is painted once that bar actually completes. Which works well for testing atleast. Could you please confirm that what I am seeing is correct?PHP Code:BackBrushes[-1] = backBrush;
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
598 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
557 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment