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)
Paint charts based on Line crossovers on an oscillator
I'm trying to incorporate some rules into a CCI indicator so that it paints my charts a particular colour when certain conditions are met.
Here is the psuedo-code for the rules:
if CCI >=100, paint the chart green.
if CCI >=200 , paint the chart dark green.
if CCI <=-100, paint the chart red.
if CCI <=-200, paint the chart dark red.
This bit works fine, as you can see.
I'm having problems implementing the rule below:
if CCI crossing above -100, continue painting the chart red until it hits either 0 or +100 (set by a variable).
if CCI crossing below +100, continue painting the chart green until it hits either 0 or -100 (set by a variable).
I want to create a rule so that when CCI travels from -100 to +100 (or from +100 to -100) it will continue to paint whatever it was painting previously when it entered that range.
Here is my current code:
VARIABLES:
What's the best method to describe this rule?
Ive tried the below using some booleans ("bullish","bearish") , but i'm missing something simple I think.
Any thoughts welcome!
Ive exported the current version and attached it.
Can you help answer these questions from other members on NexusFi?