Optuma Forums › Optuma Scripting › Using Signal After In A Custom Color Script › Reply To: Using Signal After In A Custom Color Script
March 1, 2022 at 11:05 am
#67616
- Topics: 5
- Replies: 609
- Posts: 614
Hi,
From what i understand you want the plot to be one colour once the RSI crosses above 70, then stay that way until the plot crosses above 40? Then it stays green until it goes back above 70 again?
If so, this script would work:
1 2 3 4 5 6 |
V1 = RSI(); SIG1 = V1 CrossesAbove 70; SIG2 = V1 CrossesAbove 40; SWITCH(Sig2,Sig1) |
Here’s a chart example.
If the plot always has to be above 40 to be green, even if it hasn’t crossed above 70 again, this script would work:
1 2 3 4 5 6 |
V1 = RSI(); SIG1 = V1 CrossesAbove 70; SIG2 = V1 CrossesAbove 40; SWITCH(Sig2,Sig1) and V1 > 40 |
Chart example:
-
This reply was modified 2 months ago by
Matthew.