// Main code : Rsi
//-------------------------------------------------------------------------
DEFPARAM CumulateOrders = true//
indicator1=RSI[14](close)
indicator2=RSI[2](close)
//condition to enter long
c1=(indicator2 crosses over indicator1)
c2=(RSI[14](close) > 50)//RSI upward momentum
c3=(RSI[2](close) <70)//RSI downword momentum
c4=(indicator2 crosses under indicator1)
if c1 and c2 then
buy 1 contracts at market
endif
Set target pprofit c3
SET STOP pLOSS c4
//Conditions to enter short
c1=(indicator2 crosses under indicator1)
c2=(RSI[14](close) < 50)//RSI downword momentum
c3=(RSI[2](close) >30)//RSI upword momentum
c4=(indicator2 crosses over indicator1)
if c1 and c2 then
buy 1 contracts at market
endif
Set target pprofit c3
SET STOP pLOSS c4