// Downloaded From https://www.WiseStockTrader.com /* Bill Wiliams (Alligator).afl Submitted by TimOn76, Russian comments translated to English. Strategy buggy, but a good map (Chart) of Bill (Williams Alligator) .... My trading strategy is "TREND" Editor: I wanted to keep the Russian text side by side, but my ASCII editor did not work. Sorry. */ Title=""; GraphXSpace =10; _SECTION_BEGIN("Price"); _N(Title = StrFormat("{{INTERVAL}} {{DATE}} (%.2f%%) O = %g, H = %g, L = %g, C = %g V = " +WriteVal( V, 1.0 ) +" {{VALUES}}",SelectedValue( ROC( C, 1 )), O, H, L, C )); _SECTION_END(); /* ------------------------------------------- Data optimization and constant --------------------*/ //The new data /* -------------------------------------------- Indicators by Bill Williams ----------------------*/ A=(H+L)/2; var1=Wilders(A,34); var2=Wilders(A,5); var3=var2-var1; var4=var3-Wilders(var3,5); Var5=(H-L)/V; AO=Var3; AC=Var4; AlligatorBlue=Ref(Wilders(A,13),-8); AlligatorRed=Ref(Wilders(A,8),-5); AlligatorGreen=Ref(Wilders(A,5),-3); /* ------------------------------------------ Graphs ---------------------------------------------*/ /* Coloring bars */ barcolor=IIf(AO>Ref(AO,-1) AND AC>Ref(AC,-1),colorGreen,IIf(AO0 AND Var5Ref(V,-1),colorBlue,colorBlack))); Plot(C,"Close",barcolor,64+styleNoTitle ); Plot(AlligatorBlue,"Jaw",colorBlue,1+4+styleNoTitle ); Plot(AlligatorRed,"Language (Teeth)",colorRed,1+4+styleNoTitle ); Plot(AlligatorGreen,"Lips",colorLime ,1+4+styleNoTitle ); /* -------------------------------------------- fractals ----------------------------------------*/ // Fractal "UP" FrUp1= (Ref(H,-3)>Ref(H, -2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>Ref(H, -4) AND Ref(H,-3)>Ref(H,-5)); FrUp2= (Ref(H,-4)>Ref(H,-5) AND Ref(H,-4)>Ref(H,-6) AND Ref(H,-4)==Ref(H,-3) AND Ref(H,-4)>Ref(H,-2) AND Ref(H,-4)>Ref(H,-1)) OR (Ref(H,-4)>Ref(H,-5) AND Ref(H,-4)>Ref(H,-6) AND Ref(H,-4)>Ref(H,-3) AND Ref(H,-4)==Ref(H,-2) AND Ref(H,-3)>Ref(H,-1)); FrUp3= (Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)==Ref(H,-4) AND Ref(H,-5)==Ref(H,-3) AND Ref(H,-5)>Ref(H,-2) AND Ref(H,-5)>Ref(H,-1)) OR (Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)==Ref(H,-4) AND Ref(H,-5)>Ref(H,-3) AND Ref(H,-5)==Ref(H,-2) AND Ref(H,-5)>Ref(H,-1)) OR (Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)>Ref(H,-4) AND Ref(H,-5)==Ref(H,-3) AND Ref(H,-5)==Ref(H,-2) AND Ref(H,-5)>Ref(H,-1)); ttt=IIf(FrUp1,3,IIf(FrUp2,4,5)); FrUp_Val=ValueWhen(FrUp1 OR FrUp2 OR FrUp3,Ref(H,-ttt),1); Plot(FrUp_Val,"FrUp",colorDarkGreen,512+8); // Fractal "DOWN" FrDw1= (Ref(L,-3)AlligatorBlue AND C>AlligatorRed AND C>AlligatorGreen); red_zone=(CRef(AO,-1) AND AC>Ref(AC,-1) AND Ref(AC,-1)>Ref(AC,-2); TWR_RED=AO0 AND AORef(AC,-1); TWR_GRAY_SELL=AO<0 AND AO>Ref(AO,-1) AND ACFrUp_Val AND FrUp_Val>Ref(AlligatorRed,-ttt); Sg_Buy=Sg_Buy_Cross_FrUp AND GOOD_LONG_ZONE; Buy=(C>FrUp_Val AND C>AlligatorRed) AND AC>0; Sell=CFrUp_Val OR C>AlligatorRed; Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short); PlotShapes( shapeUpArrow * Buy + shapeHollowDownArrow *Short, IIf( Buy, colorGreen, colorRed ),0,IIf(Buy,Low,High)); PlotShapes( shapeDownArrow*Sell + shapeHollowUpArrow*Cover, IIf( Cover, colorGreen, colorRed ),0,IIf(Cover,Low-C/2000,High+C/2000)); /* End of Exploration Code. */ /* My trading strategy is "TREND" */