Hello,
I have a question which is hopefully easy to answer.
I wish to have a condition in my code which is that RSI is the Highest in last 5 bars.
I’ve tried a lot of different ways of coding, but just cant get it to work.
Hopefully someone can find a code that works. I’ve inserted the codes I’ve tried.
Regards.
myrsi = RSI[9](close)
c1 = RSI = Highest[5]
if c1 then
buy at market
endif
rsiperiod = 5
myrsi= RSI[10](close)
count = Summation[atrperiod](myrsi> myrsi[1])
if count > 5 then
buy at market
endif
myrsi = RSI[10](close)
c1 = (myrsi > myrsi[1])
IF LOWEST[5](c1) = 1 THEN
buy at market
endif
Please read the highlighted basic rules to abide by in these forum, among them:
- Do not double post. Ask your only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Thank you 🙂
Example 1 is correct if you replace line 3 with this one:
c1 = (myrsi = Highest[5](myrsi))
Did not realize I had doubleposted, sorry!
Thank you for the help!