Hacer Scanners en Amibroker es muy sencillo. Solo hay que definir los criterios con la función FILTER y aplicar el EXPLORE. El resultado es una tabla como la siguiente donde todo es configurable:
En el siguiente vídeo se explica el funcionamiento:
CÓDIGO AMIBROKER
//*******************************
// SCREENER
// OSCAR G. CAGIGAS
// 19 NOVIEMBRE 2020
//*******************************
// SCREENER
// OSCAR G. CAGIGAS
// 19 NOVIEMBRE 2020
//*******************************
//DESV ESTÁNDAR
desv_carver = sqrt( EMA( ( C-Ref(C,-1) )^2, 36 ) );
desv_carver1 = Ref(desv_carver,-1); //desviacion de Carver de la barra anterior
//DEFINICIONES
ma50vol = MA(V,50);
ma20 = MA(C,20);
ma200 = MA(C,200);
ma20sube = ma20 > Ref(ma20,-1) AND ma20 > Ref(ma20,-20);
ma200sube = ma200 > Ref(ma200,-1);
cerca20 = abs( C - ma20 ) < desv_carver1;
dip = RSI(2) < 40;
liquid = C > 20 AND MA(V,50) > 10e6;
strong = abs(C - Ref(C,-1)) > desv_carver1;
downdays = Sum(H < Ref(H,-1), 3) == 3 AND Sum(L < Ref(L,-1), 3) == 3;
ma50vol = MA(V,50);
ma20 = MA(C,20);
ma200 = MA(C,200);
ma20sube = ma20 > Ref(ma20,-1) AND ma20 > Ref(ma20,-20);
ma200sube = ma200 > Ref(ma200,-1);
cerca20 = abs( C - ma20 ) < desv_carver1;
dip = RSI(2) < 40;
liquid = C > 20 AND MA(V,50) > 10e6;
strong = abs(C - Ref(C,-1)) > desv_carver1;
downdays = Sum(H < Ref(H,-1), 3) == 3 AND Sum(L < Ref(L,-1), 3) == 3;
//********** STOCKS EN MA20 (OLIVIER VÉLEZ) ************************
setup1 = ma20sube AND ma200sube AND cerca20 AND dip AND downdays;
//******************************************************************
//************** STOCKS ALCISTAS VARIOS DÍAS CAYENDO ***************
setup2 = ma200sube AND dip AND downdays;
//******************************************************************
//************** BLUE CHIPS CON CAÍDAS **************
setup3 = dip AND ma50vol > 5e6 AND ma200sube;
//***************************************************
//####### SETUP A SCANEAR #####################
choice = StrToNum( ParamList("setup","1|2|3",0) );
setup = IIf(choice == 1, setup1, IIf(choice == 2, setup2, IIf(choice == 3, setup3, setup1) ) );
//#############################################
//PARTE GRÁFICA
color = IIf(setup, colorBlue, colorLightBlue );
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", color, styleBar| styleThick,Null,Null,0,0,2);
Title = Title + "\n" + "Desv = " + WriteVal(Desv_carver1)
+ "\n" + "Vol = " + WriteVal(ma50vol/1e6,1.2) + "M";
//PINTAR LAS MEDIAS
Plot(MA(C,20),"MA20",colorBlue,styleThick);
Plot(MA(C,200),"MA200",colorRed,styleThick);
//FILTRO
Filter = Status( "lastbarinrange" ) AND setup;
AddTextColumn(FullName(),"Name");
AddTextColumn(WriteIf(setup, "LARGO",""),"OPERAC",1.0,color,colorDefault);
AddColumn(ma50vol/1e6,"Vol(M)",1.2);
SetSortColumns(-5);
No hay comentarios:
Publicar un comentario