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
Help with shading regions.
Collapse
X
-
Hello KennyK,
Thanks for the reply.
Please try adding the [NinjaScriptProperty] decorator to the top of your properties. This will ensure they are added to the property grid properly.
e.g:
[NinjaScriptProperty]
[Display(Name = "1. Color Zone?", Description = "Color Zone?", GroupName = "Colors - Long Trend Up", Order = 1)]
public bool ColorzoneLU
{
get { return colorzoneLU; }
set { colorzoneLU = value; }
}
I look forward to hearing of your results.Chris L.NinjaTrader Customer Service
Comment
-
Ok, done that. Seems to save everything now, but all the properties are being written in the top of the chart. How do I get rid of that?
I left the [XMLIgnore] in, but I see in the sample you wrote, you have omitted it. Is that intentional, should I omit the [XMLIgnore] from all the properties?
Thanks for you patience.
Comment
-
Hello KennyK,
Thank you for your reply.
You do not need to put [XMLIgnore] on every property, only the ones that require serialization should have that decorator. Using [XMLIgnore] will guarantee that the property is not saved to the XML file.
To remove the label from the top of your chart, just override the DisplayName property in your script. Customize the display name and the long parameter list will be replaced with whatever you override the display name as.
Please let me know if I can assist further.Chris L.NinjaTrader Customer Service
Comment
-
Hi Chris, Tried that, got a heap of errors. Probably did something wrong? I just did what I thought it said to do in the link you provided.
You will see in the attached pic, name1, that the default name is what it should be, and does not include all the properties that actually print on the chart.
But I have circled in red, the code that I added as per the perceived instruction.
Please advise.
Thanks, Ken.
Actually there are 3 of the inputs I would like to have display along with the name, just not all the rest of them. The 3 are the EMA periods.
So should look like: TrendMA35. 5, 8, 13.
Comment
-
In addition to the previous message, I have looked at the code of another indicator to find an override example. I have applied it the same way to my indicator. It seems to work.
Can you confirm this is the right way to do it? If so, how then do I get the EMA inputs to show there as well?
Comment
-
Hello Ken,
Thanks for the reply.
Your last image is the correct way of setting up the DisplayName.
To include the EMA parameters, concatenate the values of EMA1Period to the string.
e.g.
public override string DisplayName
{
get { return ("TrendMA35, EMA1 Period: " + EMAPeriod1 );}
}
Please let me know if I can assist further.Chris L.NinjaTrader Customer Service
Comment
-
Hi Chris,
Thanks for your reply.
I now have this:
public override string DisplayName
{
get { return ("TrendMA35-" + EMA1Period + EMA2Period + EMA3Period);}
}
Which prints this: TrendMA35-82134
Is there as simple way to have commas inserted between each of the EMA settings?
To print like this: TrendMA35-8,21,34
Cheers,
Ken.
Comment
-
Hello KennyK,
Thank you for the reply.
This can be done with some additional string concatenation.
e.g.
Code:public override string DisplayName { get { return ("TrendMA35 - " + EMA1Period + ", " + EMA2Period + ", " + EMA3Period);} }
Chris L.NinjaTrader Customer Service
Comment
-
Here is your updated code DrawOnPricePanel = false;
ABC123TRADERAttached Files
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ghoul, Today, 06:02 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:27 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
44 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
179 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM |
Comment