Amibroker - AFL Examples

Swing Trading AFL Posted by newbie: Please help in correcting it

I have posted an AFL of SH's 315 Swing Trading Strategy. Strategy seems to work well & is reasonably profitable. I have checked it myself & now am trying to code it with help from a friend from another forum.

However, ir does not seem to be working correctly. Trading Strategy Rules are in the start of the thread itself and my post with the AFL is in the thread on this page here.

Please help making it work.

With Regards.
Sanjay.
 
NEED TO BUILD UP AN EXPLORATION WHICH CAN GIVE BUY & SELL SIGNALS WHEN IMPLEMENTED ON EOD CHARTS WITH THIS FOLLOWING AFL :



//user parameters
parmUpColor =ParamColor( "MRange Color Up", ColorRGB(167, 224, 243) );
parmDwnColor =ParamColor( "MRange Color Dn", ColorRGB(255, 192, 203) );
parmRibbon = ParamToggle("PLot as ribbon", "No|Yes");
parmRibbonSize = Param("Ribbon Size", 1 , 0.5, 10, 0.5);

//KP indicators
tightstop = E_TSKPTIGHTSTOP(High,Low,Close);
stopline = E_TSKPSTOPLINE(High,Low,Close);

mp = 0.5 * (High + Low);

//calculation
MRangeColor = IIf(mp > StopLine AND mp > tightstop, parmupColor, IIf(mp < stopline AND mp < tightstop, parmDwnColor, colorWhite) );
//plot
if(parmRibbon == 0)
{
Plot( 0, "MRange0", MRangeColor, styleNoDraw );
Plot( 1, "MRange1", MrangeColor, styleNoLabel + styleArea + styleHistogram );
}
else
Plot( parmRibbonSize, "MRange", MRangeColor, styleArea | styleNoLabel | styleOwnScale , 0, 10);



WILL BE REALLY THANKFULL IF ANYONE CAN MAKE AN EXPLORATION OF THIS AFL...MY MAIL ID IS : [email protected]
 
Hi,
I am attaching file contains afl.

Regards
Jwalant.

Link:h**p:// rapidshare (dot) com / files / 198268833 / afl.rar

PS: Remove space and replace (dot) with (.) and (*) with (t)
 
dear saji,
i have formulated afl for overlaying relevent indices data over their codes.i.e.
{
if (MarketID(0)==3)PlotForeign("S&P CNX Nifty","nifty",colorGold,styleOwnScale|styleThick);
if (MarketID(0)==1)PlotForeign("900010","sensex",colorGold,styleOwnScale|styleThick);
//plot nifty over nifty indices & sensex over bse indices
if (MarketID(0)==5)PlotForeign("S&P CNX Nifty","nifty",colorGold,styleOwnScale|styleThick);
if (MarketID(0)==4)PlotForeign("900010","sensex",colorGold,styleOwnScale|styleThick);
//plot imp indices on nifty & sensex
//if ((Name()=="900010")PlotForeign("900015","midcap",colorViolet,styleOwnScale|styleThick);
//if ((Name()=="sensex")PlotForeign("900016","smallcap",colorBrown,styleOwnScale|styleThick);


//plot nifty & sensex in world charts
if (MarketID(0)==0)PlotForeign("900010","sensex",colorGold,styleOwnScale|styleThick);
if (MarketID(0)==0)PlotForeign("S&P CNX Nifty","nifty",colorViolet,styleOwnScale|styleThick);
//plot sectoral indices over nse stock
if (SectorID(0)==2)PlotForeign("900027","AUTO",colorViolet,styleOwnScale|styleThick);
if (SectorID(0)==3)PlotForeign("900026","BANK",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="IT")PlotForeign("900018","IT",colorViolet,styleOwnScale|styleThick);
if (SectorID(0)==12)PlotForeign("900028","METAL",colorViolet,styleOwnScale|styleThick);
if (SectorID(0)==13)PlotForeign("900029","OIL&GAS",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="PHARMA")PlotForeign("900022","HEALTH",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="CONSUMER GOODS")PlotForeign("900020","CGS",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="PHARMA")PlotForeign("900022","HEALTH",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="AGRI")PlotForeign("~AGRI","AGRI",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="CEMENT")PlotForeign("~CEMENT","CEMENT",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="CHEMICAL")PlotForeign("~CHEMICAL","CHEMICAL",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="CONSTRUCTION")PlotForeign("~CONSTRUCTION","CONSTRUCTION",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="DIVERSIFIED")PlotForeign("~DIVERSIFIED","DIVERSIFIED",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="ENGINEERING")PlotForeign("~ENGINEERING","ENGINEERING",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="POWER")PlotForeign("~POWER","POWER",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="SERVICES")PlotForeign("~SERVICES","SERVICES",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="TELECOM")PlotForeign("~TELECOM","TELECOM",colorViolet,styleOwnScale|styleThick);
if (SectorID(1)=="TEXTILES")PlotForeign("~TEXTILES","TEXTILE",colorViolet,styleOwnScale|styleThick);
}
problem is that i want to overlay midcap & small cap indices over nifty & sensex only .issue is that i can not get return value of symobl name in the function. plz, guide me how to get symbol name in the function to compare.
i tried to code that with name() but it does not return name.
hlp, plz.
rajneesh
 
"Now i have finally settled down 1-2chart pages and maximum 3 indicators for generating buy or sell signals. I had used NSE data from 1995 to check it out by visualising manually on various scrips of different price ranges and in different market conditions. I did not use back test. I prefer visualisation method. It is strenous in the begining but patterns that emerge are highly reliable and profitable."

thank you for ur effort n suggestion but kindly can u explain wat is visualisation method
and back test method?
 

Similar threads