Thank you.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
addplot in state.default
Collapse
X
-
addplot in state.default
Hello, how do I write addplot in state.default that draws backbrush or barbrush on the chart? I cannot find an example of these two. If this is not possible and I can only use OBU, what addplot do I write in default that does not draw anything on my chart?
Thank you.Tags: None
-
Hi Jesse. When I assign values to backbrush in OBU it works fine. But when I configure a plot in state.default it makes a line, which ruins my chart. When I set this plot to Transparent in state.default to remove the line, I cannot control the color of my backbrush when I load the indicator on my chart. I have to hard code the color of my backbrush.
I guess my question is how do I configure a plot in state.default that does not draw anything on my chart? I'm sure it's a simple question but I don't know how to do it.
Thanks.
Comment
-
Hello imalil,
Using Transparent for a plot is expected to remove it, that is a documented way to hide a plot from the UI. Using a brush will show the plot in the chart.
I am still not understanding the problem as you described it, Are you trying to use a plot to just hold data and not display it? What is the goal you have with the plot?
JesseNinjaTrader Customer Service
Comment
-
I want to be able to control the color of my two backbrushes from the UI, but all it shows right now is Transparent, not the colors I'm using in the backbrush. Here is my setup right now:
In state.default I have AddPlot(Brushes.Transparent, "plot1"); AddPlot(Brushes.Transparent, "plot2"); (these two plots draw lines on my chart that I do not want, so I have to make them Transparent.)
In OnBarUpdate I have two conditions. If it's a bearish condition I have BackBrush = Brown; bullish, BackBrush = White;
plot1[0] = bearish BackBrush variable, plot2[0] = bullish BackBrush variable.
When the indicator is loaded on my chart and I look at its UI, plot1 and plot2 are Transparent, not Brown and White. Meaning the UI is seeing the addplot in state.default, not the backbrush in OBU.
My question/goal is how do I see my backbrush colors, Brown and White, in the UI?
Thank you.
Comment
-
Hello imalil,
I want to be able to control the color of my two backbrushes from the UI
You can use the indicator wizard or strategy builder to generate brush user input properties and their syntax.
If you want the plot to be transparent unless set you can still use a default color like Brushes.Red, in OnBarUpdate set the plot color to transparent before any other conditions which may reset it to a different color.
Keep in mind that setting individual bar colors like this can be resource intense if you use large amounts of historical data. If that is the case you would want to switch to using OnRender to display the data in a more efficient way.
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment