how to Change this afl to weekly mode

#1
Can you tell me how to put this estudy in weekly mode?

When I try it I get the results in daily mode.

I think is very simple but I do not know how to solve it


_SECTION_BEGIN("DISTANCIA A MAXIMOS");


//poner "cap" en otro lugar despues
cap=Volume*Close;

// cap sirve para filtrar smallcaps

Maxi=HHV(Close,52);
distancia1=(maxi-Close[0])/maxi*100;

_SECTION_END();


_SECTION_BEGIN("CAPITAL PROPORCIONAL MEDIO(CPM)");


CPM = Volume * Close;
volmax = HHV(CPM, 52); // 52 days, not week
vol_ = ((CPM * 100)/volmax) * (4/5); // 52 days, not week
volpmed = EMA(vol_, 52);
CPM2 = vol_ - volpmed;

// CPM guarda el promedio de 5 semanas del CPM

CPM2 = (CPM+CPM[1]+CPM[2]+CPM[3]+CPM[4])/5;

IIf(CPM2>0,1,0);

_SECTION_END();






_SECTION_BEGIN("DISTANCIA A mm30");


// mide el riesgo en valor absoluto

wm30 = WMA(Close, 30);

cero = ParamColor("Color", ColorRGB(0,0,0));
distancia = IIf(Close>wm30, (Close-wm30)/Close * 100,
IIf(Close<wm30, (wm30-Close)/Close * 100, 0));

IIf(distancia<9,1,0);
IIf(distancia>2,1,0);

_SECTION_END();

baseprice = Sum((Close/Foreign("^GSPC","Close")),52)/52;
graphmansfield = ((Close/Foreign("^GSPC","Close")/baseprice)-1)*10;
Ligne0 = 0;
IIf(graphmansfield>0.10,1,0);

_SECTION_END();
Buy=IIf(Cap>1000000,1,0);
Buy = IIf(CPM2>0,1,0);
Buy=IIf(distancia1<3,1,0);
Buy=IIf(distancia<9,1,0);
Buy=IIf(distancia>2,1,0);
Buy=IIf(graphmansfield>0.10,1,0);
Sell = IIf(Close<wm30,1,0);
 

Similar threads