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

[amibroker] Building AFL modules



PureBytes Links

Trading Reference Links

Having used Visual Studio and all kinds of visual DHTML editors 
throughout the years, I build all my AFL modularly. This saves me a 
lot of code writing time. Unfortunately, AB doesn't harness the power 
of modular objects as much as it could (you can use includes, but you 
can't nest your includes, which requires much more code-writing).

In the meantime, I may post some modularized code from time to time 
for the archives.

Here's an include I use as an exploration add-on at the bottom of my 
scan templates. It checks for sychronicity amongst various 
indicators, and applies a percentage strength number to a buy or sell 
signal. This way, you can prioritize by % strength different buys or 
shorts that come up in your scans, rather than having to look at all 
of them equally right off the bat. You'll have to build your own 
modules to handle the various signals this is testing for...(IFT_eb, 
and so on)...

The Code:

/* Explore_Entry_Strength_v1.0 */
/// EXPLORATION FIELD OUTPUT ///
// Signal Type Column
VarBSSignal = IIf(Buy,1,
IIf(Short,0,10));
AddColumn( VarBSSignal, "Signal",1.0, IIf(VarBSSignal>0,colorGreen,
IIf(VarBSSignal<1,colorRed,colorBlack)));

// EXPLORATION BUY SUMMATION COLUMN
IFT_eb = IIf(varIFTBuy1,1,0);
IFTS_eb = IIf(varIFTSBuy4,1,0);
TDREI_eb = IIf(varREIBuy3,1,0);
FVE_eb = IIf(VarFVEBuy3,1,0);
KST_eb = IIf(varKSTBuy5,1,0);
HDC_eb = IIf(varHDCBuy1,1,0);
HDC2_eb = IIf(VarHDCBuy4,1,0);
SStoch_eb = IIf(VarSStochBuy1,1,0);
AvgStoch_eb = IIf(varAvgStochBuy1,1,0);
DSS_eb = IIf(varDSSBuy2,1,0);
IFTROC1_eb = IIf(fishtdroc1<-0.20,1,0);
IFTTDD_eb = IIf(fishTD<varIFTTDDOverSold,1,0);
Buy_Perc = ( (IFT_eb + IFTS_eb + TDREI_eb + FVE_eb + 
KST_eb + HDC_eb + HDC2_eb + SStoch_eb + AvgStoch_eb + 
DSS_eb + IFTROC1_eb + IFTTDD_eb)/12)*100;
AddColumn( Buy_Perc, "Buy%",1.0, IIf(Buy_Perc>49,colorGreen,
colorBlack));

// EXPLORATION SHORT SUMMATION COLUMN
IFT_es = IIf(varIFTShort1,1,0);
IFTS_es = IIf(varIFTSShort4,1,0);
TDREI_es = IIf(varREIShort3,1,0);
FVE_es = IIf(VarFVEShort3,1,0);
KST_es = IIf(varKSTShort5,1,0);
HDC_es = IIf(varHDCShort1,1,0);
HDC2_es = IIf(VarHDCShort4,1,0);
SStoch_es = IIf(VarSStochShort1,1,0);
AvgStoch_es = IIf(varAvgStochShort1,1,0);
DSS_es = IIf(varDSSShort2,1,0);
IFTROC1_es = IIf(fishtdroc1>0.20,1,0);
IFTTDD_es = IIf(fishTD>varIFTTDDOverbought,1,0);
Short_Perc = ( (IFT_es + IFTS_es + TDREI_es + FVE_es + 
KST_es + HDC_es + HDC2_es + SStoch_es + AvgStoch_es +
DSS_es + IFTROC1_es + IFTTDD_es)/12)*100;
AddColumn( Short_Perc, "Short%",1.0, IIf(Short_Perc>49,colorRed,
colorBlack));

// Standard Columns
AddColumn( Close, "Close  " );
AddColumn( Volume, "Volume   ",1.0 );
AddColumn( Open, "Open  " );
AddColumn( High, "High  " );
AddColumn( Low, "Low  " );





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/