Hi all!
Is it possible to some how hold a value depending on RSI (-1) until another RSI value is given and then change status to (1)?
Example;
IF RSI[14] > 70 then Short = -1 (i want it to hold -1 status until rsi drops under 30, then change to 1 and vise verse)
IF RSI[14] < 30 then Long = 1
Regards,
Pierre
IF RSI[14] > 70 then Short = -1
IF RSI[14] >30 AND RSI[14] <70 then neutral = 0
IF RSI[14] < 30 then Long = 1
Do something like this instead?
Almost but not there.
I want it to hold -1 value as long as it doesnt get under RSI[14] < 30 and when it goes under 30 i want to hold the value 1 until it comes over RSI[14] > 70
If close crosses over 70 then Short = -1
if close crosses under 30 then Long = 1
not tested, but i think this will hold the value until the next cross
hum, no it doesn´t .. i have been trying to do if Short[1] is a specifik value then the next should be the same untill another value showes up..
maybe this is more advanced then i first thougt.
Not sure I fully understand but perhaps something like this?
if rsi[14] crosses over 70 then
short = -1
endif
if rsi[14] crosses under 30 and short = -1 then
short = 1
endif
if rsi[14] crosses under 30 then
long = 1
endif
if rsi[14] crosses over 70 and long = 1 then
long = -1
endif
Big Thanks! That didn´t come up in my my mind to reverse it that way, i made it much harder in my mind 😀
and thanks @snucke for replying!
Glad you liked it however please don’t quote code in your replies unless it is totally necessary as part of your post. Also use the ‘quote’ button rather than cutting and pasting. I’ve tidied up your post.