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)
I am trying to have the backbrush color remain until the price hits another line.
If I understand correctly the BackBrush[0] will show color choice every time with current bar if the (if)statement is true and upon next bar if statement is false the BackBrush color shows the default chart color.
I am trying to have BackBrushes[0] = Brushes.Green; stay green as price is falling
until it hits the if(Low[0] <= Upper2[0])BackBrushes[0] = Brushes.Silver;
Any Help would be greatly appreciated, I've been trying with no avail
Thanks
Can you help answer these questions from other members on NexusFi?
If your code doesn't already, it may also be necessary to introduce a check to make sure that there is indeed a "one bar ago", otherwise this would throw an error when processing the chart's very first bar. So maybe this instead:
Assuming "Upper2" is always Higher than "Lower", the logic is probably never going to the segment with Brushes.Red, because once Silver is found we exit the if comparison.
Try testing for Red before Silver and see if that works:
Red showed up but didn't continue with red background, should continue till price hits an upper line. is there a way to check for background color? if( background = color)
Then xyz
is there any kind of reference beside ninja help guide that shows all the syntax that are available.
Hello again. It's hard to diagnose without context. The fact that silver is showing in between the reds means that the condition is satisfied, and we're checking Low against two different things, so whichever is hit is taking precedence.
Another way is to put in a "return" once a condition is satisfied, and then re-ordering your checks according to precedence, e.g. once red is hit, do NOT go to check for silver and instead wait for the next bar. Based on your initial code, here's one way of doing it: