I need a little easylanguage help.
I'm trying to build a conditional statement based on the following. If an RSI value goes below 30, I want the conditional statement to remain true until the RSI goes back above 70. => "Once RSI<30 then true UNTIL RSI>70"
I've attached a chart demonstrating what I'm looking for. Also, here is my attempt at building this. As you can see I'm counting the number of bars since this condition was true. It compiles, however, I know that it isn't correct.
Variables: RSIValue(0).
Counter(0);
if RSIValue<30 then begin
while RSIValue<70 begin
counter=counter+1;
end;
end;
Conditional Statement
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
If I understand you correctly it should be something like this:
Code: Select all
inputs: Length(12);
Variables: Counter(0), MyRSICondition(false);
if RSI(close, Length) < 30 then
MyRSICondition = true;
if RSI(close, Length) > 70 then
MyRSICondition = false;