if COMMODITY<0
and
H<mov(c,20,s)
and
mov(C,20,s)<mov(C,50,s)
and
LOW_PRICE_CONTROL < ref(LOW_PRICE_CONTROL,1)
and
MACD_CONTROL > ref(MACD_CONTROL,1)
and miorsi < 28 and (miomov1-C) > 0.0025 or
COMMODITY<0
and
H<mov(c,20,s)
and
mov(C,20,s)<mov(C,50,s)
and
LOW_PRICE_CONTROL < ref(LOW_PRICE_CONTROL,1)
and
MACD_CONTROL > ref(MACD_CONTROL,1)
and miorsi[1] < 30 and (miomov1-C) > 0.0025 then enterlong(nextbar,atopen); endif;
if H >= mioMov1 then exitlong(nextbar,atopen); endif;
if COMMODITY>0
and
L>mov(C,20,s)
and
mov(C,20,s)>mov(C,50,s)
and
HIGH_PRICE_CONTROL > ref(HIGH_PRICE_CONTROL,1)
and
MACD_CONTROL < ref(MACD_CONTROL,1)
and miorsi > 72 and (H-miomov1)> 0.0025 or
COMMODITY>0
and
L>mov(C,20,s)
and
mov(C,20,s)>mov(C,50,s)
and
HIGH_PRICE_CONTROL > ref(HIGH_PRICE_CONTROL,1)
and
MACD_CONTROL < ref(MACD_CONTROL,1)
and miorsi[1] > 75 and (H-miomov1)> 0.0025 then entershort(nextbar,atopen); endif;
if L <= mioMov1 then exitshort(nextbar,atopen); endif;
if (C- miomov1) > 0.001 and C > C[15] and (H = HHV(H,5)) and ref(HHV(H,10),5) < HHV(H,5) and miorsi <= miorsi[5] then divergencyL = 1 ; else divergencyL = 0; endif;
if (Miomov1-C)> 0.001 and C < C[15] and (l = LLV(L,5)) and ref(LLV(L,10),5) > LLV(L,5) and miorsi >= miorsi[5] then divergencyS = 1 ;else divergencyS = 0; endif;
if divergencyL = 1 then entershort(nextbar,atopen);endif;
if divergencyS = 1 then enterlong(nextbar,atopen);endif;
if H >= mioMov1 then exitlong(nextbar,atopen); endif;
if L <= mioMov1 then exitshort(nextbar,atopen); endif;