// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
timeframe(1hour,updateonclose)
// Conditions to enter long positions
indicator1 = RSI[4](close)
c1 = (indicator1 > 40)
indicator2 = average[5](RSI[4](close))
indicator3 = Average[20](RSI[4](close))
c2 = (indicator2 >= indicator3)
timeframe(default)
indicator4 = RSI[2](close)
c4 = (indicator4[1] CROSSES OVER 30)
indicator5 = RSI[2](close)
c5 = (indicator5 < indicator5[1])
indicator44 = RSI[2](close)
yy = indicator44 > indicator44[2]
IF c1 AND c2 AND c4 AND c5 and yy THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator6 = RSI[2](close)
c6 = (indicator6 CROSSES UNDER 90)
IF c6 THEN
SELL AT MARKET
ENDIF