[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Filter



PureBytes Links

Trading Reference Links

When I use this afl in an Exploration the Filter does not work. I get
symbols like BVSN which closed at 1.32, and symbols of low volume
stocks like CHFN. Even when I try the filter as Filter = ((C > 5) AND
(VolAvg >= 250000)) AND (... it still does not work. Any suggestions?

Thomas

----------------------------------------------------------------
/* Minimum Price and 14 day Avg Volume Values for Filter */
minPrice = 5;
minVol = 250000;

VolAvg = ma( v, 14 );
VolumeIdx = v / VolAvg;
AvgRange = sum( abs(O-C),15 )/15;

/* Candle Codes */
White = iif((C>O) AND ((C-O)>=0.8*(H-L)),1,0) AND (C-O)>AvgRange;
Black = iif((C<O) AND ((O-C)>=0.8*(H-L)),1,0) AND (O-C)>AvgRange;
Doji  = iif(abs(O-C)<=0.1*(H-L),1,0);

/* Dark Cloud Cover [Bear] */
DCC = iif(ref(White, -1) AND Black AND C<=ref(((H+L)/2),-1)
	AND O>ref(C,-1), 1,0);

/* Piercing Line [Bull] */
PL = iif(ref(Black, -1) AND White AND C>=ref(((H+L)/2),-1)
	AND O<ref(C,-1), 1,0);

/* Evening Doji Star [Bear] */
EDS = iif(ref(White, -2) AND ref(Doji, -1) AND Black AND
	C<=ref(((H+L)/2),-2), 1,0);

/* Morning Doji Star [Bull] */
MDS = iif(ref(Black, -2) AND ref(Doji, -1) AND White AND
	C>=ref(((H+L)/2),-2), 1,0);

/* Hammer [Bull] */
HAM = iif( (H-L > 1.5*AvgRange) AND (C > (H+L)/2)  AND (O > C) AND 
	(VolumeIdx > 2), 1, 0);

/* Bearish Engulfing */
BRE = iif(Black AND ref(White, -1) AND (C < ref(O, -1))  AND (O >
ref(C, -1)), 1,0);

/* Bullish Engulfing */
BLE = iif(White AND ref(Black, -1) AND (C > ref(O,-1))  AND (O <
ref(C,-1)), 1,0);


/* Stochastics 15-3 */

ss = ma(stochk(15),3);
StochBuy = iif(ss<=30, 1, 0);
StochSell = iif(ss>=70, 1, 0);

/* Exploration Columns for Sorting */

NumColumns = 11;

Column0 = C;
Column1 = AvgRange;
Column2 = V;
Column3 = VolumeIdx;
Column4 = PL;
Column5 = MDS;
Column6 = BLE;
Column7 = HAM;
Column8 = BRE;
Column9 = DCC;
Column10 = EDS;

Column0Name = "Close";
Column1Name = "Range";
Column2Name = "Volume"; 
Column3Name = "Vol Indx";
Column4Name = "PCL[up]";
Column5Name = "MDS[up]";
Column6Name = "BLE[up]";
Column7Name = "HAM[up]";
Column8Name = "BRE[dn]";
Column9Name = "DCC[dn]";
Column10Name = "EDS[dn]";

Column0format = 1.2;
Column1format = 1.2;
Column2format = 1.0;
Column3format = 1.2;
Column4format = 1.0;
Column5format = 1.0;
Column6format = 1.0;
Column7format = 1.0;
Column8format = 1.0;
Column9format = 1.0;
Column10format = 1.0;


/* Filter */

Filter = ((C > minPrice) AND (VolAvg >= minVol)) AND (StochBuy AND (PL
or MDS or BLE or HAM)) OR (StochSell AND (BRE or DCC or EDS));


/* Buy and Sell */

Buy = iif((StochBuy > 0) AND (PL + MDS + HAM + BLE > 0), 1, 0);
Sell = iif((StochSell > 0) AND (BRE + DCC + EDS > 0), 1, 0);
---------------------------------------------------------------




------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/