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)
Here is my Linear Regression 2 colors code - How can I anticipate the color switch?
I'm using the following code for the Linear Regression but it change its color a bar late for...
Let me explane with an example over the FDAX...
Let's suppose we have an uptrend linear regression (LR) line yellow and then it is approching to switch direction and we came to the point where LR[4] is 12349,70, LR[3] is 12350,80 , LR[2] is 12350,68 and then LR[1] is 12350,49.
Ok so this is the situation that I actually see on my chart:
I have the UpColor between LR4 and LR3, // correct because LR4 12349,70 < LR3 12350,80
I have the UpColor between LR3 and LR2, // wrong because LR3 12350,80 > LR2 12350,68
I have the DownColor between LR2 and LR1, //correct because LR2 12350,68 > LR1 12350,49
So basically the indicator is switching color a bar late and I honestly can't find a way to change it!
... Also I would like to see the last piece of line to change color (if the condition are met) on every tick untill the bar end and its value is definitive so I know that I'm approching the switch...
How can I achive that?
HERE you have a grafic example of what I mean
Any help would be appreciated.
Thanks
Can you help answer these questions from other members on NexusFi?