// Downloaded From https://www.WiseStockTrader.com _SECTION_BEGIN("Red Buy Green Sell"); GraphXSpace=8; P1 = Param( "MA01 Period", 5, 2, 200 ); P2 = Param( "MA02 Period", 10, 2, 200 ); MA01=MA(C,P1 ); MA02=MA(C,P2 ); RG=IIf(MA01>MA02,MA01-MA02,-(MA02-MA01)); PlotOHLC( MA02,RG+MA02,MA02,RG+MA02,"",23, styleCandle+4096); Plot( SelectedValue(C), "",IIf(SelectedValue(MA01)>SelectedValue(MA02),4,34),styleNoLine); Title = EncodeColor(44)+Name() +" ( "+Interval(2)+" ) "+EncodeColor(41 )+WriteVal( DateTime(), formatDateTime); _SECTION_END();_SECTION_BEGIN("KPL Swing"); //Copyright Kamalesh Langote. Email:kpl@vfmdirect.com. More details at http://www.vfmdirect.com/kplswing //Save indicator as "kplswing.afl" in C: program files > Amibroker > Formulas > Custom folder and then drap and drop on price chart no=Param( "Swing", 20, 1, 55 ); tsl_col=ParamColor( "Color", colorCycle ); res=HHV(H,no); sup=LLV(L,no); avd=IIf(C>Ref(res,-1),1,IIf(C p ); SS = ( C < P ); //Plot Plot ( p , "PIVOT", 25, 4 );PlotText( "PIVOT" , BarCount-25, p+0, 25 ); Plot ( r1, "PRE_LOW", 29, 4 );PlotText( "PreDay LOW" , BarCount-25, r1+0, 29 ); Plot ( s1, "PRE_HIGH", 29, 4 );PlotText( "PreDay HIGH" , BarCount-25, s1+0, 29 ); Plot ( s2, "DAY_HIGH", 42, 4 );PlotText( "Day HIGH" , BarCount-25, s2+0, 42 ); Plot ( r2, "DAY_LOW", 42, 4 );PlotText( "Day LOW" , BarCount-25, r2+0, 42 ); GfxSetBkColor( colorRed ); GfxSetTextColor( 41 ); GfxSelectFont( "TOHMA", 9, 700, False ); GfxSetBkColor( colorLightGrey ); GfxSetTextColor( 16 ); GfxTextOut("* "+ ( WriteVal( H1 ) + "--" + WriteVal( L1 ) + "=PreDay=" + WriteVal( D1 ) ), 32, 100 ); GfxTextOut("* "+ ( WriteVal( H2 ) + "--" + WriteVal( L2 ) + "=ToDay=" + WriteVal( D2 ) ), 32, 115 ); GfxTextOut( "F1=" + ( WriteVal( F1 ) ), 32, 130 ); GfxTextOut( "F2=" + ( WriteVal( F2 ) ), 32, 145 ); GfxTextOut( "F3=" + ( WriteVal( F3 ) ), 32, 160 ); GfxTextOut( "Selected FC==" + ( WriteVal( F4 ) ), 32, 175 ); GfxTextOut( ( "-P-TGT 0.65 and STP-LS 1.0(Inc-Bkrg)-" ), 32, 190 ); Filter = S OR SS; AddColumn( IIf( S, 66, 1 ), "Buy", formatChar, 1, bkcolor = IIf( S, 43, 33 ) ); AddColumn( IIf( SS, 83, 1 ), "Sell", formatChar, 1, bkcolor = IIf( SS, 25, 32 ) ); AddColumn( C, "CMP", 1.2, colorDefault, colorLightBlue ); AddColumn( BP, "BUY PRICE", 1.2, colorDefault, colorGreen ); AddColumn( BPTGT, "TGT PRICE", 1.2, colorDefault, colorBrown ); AddColumn( BPSTPLS, "STPLS BUY", 1.2, colorDefault, colorRed ); AddColumn( p, "PIVOT", 1.2, colorDefault, colorYellow ); AddColumn( SPSTPLS, "STPLS SELL", 1.2, colorDefault, colorRed ); AddColumn( SP, "SELL PRICE", 1.2, colorDefault, colorGreen ); AddColumn( SPTGT, "TGT PRICE", 1.2, colorDefault, colorBrown ); AddColumn( H1, "PRE-HIGH" ); AddColumn( L1, "PRE-LOW" ); AddColumn( D1, "PRE-DIFF" ); AddColumn( F1, "0.433" ); AddColumn( F2, "0.766" ); AddColumn( F3, "1.35" ); AddColumn( H2, "D-HIGH" ); AddColumn( L2, "D-LOW" ); AddColumn( D2, "D-DIFF" ); AddColumn( F4, "SELECT FACT" ); Buy = Cross ( ( C ), ( BP ) ); Sell = Cross ( ( C ), ( SP ) ); AlertIf( Buy, "SOUND C:\\Windows\\Media\\Ding.wav", "2652 System", 1, 2 ); AlertIf( Sell, "SOUND C:\\Windows\\Media\\Chime.wav", "2652 System", 2, 2 ); _SECTION_END(); _SECTION_BEGIN("Show Values at H&L"); n=Param("Values back",20,1,200,1); p=Param("zig %",5,1,100,1); dist = 0.8*ATR(15); for( i = 1; i < n; i++ ) { PlotText(""+LastValue(Peak(H,p,i),True),BarCount-3-LastValue(PeakBars(H,p,i)),LastValue(dist,True)+LastValue(Peak(H,p,i),False),colorBlack,ColorRGB(225,225,225)); PlotText(""+LastValue(Trough(L,p,i),True),BarCount-3-LastValue(TroughBars(L,p,i)),LastValue(Trough(L,p,i),False)-LastValue(dist,True),colorBlack,ColorRGB(225,225,225)); }