// DIX-scan.afl - Disparity Index Scan in Amibroker 4.9
// Scan to list DIX(200), DIX(50) and DIX(20)
// ‘use filter’ = Nasdaq 100 stock universe
// ‘range’ = n last days with n=1
// Copyright 2009 Dan Valcu
//The disparity index is a simple and efficient oscillator indicator. It represents the percentage that
//the closing price deviates above or below from a chosen average. Its main purpose is capital preservation
//(reduced and controlled risk plus profits locked in).
Buy=1;
//Filter = 1; /* all symbols and quotes accepted
// Compute DIX(200)
nper1 = 200;
dix200=100*(C-EMA(C,nper1))/C;
// Compute DIX(50)
nper2 = 50;
dix50=100*(C-EMA(C,nper2))/C;
// Compute DIX(20)
nper3 = 20;
dix20=100*(C-EMA(C,nper3))/C;
Filter = dix200<1.01 AND dix200>-1.01;//less then %1 and more then -%1
Col2 = dix200;
Col3 = dix50;
Col4 = dix20;
SetOption("NoDefaultColumns", True );
AddTextColumn(Name(), "Ticker", 5 , colorDefault, colorDefault);
AddColumn(Close,"Close",1.2);
AddColumn(Col2,"DIX(200)",1.2);
AddColumn(Col3,"DIX(50)",1.2);
AddColumn(Col4,"DIX(20)",1.2);
AddTextColumn(Name(), "Ticker", 5 , colorDefault, colorDefault);