posto il codice di un vecchio TS sulle Bollinger che avevo fatto......opera sulle inversioni e non trend follower......ha un difetto......bravo chi lo scopre.....e più bravo ancora chi lo migliora ....

Var: Invbarup, Miostop, Miotarget, Invbardown, EntryL, EntryS;
Invbarup = l<bbandlower(c, 15, 1.5, 0) and h> bbandlower(c, 15, 1.5, 0) and c>o;
Invbardown = h>bbandupper(c, 15, 1.5, 0) and l< bbandupper(c, 15, 1.5, 0) and c<o;
if Invbarup and Positiondir = 0 then
EntryL = addtick(h,1);
Miostop = l;
Miotarget = h+h-l;
enterlong(nextbar, EntryL, stop,2);
installtakeprofit(inperc,12);
installstoploss (inperc,0.2);
installtrailingprofit(inperc,3,2);
//installstoploss (inval, Addtick(Miostop,-1));
//installtakeprofit (inval, Addtick(Miotarget,2));
endif;
if Invbardown and Positiondir = 0 then
EntryS = addtick(l,-1);
Miostop = h;
Miotarget = l+l-h;
entershort(nextbar, EntryS, stop,2);
//entershort(bar, atclose);
installtakeprofit(inperc,12);
installstoploss (inperc,0.2);
installtrailingprofit(inperc,3,2);
//installstoploss (inval, Addtick(Miostop, 1));
//installtakeprofit (inval, Addtick(Miotarget,-2));
endif;