// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = SmoothedStochastic[20,3](typicalPrice)
indicator2 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
c1 = (indicator1 CROSSES OVER indicator2)
IF c1 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator3 = SmoothedStochastic[20,3](typicalPrice)
indicator4 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
c2 = (indicator3 CROSSES UNDER indicator4)
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator5 = SmoothedStochastic[20,3](typicalPrice)
indicator6 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
indicator7 = SmoothedStochastic[20,3](typicalPrice)
indicator8 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
c4 = (indicator7 CROSSES OVER indicator8)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 15
SET TARGET pPROFIT 15