Var: miavar(0), Miacondizione1,Miacondizione2,miacondizione3,Miacondizione4,Miacondizione5,Miacondizione6;
Var: Miacondizione7,Miacondizione8, Miacondizione9,Miacondizione10, Miacondizione11,Miacondizione12, Miacondizione13,Miacondizione14;
Var: Miacondizione15,Miacondizione16,Miacondizione17,miacondizione18,STOP;
    if T = 0910 then
    Miacondizione1 = C+30;endif;
    if T = 0910 then
    Miacondizione2 = C-30; endif;
    if T = 1010 then
    Miacondizione3 = C+30;endif;
    if T = 1010 then
    Miacondizione4 = C-30; endif;
    if T = 1110 then
    Miacondizione5 = C+30;endif;
    if T = 1110 then
    Miacondizione6 = C-30; endif;
     if T =1210 then
    Miacondizione7 = C+30;endif;
    if T = 1210 then
    Miacondizione8 = C-30; endif;
    if T = 1310 then
    Miacondizione9 = C+30;endif;
    if T = 1310 then
    Miacondizione10 = C-30; endif;
    if T = 1410 then
    Miacondizione11 = C+30;endif;
    if T = 1410 then
    Miacondizione12 = C-30; endif;
     if T =1510 then
    Miacondizione13 = C+30;endif;
    if T = 1510 then
    Miacondizione14 = C-30; endif;
    if T = 1610 then
    Miacondizione15 = C+30;endif;
    if T = 1610 then
    Miacondizione16 = C-30; endif;
    if T = 1710 then
    Miacondizione17 = C+30;endif;
    if T = 1710 then
    Miacondizione18 = C-30; endif;
////////////////////////////////////////////////////////////////////////////////
  if (CompareTime(09, 10, 0) > 0) and (CompareTime(10,09, 0) < 0) then
  if C > Miacondizione1 and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(09, 10, 0) > 0) and (CompareTime(10,09, 0) < 0) then
 if C < Miacondizione2 and c < stop then
    EnterShort(NextBar, AtOpen);
  endif;endif;
   if (CompareTime(10, 10, 0) > 0) and (CompareTime(11,09, 0) < 0) then
  if C > Miacondizione3 and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(10, 10, 0) > 0) and (CompareTime(11, 09, 0) < 0) then
 if C < Miacondizione4 and c < stop then
    EnterShort(NextBar, AtOpen);
  endif;endif;
  
  if (CompareTime(11, 10, 0) > 0) and (CompareTime(12,09, 0) < 0) then
  if (C > Miacondizione5) and c>stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(11, 10, 0) > 0) and (CompareTime(12, 09, 0) < 0) then
 if  (C < Miacondizione6)and c< stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
    if (CompareTime(12, 10, 0) > 0) and (CompareTime(13,09, 0) < 0) then
  if (C > Miacondizione7) and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(12, 10, 0) > 0) and (CompareTime(13, 09, 0) < 0) then
 if  (C < Miacondizione8) and c< stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
     if (CompareTime(13, 10, 0) > 0) and (CompareTime(14,09, 0) < 0) then
  if (C > Miacondizione9) and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(13, 10, 0) > 0) and (CompareTime(14, 09, 0) < 0) then
 if  (C < Miacondizione10) and c < stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
    if (CompareTime(14, 10, 0) > 0) and (CompareTime(15,09, 0) < 0) then
  if (C > Miacondizione11) and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(14, 10, 0) > 0) and (CompareTime(15, 09, 0) < 0) then
 if  (C < Miacondizione12) and c < stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
    if (CompareTime(15, 10, 0) > 0) and (CompareTime(16,09, 0) < 0) then
  if (C > Miacondizione13) and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(15, 10, 0) > 0) and (CompareTime(16, 09, 0) < 0) then
 if  (C < Miacondizione14) and c < stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
     if (CompareTime(16, 10, 0) > 0) and (CompareTime(17,09, 0) < 0) then
  if (C > Miacondizione15)and c>stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(16, 10, 0) > 0) and (CompareTime(17, 09, 0) < 0) then
 if  (C < Miacondizione16) and c<stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
    if (CompareTime(17, 10, 0) > 0) and (CompareTime(17,30, 0) < 0) then
  if (C > Miacondizione17) and c > stop then
    EnterLong(NextBar, AtOpen);
  endif; endif;
 if (CompareTime(17, 10, 0) > 0) and (CompareTime(17, 30, 0) < 0) then
 if  (C < Miacondizione18) and c<stop then
      EnterShort(NextBar, AtOpen);
  endif;endif;
    if C > C[1] then
 STOP = l-20;endif;
 if C >C[1] and c[1]>c[2] then
 STOP = l -40; endif;
 if C > c[1] and c[1]>c[2] and c[2]>c[3] then
 STOP = (l-60);endif;
 if C>C[1] and c[1]>c[2] and c[2]>c[3] and c[3]>c[4] then
 STOP = (l-100); endif;
 if C>C[1] and c[1]>c[2] and c[2]>c[3] and c[3]>c[4]and c[4]>c[5] then
 stop = l-130;endif;
 if C<C[1] and c[1]>c[2] and c[2]>c[3] and c[3]>c[4] then
 stop = l-50 ;endif;
 if C < C[1] then
 STOP = (h+20);endif;
 if C <C[1] and c[1]<c[2] then
 STOP = (h +40); endif;
 if C <c[1] and c[1]<c[2] and c[2]<c[3] then
 Stop  = (h+60);endif;
 if C<C[1] and c[1]<c[2] and c[2]<c[3] and c[3]<c[4] then
 Stop = (h+100); endif;
 if C<C[1] and c[1]<c[2] and c[2]<c[3] and c[3]<c[4]and c[4]<c[5] then
 stop = (H +130); endif;
 if C>C[1] and c[1]<c[2] and c[2]<c[3] and c[3]<c[4] then
 stop = H +50 ; endif;
installtrailingprofit (inperc,1.4,0.1,trailing);
//installstoploss(inperc,0.5) ;
//installtakeprofit(inperc,2);/CODE]