anant bhai,
i have develped this expl afl, can u try it and help to remove the short comings?
_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 15, 2, 200, 1 );
r2 = Param( "Slow avg", 30, 2, 200, 1 );
r3 = Param( "Signal avg", 12, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);
periods = Param( "Periods", 25, 1, 200, 1 );
Ksmooth = Param( "%K avg", 5, 1, 200, 1 );
Dsmooth = Param( "%D avg", 5, 1, 200, 1 );
Volume_1=Param("V",20,1,100,1);
TP1 = Param("TP1",20,1,100,1);
TP2 = Param("TP2",80,1,100,1);
A1 = StochK( periods , Ksmooth) - StochD( periods , Ksmooth, DSmooth );
A2 = StochD( periods , Ksmooth, DSmooth ) - StochK( periods , Ksmooth);
Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));
Cond2 = A1>0;
Cond3 = StochK( periods , Ksmooth)>TP1;
Cond7 = Zig(C,z)>Ref(Zig(C,z),-1);
Cond9 = V>Ref(V*(1+(Volume_1/100)),-1);
Cond11 = Ref(StochK( periods , Ksmooth),-2)<TP1;
Buy = Cond1 AND Cond2 AND Cond3 AND Cond7 AND Cond9 AND Cond11;
Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));
Cond5 = A2>0;
Cond6 = StochK( periods , Ksmooth)<TP2;
Cond8 = Zig(C,z)<Ref(Zig(C,z),-2);
Cond10 = V>Ref(V*(1+(Volume_1/100)),-1);
Cond12 = Ref(StochK( periods , Ksmooth),-2)>TP2;
Sell = Cond4 AND Cond5 AND Cond6 AND Cond8 AND Cond10 AND Cond12;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");
_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V));
BG = IIf(Buy, colorPaleGreen, IIf(Sell, colorPink, colorDefault));
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault));
Filter = Buy OR Sell;
AlertIf(Buy, "SOUND C:\\Windows\\Media\\Siren.wav", "Buy",1,1,100 );
AlertIf(Sell, "SOUND C:\\Windows\\Media\\SOUND4.wav", "Sell",2,1,100);
SetOption("NoDefaultColumns", True);
AddTextColumn(Name(), "Symbol", 77, FG, BG, 120);
AddColumn(DateTime(), "Date", formatDateTime, FG, BG, 100);
AddColumn(TimeNum() ,"Time",1, FG, BG, 100);
AddColumn(V/Ref(V,-1)*100,"Increase in Vol",1, FG, BG, 100);
AddColumn( C, "Close",0, FG, BG, 100);
AddColumn( H, "High", 0, FG, BG, 100);
AddColumn(V, "Volume",1, FG, BG, 100);
AddColumn(Ref(V,-1),"P-Vol",1, FG, BG, 100);
AddColumn( Buy, "Buy", 1);
AddColumn( Sell, "Sell", 1);
_SECTION_END();