Help with RSI rule

 
Hey guys,
there is a simple code from another platform that I wanted to replicate in metatrader, could you help me?


   if (rsi(2,0) < lowest(rsi(2,0),10)[1]) then
   BuyAtMarket;

I need to create a buy signal for when the 2-period rsi is less than the 2-period rsi of the last 10 periods.

Thanks in advance
 
diegotfcastro:
Hey guys,
there is a simple code from another platform that I wanted to replicate in metatrader, could you help me?



I need to create a buy signal for when the 2-period rsi is less than the 2-period rsi of the last 10 periods.

Thanks in advance

iRSI rule

iRSI rule

 
Vladimir, you are the most amazing guy in this community! congratulations and thanks
 
My friend,
Could you add stop/take/breakeven etc in this code? I tried to do this, but I didn't understand the code very well, it's at a higher level of knowledge. I think it would be really cool and complete, as the code has been working beautifully.
 
diegotfcastro:
My friend,
Could you add stop/take/breakeven etc in this code? I tried to do this, but I didn't understand the code very well, it's at a higher level of knowledge. I think it would be really cool and complete, as the code has been working beautifully.

Ok.

Reason: