//NEOMKEY BETA SYSTEM | indicators
////////////////////////////////////////////////////// PARAMETERS
DEFPARAM CUMULATEORDERS = FALSE
DEFPARAM FLATBEFORE = 153000
DEFPARAM FLATAFTER = 220000
TIMEFRAME (5 MINUTES)
////////////////////////////////////////////////////// INDICATORS
iDSUP = DONCHIANCHANNELUP[5]
iDINF = DONCHIANCHANNELDOWN[5]
iMH = AVERAGE[3](HIGH)
iML = AVERAGE[3](LOW)
iMACDL = MACDLINE[12,26,3]
////////////////////////////////////////////////////// CONDITIONS
iC1 = ((iMH > iMH[1]) AND (iML > iML[1]))
iC2 = (iMACDL > iMACDL[1])
iC3 = (CLOSE <= iML)
iSC = ((CLOSE CROSSES OVER iMH) OR (CLOSE CROSSES UNDER iDINF))
iV1 = ((iMH < iMH[1]) AND (iML < iML[1]))
IV2 = (iMACDL > iMACDL[1])
iV3 = (CLOSE >= iMH)
iSV = ((CLOSE CROSSES UNDER iML) OR (CLOSE CROSSES OVER iDSUP))
TIMEFRAME (DEFAULT)
// Condiciones para entrada de posiciones largas
IF NOT LongOnMarket AND (iC1 AND iC2 AND iC3) THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
// Condiciones de salida de posiciones largas
If LongOnMarket AND iSC THEN
SELL AT MARKET
ENDIF
// Condiciones de entrada de posiciones cortas
IF NOT ShortOnMarket AND (iV1 AND iV2 AND iV3) THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
// Condiciones de salida de posiciones cortas
IF ShortOnMarket AND iSV THEN
EXITSHORT AT MARKET
ENDIF