Ciao ragazzi, è da tempo che vi seguo .... rubandovi i TS, ma adesso la mia creatura è pronta e voglio condividerla con voi, magari accettando interessanti modifiche....
attendo con ansia !!!!
{******************************************************************************
* Il sistema è stato testato sul FIB
* Compressione grafico 5 minuti
*Il sistema vuole catturare i cambi di volatilità
*******************************************************************************}
Var: mediarange, macdf, macds, miomax, miomin, ora, mediavol;
Input: percrange (20), barre (12);
mediarange = mov (R,barre,s);
mediavol = mov (V,barre,s);
macdf = macd (C,12,26);
macds = macdsign (C,12,26,9);
installstoploss (inperc, 1);
installtrailingprofit (inperc,1,0.9);
// opera solo dalle 9.30 alle 17.00 con pausa pranzo
if (t > 930 and t<1100) or (t>1530 and t<1700) then
if R > mediarange*(1+percrange/100) and positiondir <> 1 and macdf>macds and V>mediavol
and H>=H[1] and H>=H[2] and H>=H[3] and H>=H[4] and H>=H[5] and H>=H[6] and H>=H[7] and H>=H[8]
and H>=H[9] and H>=H[10] and H>=H[11] and H>=H[12] then
enterlong (nextbar, atopen);
colorbar (green);
ora = gethour;
endif;
if R > mediarange*(1+percrange/100) and positiondir <>-1 and macdf<macds and V>mediavol
and L<= L[1] and L<= L[2] and L<= L[3] and L<= L[4] and L<= L[5] and L<= L[6] and L<= L[7] and L<= L[8]
and L<= L[9] and L<= L[10] and L<= L[11] and L<= L[12] then
entershort (nextbar, atopen);
colorbar (red);
ora = gethour;
endif;
// engulfing bullish and engulfing bearish
if positiondir = 1 then
if H>=H[1] and H>=H[2] and H>=H[3] and H>=H[4] and H>=H[5] and H>=H[6] and H>=H[7] and H>=H[8]
and H>=H[9] and H>=H[10] and H>=H[11] and H>=H[12] and C[1]> O[1] and O>= C and O>=C[1] and C<=O[1]
and V> mediavol then
exitlong (nextbar, addtick (L,-1),stop,5);
entershort (nextbar, addtick(L,-1),stop,5);
colorbar (red);
endif;
endif;
if positiondir = -1 then
if L<= L[1] and L<= L[2] and L<= L[3] and L<= L[4] and L<= L[5] and L<= L[6] and L<= L[7] and L<= L[8]
and L<= L[9] and L<= L[10] and L<= L[11] and L<= L[12]
and C > O and O<= C[1] and C>=O[1] and O[1]>=C[1] and V> mediavol then
exitshort (nextbar, addtick(H,1),stop,5);
enterlong (nextbar, addtick(H,1),stop,5);
colorbar (green);
endif;
endif;
//posizione non short : massimo relativo ed inverted hammer nero
if positiondir <>-1 then
if H>=H[1] and H>=H[2] and H>=H[3] and H>=H[4] and H>=H[5] and H>=H[6] and H>=H[7] and H>=H[8]
and H>=H[9] and H>=H[10] and H>=H[11] and H>=H[12]
and (C-L)<=(H-L)*0.1 and (O-C)<=(H-L)*0.33 and V> mediavol then
exitlong (nextbar, addtick (L,-1),stop,5);
entershort (nextbar, addtick(L,-1),stop,5);
colorbar (red);
endif;
endif;
// posizione non long: minimo relativo ed hammer bianco
if positiondir <> 1 then
if L<= L[1] and L<= L[2] and L<= L[3] and L<= L[4] and L<= L[5] and L<= L[6] and L<= L[7] and L<= L[8]
and L<= L[9] and L<= L[10] and L<= L[11] and L<= L[12]
and (H-C)<=(O-L)*0.1 and (C-O)<=(H-L)*0.33 and V> mediavol then
exitshort (nextbar, addtick(H,1),stop,5);
enterlong (nextbar, addtick(H,1),stop,5);
colorbar (green);
endif;
endif;
//posizione nonshort : massimo relativo ed inverted hammer bianco
if positiondir <>-1 then
if H>=H[1] and H>=H[2] and H>=H[3] and H>=H[4] and H>=H[5] and H>=H[6] and H>=H[7] and H>=H[8]
and H>=H[9] and H>=H[10] and H>=H[11] and H>=H[12]
and (O-L)<=(H-L)*0.1 and (C-O)<=(H-L)*0.33 and V> mediavol then
exitlong (nextbar, addtick (L,-1),stop,5);
entershort (nextbar, addtick(L,-1),stop,5);
colorbar (red);
endif;
endif;
// posizione non long: minimo relativo ed hammer nero
if positiondir <> 1 then
if L<= L[1] and L<= L[2] and L<= L[3] and L<= L[4] and L<= L[5] and L<= L[6] and L<= L[7] and L<= L[8]
and L<= L[9] and L<= L[10] and L<= L[11] and L<= L[12]
and (H-O)<=(C-L)*0.1 and (O-C)<=(H-L)*0.33 and V> mediavol then
exitshort (nextbar, addtick(H,1),stop,5);
enterlong (nextbar, addtick(H,1),stop,5);
colorbar (green);
endif;
endif;
// il tempo passa
if gethour > ora + 3 then
modifytrailingprofit (inperc, 0.2, 1);
endif;
endif;
if t > 1720 then
if positiondir = 1 then exitlong (bar, atclose);
endif;
if positiondir = -1 then exitshort (bar, atclose);
endif;
endif;