London - England
Experience: Intermediate
Platform: NT, TW
Trading: Futures & Options
Posts: 35 since Dec 2016
Thanks Given: 60
Thanks Received: 12
|
Hi all,
I am reasonably new to C# but making progress with learning it on NT8.
I am having a issue with defining a condition and hoping someone could point me in the right direction.
Lets say I have a oscillator (RSI for instance) that can move between 100 and -100.
- I'd like to colour it green when it moves beyond 70..... and stay green while it stays above 0.
- Once below zero, it becomes grey.
- I'd like to colour it red when it moves below -70.... and stay red while it stays below 0.
In the OnBarUpdate() method...
- If I say: If(RSI[0] > 70) >>> thats only makes values ABOVE 70 green, and when we have a value of 65, that condition is not longer true (so doesnt satisfy the "stay green while it stays above 0" bit).
- If I say: If(CrossAbove(RSI)...) >>> that only colours that 1 value, and the condition is no longer true on the next bar, so that doesn't work either.
- If I says: If(CrossAbove(RSI)...) >>>
While(RSI>0) >>> that doesn't work either because the CrossAbove condition only satisfies the cross over bar.
Any insight into how one would translate this into a C# structure would be great.
I've attached a screenshot to better illustrate my goal.
|