viernes, 1 de febrero de 2019

codice Ts contatore minimi e massimi 1ª ora  (0900--1000)

////////////////////////////////// Totalmax-Totalmin/////////////////////////////////////11-07-2009

Var: rangegiorno,meseprec,idlastop;
var: TimeIni(0900), TimeFine(1000);
var: miomax1, miomin1, mydatemin, mytimemin, mydate, mytime,dayspassati, volteMaxInterv, ivp,idmin1,idmax1,op1,ivp2,ivp3,ivp4, volteMinInterv;
var: TimeIni1(1630), TimeFine1(1730);
var: miomax11, miomin11, mydatemin1, mytimemin1, mydate1, mytime1,dayspassati1, volteMaxInterv1, ivp,idmin11,idmax11,op1,ivp2,ivp3,ivp4, volteMinInterv1,meseprec1;
var: totalmin,totalmax,vp1,vp2,vp3,vp4;


rangegiorno=(((highd(1)-lowd(1))/lowd(1))*100);

////////////////////////////////Conteggio Max&Min prima ora///////////////////////////////////////////////////////////////////
if IsFirstBarDay then  // Primo Giorno
   if ((mytime >= TimeIni) and (mytime <= TimeFine)) {and lowd>lowd(1)}{and openday<lowd(1)} then
      volteMaxInterv = volteMaxInterv + 1;//1;
      idmin1 = DrawHLinePer (idmin1, 0, mydate, miomax1, 10, red, 1, 0);
   endif;

   if ((mytimemin >= TimeIni) and (mytimemin <= TimeFine)){and highd<highd(1)}{and openday>highd(1)} then
      volteMinInterv = volteMinInterv + 1;// 1;
      idmax1 = DrawHLinePer (idmax1, 0, mydatemin, miomin1, 10, green, 1, 0);
   endif;
endif;

if IsFirstBarDay then  // Primo Giorno
   miomax1 = 0; // azzera
   miomin1 = 10000000; // azzera
   dayspassati = dayspassati + 1;
   idmin1 = createogg;
   idmax1 = createogg;
endif;

if H > miomax1 then
   miomax1 = H;  // imposto il nuovo massimo
   mydate = D;
   mytime = T;
endif;

if L < miomin1 then
   miomin1 = L;  // imposto il nuovo massimo
   mydatemin = D;
   mytimemin = T;
endif;


if getmonth<>meseprec then volteMinInterv=0;endif;  /////////////////////////////
if getmonth<>meseprec then volteMaxInterv=0;endif;
meseprec=getmonth;

///////////////////////////////////////////////////////////////////////////////
////////////////////////////////Conteggio Max&Min ultima ora///////////////////////////////////////////////////////////////////
if IsFirstBarDay then  // Primo Giorno
   if ((mytime1 >= TimeIni1) and (mytime <= TimeFine1)) {and highd>highd(1)} then
      volteMaxInterv1 = volteMaxInterv1 + 1  ;//1;
      idmin11 = DrawHLinePer (idmin11, 0, mydate1, miomax11, 10, green, 1, 0);
   endif;

   if ((mytimemin1 >= TimeIni1) and (mytimemin1 <= TimeFine1)){and lowd<lowd(1)} then
      volteMinInterv1 = volteMinInterv1 + 1  ;//1;
      idmax11 = DrawHLinePer (idmax11, 0, mydatemin1, miomin11, 10, red, 1, 0);
   endif;
endif;

if IsFirstBarDay then  // Primo Giorno
   miomax11 = 0; // azzera
   miomin11 = 10000000; // azzera
   dayspassati1 = dayspassati1 + 1;
   idmin11 = createogg;
   idmax11 = createogg;
endif;

if H > miomax11 then
   miomax11 = H;  // imposto il nuovo massimo
   mydate1 = D;
   mytime1 = T;
endif;

if L < miomin11 then
   miomin11 = L;  // imposto il nuovo massimo
   mydatemin1 = D;
   mytimemin1 = T;
endif;



if getmonth<>meseprec1 then volteMinInterv1=0;endif;  /////////////////////////////
if getmonth<>meseprec1 then volteMaxInterv1=0;endif;
meseprec1=getmonth;
totalmin=op(voltemininterv,voltemaxinterv1,add);
totalmax=op(voltemaxinterv,voltemininterv1,add);



/////////////////////////////////________________Plottaggi______________////////////////////////////////////////////////////

vp1 = Createviewport(150);
plotchart(rangegiorno, vp1, red, solid, 3);

vp2 = Createviewport(450);
plotchart(volteMinInterv, vp2, green, solid, 3);
plotchart(volteMaxInterv, vp2, red, solid, 3);

1 comentario:

 era dal 26 marzo che i sistemi non si posizionavano long...oggi lo han fatto...area 21.90 posizionano il 1º take profit