Need AFL for Stochastic...Experts Please help..

asnavale

Well-Known Member
#41
Anant bhai,
I hav tried this.
But how will it distinguish croosing 20 dwnside and again crossing 20 while going up viz-a ziz for 80
I tried this

For BUY Cond3 = StochK( periods , Ksmooth)>20;

and

SELL Cond6 = StochK( periods , Ksmooth)<80;


but the problem remains distinguishing the cross over from up side to downside.
can u guide
Hi pkg,

The staement Cross(SK, 20) means, SK goes above 20. Obviously, before cross-over, SK was in the region below 20 and now has gone above it.

Similarly, Cross(80, SK) means SK goes below 80. Therefore, before cross-over SK was above 80.

This is what you need.

In general, Cross(X, Y) means X crosses over Y from below to above. Therefore, it also means Y crosses over X from above to below.

-Anant
 
#43
Anant bhai,
I hav tried this.
But how will it distinguish croosing 20 dwnside and again crossing 20 while going up viz-a ziz for 80
I tried this

For BUY Cond3 = StochK( periods , Ksmooth)>20;

and

SELL Cond6 = StochK( periods , Ksmooth)<80;


but the problem remains distinguishing the cross over from up side to downside.
can u guide
Buy = Cross( StochK( 15, 3),StochD( 15, 3, 3 ))
AND StochK( 15, 3 ) < 30;
Sell = Cross( StochD( 15, 3, 3 ),StochK( 15, 3 ))
AND StochK( 15, 3 ) > 70;

try this, i think it should b wat u want
 

asnavale

Well-Known Member
#45
Is there any syntax which the makes column of Expl results autofit to the content?
Exploration Column contents do not autofit. The column autofits according to the width of the column title.

-Anant
 

pkgmtnl

Well-Known Member
#46
Exploration Column contents do not autofit. The column autofits according to the width of the column title.

-Anant
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();
 
#47
hi balaj ji...i have tried ur formula it shows the line( black clour line) but doesnot show any buy-sell signals......does we need to make any settings in parameters or somehwree else.....plz help....also if anybody know how to use automatic analysis for intraday plz give instructions.......thanks in advance
 

itzarvind

Well-Known Member
#48
Anant,

The crossover in the oversold or overbought region makes good sense.

That needs to be added into the Existing AFL, Please help me in that.

Regards,
Arvind


Hello Sunny,

Just Cross-Over of K & D will not be effective, Where they cross-over is important. What Arvind asked was just cross-overs. If a condition like cross-over at levels above 80 or below 20 may be more useful. For this we have to modify the AFL to include additional conditions. This is one of the Fine-tuning aspects which Arvind refers above.

-Anant
Anant,

We were talking about fine tuning the AFL,

Just the crossover is not correct to consider as a signal, Its important where it is happening,

Sell crossover happens in the overbought region and buy crossover happens at oversold region. Is this correct?

Any other parameters to look into.

Kindly guide us...

Regards,
Arvind
 

itzarvind

Well-Known Member
#49
Anant,

Waiting for the new AFL,

Buy crossover below 20 triggers the buy and sell crossover above 80 triggers sell.

Kindly help me Anant sir

Awaiting your reply..

Regards,
Arvind
 

Similar threads