Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Good day Samir,
I don't code at all, but am trying to follow the logical here. I wish to add a line to an existing script and I want the line to have opacity values.
This works fine, but there's no opacity
AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
I tried adding you input, but receive an error
AddLine(SolidColorBrushes(Color.FromArgb(33, 255, 0, 0)) 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
Good day Samir,
I don't code at all, but am trying to follow the logical here. I wish to add a line to an existing script and I want the line to have opacity values.
This works fine, but there's no opacity
AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
I tried adding you input, but receive an error
AddLine(SolidColorBrushes(Color.FromArgb(33, 255, 0, 0)) 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
Can you correct what ever I am doing incorrectly?
Thank you, Ky
Hi Ky.
From what I can tell, you're missing:
- "new" before SolidColorBrushes, it should be AddLine( new SolidColorBrushes(Color.FromArgb(33, 255, 0, 0))
- a comma before the 0 you're using for a value: AddLine( new SolidColorBrushes(Color.FromArgb(33, 255, 0, 0)) , 0, ....)
See if that helps.
P.S. You probably already know this, but NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine is just a label. You can use any name you want for the line. So just to make it easier to follow the logic, replace it with "My Line" or "Ky's Line" etc. keeping the " " quotes.
From what I can tell, you're missing:
- "new" before SolidColorBrushes, it should be AddLine( new SolidColorBrushes(Color.FromArgb(33, 255, 0, 0))
- a comma before the 0 you're using for a value: AddLine( new SolidColorBrushes(Color.FromArgb(33, 255, 0, 0)) , 0, ....)
See if that helps.
P.S. You probably already know this, but NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine is just a label. You can use any name you want for the line. So just to make it easier to follow the logic, replace it with "My Line" or "Ky's Line" etc. keeping the " " quotes.
Samir, thank you for replying.
I tried the syntax and get the following error:
This should work, but just a couple of notes. I made the line value "10" because 0 would generate the line too close to a border, so you'll hardly see it. And also the colour choice above 33% of Red is hardly visible if you're using the default colours of NT. Once that line compiles okay for you, and you still can't see it, maybe try setting the chart's background to white or gray, etc.
This should work, but just a couple of notes. I made the line value "10" because 0 would generate the line too close to a border, so you'll hardly see it. And also the colour choice above 33% of Red is hardly visible if you're using the default colours of NT. Once that line compiles okay for you, and you still can't see it, maybe try setting the chart's background to white or gray, etc.
Thank you Samir.
This plots. One question, how do I change the opacity of the line? It is really a zone, so I enlarge the size of the line.
My apologies Samir
I was not clear. I wish to change the opacity of the line (something like LineColorOpacity = 40
I dunno how to modify the opacity of a line... but you could draw a box with a height of 1 tic, and you could then have opacity control over it. Would that suit your needs?