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
Display Message On Chart When Bar Type Properties Set Incorrectly
Collapse
X
-
Display Message On Chart When Bar Type Properties Set Incorrectly
I have created a custom bar type and want to display a text message on the chart (instead of the bars) when the properties for the bar type are set incorrectly. I tried to do this with Draw.TextFixed, but that method is not available in BarTypes namespace. Any ideas on how I might go about doing this?Tags: None
-
Thanks Chelsea! Using a ChartStyle makes sense.
If I created a custom ChartStyle for the custom BarType, is there a way to set the custom ChartStyle as a default for the BarType? I know this can be done manually from the Data Series window by saving a preset. Is it also possible to do it in the code for the BarType?
Comment
-
Any thoughts on the followup question in my last post?
Comment
-
Hello gregschr,
So the bar type would need to use an existing property as its own with SetPropertyName(). SetPropertyName() works for bar types as well and I've noted to our development to add this to the Bars Type section of the help guide.
In the BarType file set DefaultChartStyle to your chart style script.
DefaultChartStyle = (ChartStyleType) 80;
Once the property is set, in the Chart Style's OnRender you have access to the Bars object.
Then access the property from the bar object -> BarsPeriod.
Print(chartBars.Bars.BarsPeriod.Value);
And draw this using SharpDX.Direct2D1.RenderTarget.DrawText().
Chelsea B.NinjaTrader Customer Service
Comment
-
Thanks Chelsea!
That was exactly what I needed.
I appreciate the detailed instructions and your help!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
147 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
4 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment