The Excel sheet for the required chart for this method can be downloaded from here --->
Excel Sheet
@hmp, if you are referring to the AFL which generated signals in amibroker chart posted few post before, then this is the code for the same:
But remember, i dont take trade only based on this buy/sell signal for ami all the time. Some signals/trades might be ignored due to obvious reason in the system. But yes, almost 75% of the time, this AFL holds good.
Excel Sheet
@hmp, if you are referring to the AFL which generated signals in amibroker chart posted few post before, then this is the code for the same:
But remember, i dont take trade only based on this buy/sell signal for ami all the time. Some signals/trades might be ignored due to obvious reason in the system. But yes, almost 75% of the time, this AFL holds good.
Code:
pds1 = 15; /*Periods */
slw1 = 9; /*Slowing for Full Stoch%K*/
slwd1 = 1; /*Slowing for Full Stoch%D*/
pds2 = 21; /*Periods */
slw2 = 1; /*Slowing for Full Stoch%K*/
slwd2 = 1; /*Slowing for Full Stoch%D*/
pds3 = 8; /*Periods */
slw3 = 1; /*Slowing for Full Stoch%K*/
slwd3 = 1; /*Slowing for Full Stoch%D*/
pds4 = 15; /*Periods */
slw4 = 3; /*Slowing for Full Stoch%K*/
slwd4 = 1; /*Slowing for Full Stoch%D*/
FSK1 = 100*(C-LLV(L,pds1))/(HHV(H,pds1)-LLV(L,pds1)); // FASTSTOCHK
FLSK1 = MA( FSK1, slw1 ); // FULLSTOCHK
FLSD1 = MA( FLSK1, slwd1 ); // FULLSTOCHD
FSK2 = 100*(C-LLV(L,pds2))/(HHV(H,pds2)-LLV(L,pds2)); // FASTSTOCHK
FLSK2 = MA( FSK2, slw2 ); // FULLSTOCHK
FLSD2 = MA( FLSK2, slwd2 ); // FULLSTOCHD
FSK3 = 100*(C-LLV(L,pds3))/(HHV(H,pds3)-LLV(L,pds3)); // FASTSTOCHK
FLSK3 = MA( FSK3, slw3 ); // FULLSTOCHK
FLSD3 = MA( FLSK3, slwd3 ); // FULLSTOCHD
FSK4 = 100*(C-LLV(L,pds4))/(HHV(H,pds4)-LLV(L,pds4)); // FASTSTOCHK
FLSK4 = MA( FSK4, slw4 ); // FULLSTOCHK
FLSD4 = MA( FLSK4, slwd4 ); // FULLSTOCHD
sst = FLSD1;
fst = FLSK2;
fst2 = FLSK3;
compstoch1531 = FLSK4;
MaxGraph = 5;
Graph0 = FLSD1;
Graph0Color = 4;
Graph1 = FLSD2;
Graph1Color = 6;
Graph2 = FLSD3;
Graph2Color = 19;
Graph0Style = Graph1Style = Graph2Style = 1;
Graph0Name = "(15,9,1)";
Graph1Name = "(21,1,1)";
Graph2Name = "(8,1,1)";
Ob=80;
Os=20;
Graph3 = Ob;
Graph4 = Os;
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} {{VALUES}}"));
/*Title = Name()+" "+FullName()+
" FastStoch%K=Yellow FullStoch%K = Blue FullStoch%D = Dark Grey";
*/
when_fast_go_above_slow = (fst > sst); /* fast_stoch(21,1,1) is above the slow_stoch(15,9,1) */
when_fast_go_below_slow = (fst < sst); /* fast_stoch(21,1,1) is below the slow_stoch(15,9,1) */
PositionSize = MarginDeposit = 1; /* to trade one contract only */
PointValue = 50; /* lot size per contract */
slowstoch_cur_gt_prev = ( sst > Ref(sst,-1) );
slowstoch_cur_lt_prev = ( sst < Ref(sst,-1) );
faststoch_cur_gt_prev = ( fst > Ref(fst,-1) );
faststoch_cur_lt_prev = ( fst < Ref(fst,-1) );
compstoch1531_cur_gt_prev = ( compstoch1531 > Ref(compstoch1531,-1) );
compstoch1531_cur_lt_prev = ( compstoch1531 < Ref(compstoch1531,-1) );
faststoch_2_cont_high = ( (fst > Ref(fst,-1)) AND (Ref(fst,-1) > Ref(fst,-2)) );
faststoch_2_cont_low = ( (fst < Ref(fst,-1)) AND (Ref(fst,-1) < Ref(fst,-2)) );
faststoch2_2_cont_high = ( (fst2 > Ref(fst2,-1)) AND (Ref(fst2,-1) > Ref(fst2,-2)) );
faststoch2_2_cont_low = ( (fst2 < Ref(fst2,-1)) AND (Ref(fst2,-1) < Ref(fst2,-2)) );
Buy = faststoch2_2_cont_high AND (fst2 > 20) AND (fst > 20) AND (compstoch1531>16);
Sell = faststoch2_2_cont_low AND (fst2 < 80) AND (fst < 80) AND (compstoch1531<84);
Short = faststoch2_2_cont_low AND (fst2 < 80) AND (fst < 80) AND (compstoch1531<84);
Cover = faststoch2_2_cont_high AND (fst2 > 20) AND (fst > 20) AND (compstoch1531>16);