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)
Hi,
Could someone give me a snippet of code that changes the color of an indicator line to green when it moves above zero and red when it moves below zero?
Thanks in advance.
Macro
Can you help answer these questions from other members on NexusFi?
NT has built-in functions called CrossAbove and CrossBelow to check for the zero cross.
Check out the help section of NT on these functions.
Also I would suggest you check out some of the free indicators in the futures.io (formerly BMT) download area for code samples on how to change the color. You will have to write code to modify the plot properties but it's difficult to give a specific answer since you have not specified what indicator you want to modify.
Hi Man From Texas,
Thank you for your response.
The indicator in question is the LinRegSlope. I know that comes with NT7 and cannot be changed but I like to use a zero line with it and I got tired of drawing a zero line, so I managed to cobble together LinRegSlope with a zero line. Then I realized it would be nice if the indicator changed to green above zero and red below. I am familiar with TS Easy Language and it is an easy matter to do color changes with Easy Language. However, when I looked at the color change code in some other indicators, I decided it was not so easy and obvious in C#.
Your assistance would be most appreciated.
Regards,
Macro
You should see all the really cool free stuff in the Elite Section. I strongly suggest you become an Elite member (Click on Elite Access at the top of the home page) it's painless and offers a tremendous amount of resources for traders.
Disclaimer: I am not a programmer, coach, trainer or self appointed guru. Have a professional review any code you receive from me before you trade real money with it. I am an Elite member of futures.io (formerly BMT) but am not an employee of or a spokesperson for futures.io (formerly BMT) and receive no compensation for recommending futures.io (formerly BMT) Elite membership.
I sent a message on this. How can I or you :-) do this for an ADX or CCI, when the indicator pivots form up/dn? I am not a coder, but figured adding the correct syntax of the NT7 indicator and saving it with a new name would work. No success finding the correct syntax to make it work.