Var: Miomov1,CondizioneLong,CondizioneShort,OP1,OP2,OP3,solo,spread,zona1,MIN1,MAX1,bb,cc;
MIN1 = LLV(RSI(C,14,s),20) < Ref(LLV(RSI(C,14,s),20),2) AND LLV(RSI(C,14,s),20) < 30;
MAX1 = HHV(RSI(C,14,s),20) > Ref(HHV(RSI(C,14,s),20),2) AND HHV(RSI(C,14,s),20) > 70;
if MIN1 = true then
bb =5;
else
bb =2;
endif;
if MAX1 = TRUE then
CC =5;
else
CC =2;
endif;
MioMov1 = MOV(C,21,s);
OP1 = MioMov1-C;
OP2 = C -MioMov1;
OP3 = MioMoV1/100;
CondizioneLong = OP1 > OP3 ;
CondizioneShort = OP2 > OP3 ;
if condizionelong = true and MIN1 = true then
solo = 1;
else
solo =0;
endif;
if condizioneshort = true and Max1 = true then
spread=1;
else
spread=0;
endif;
zona1=CreateViewport(300,true,true);
PlotChart(solo,zona1,green,solid,1);
PlotChart(spread,zona1,red,solid,1);