I realize this is more of a C# question than NT7, but would be grateful if someone can direct me to a resource which can explain how to do this. thanks
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
List Box on chart
Collapse
X
-
List Box on chart
Looking for guidance on how to display a list box on a chart (like a button) ... the list will be populated by an enum list. It should function the same as a list box that would appear in the parameters section, but I need it to display in the header section of the chart itself.
I realize this is more of a C# question than NT7, but would be grateful if someone can direct me to a resource which can explain how to do this. thanksTags: None
-
Don't remember where I picked this up.
Hope it helps.Attached Files
-
Thank you shuglu! Appreciate your response. One more question. I need to populate the ToolbarDropdown with the ATM strategy names. I already have a section of code that accesses the strategy names to populate a list in the parameters section (see code below in blue), but not sure how do I get these ATM strategy names in the ToolbarDropdown. Any insight will be greatly appreciated! tx
#region StringConverter
public class AtmConverter : StringConverter
{ public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; }
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { return false; }
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{ string[] sarr = new string[0];
foreach (StrategyData data in NinjaTrader.Db.Globals.Engine.GetObjectSet(typeof( StrategyData), "category = " + 2))
{ if (data.Strategy is AtmStrategy)
{ Array.Resize<string>(ref sarr, sarr.Length+1); sarr[sarr.Length-1] = data.Strategy.Name;
} }
foreach (StrategyData data in NinjaTrader.Db.Globals.Engine.GetObjectSet(typeof( StrategyData), "category = " + 1))
{ if (data.Strategy is AtmStrategy)
{ Array.Resize<string>(ref sarr, sarr.Length+1); sarr[sarr.Length-1] = data.Strategy.Name;
} }
return new StandardValuesCollection( sarr );
}
}
#endregion
Comment
-
Hello pman777,
This would be far outside of the realm of NinjaTrader Support, however, you have a for loop in your converter that is likely populating these values.
Originally posted by pman777 View Postforeach (StrategyData data in NinjaTrader.Db.Globals.Engine.GetObjectSet(typeof( StrategyData), "category = " + 2))Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by sidlercom80, 10-28-2023, 08:49 AM
|
169 responses
2,268 views
0 likes
|
Last Post Today, 04:11 AM | ||
Started by Irukandji, Yesterday, 02:53 AM
|
2 responses
17 views
0 likes
|
Last Post
by Irukandji
Today, 03:55 AM
|
||
Started by adeelshahzad, Today, 03:54 AM
|
0 responses
3 views
0 likes
|
Last Post
by adeelshahzad
Today, 03:54 AM
|
||
Started by CortexZenUSA, Today, 12:53 AM
|
0 responses
3 views
0 likes
|
Last Post
by CortexZenUSA
Today, 12:53 AM
|
||
Started by CortexZenUSA, Today, 12:46 AM
|
0 responses
1 view
0 likes
|
Last Post
by CortexZenUSA
Today, 12:46 AM
|
Comment