Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Zigzag for Amibroker (AFL)
Rating:
2 / 5 (Votes 3)
Tags:
This indicator simply plots the ZigZag on a chart.
Indicator / Formula
Copy & Paste Friendly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | _SECTION_BEGIN ( "zigzag" ); Change = 5; GannIncrement = 0.0625; procedure PlotShapeAt( x, y, shape, shift ) { PlotShapes ( IIf ( BarIndex () == x, shape, 0 ), colorRed , 0, y, shift ); } procedure PlotBlueDot( x, y ) { PlotShapes ( IIf ( BarIndex () == x, shapeSmallCircle , 0 ), colorBlue , 0, y, 0 ); for ( i = -2; i <= 2; i++ ) { if ( i != 0 ) { yGann = ( sqrt ( y ) + i * GannIncrement ) ^ 2; PlotShapes ( IIf ( BarIndex () == x, shapeSmallCircle , 0 ), colorOrange , 0, yGann, 0 ); } } } bi = BarIndex (); sbi = SelectedValue ( bi ); GraphXSpace = 2; Plot ( Zig ( C , Change ), "Zigzag" , colorGreen , styleThick ); Plot ( C , "Price" , IIf ( bi > sbi, colorLightGrey , colorBlack ), styleBar ); upshift = 15; if ( SelectedValue ( PeakBars ( C , Change ) < TroughBars ( C , Change ) ) ) { pt1 = PeakBars ( C , Change, 1 ) == 0 ; pt2 = TroughBars ( C , Change, 1 ) == 0 ; } else { pt1 = TroughBars ( C , Change, 1 ) == 0 ; pt2 = PeakBars ( C , Change, 1 ) == 0 ; upshift = -upshift; } bpt1 = SelectedValue ( ValueWhen ( pt1, bi ) ); bpt2 = SelectedValue ( ValueWhen ( pt2, bi ) ); bpt3 = SelectedValue ( ValueWhen ( pt1, bi, 2 ) ); bpt4 = SelectedValue ( ValueWhen ( pt2, bi, 2 ) ); bpt5 = SelectedValue ( ValueWhen ( pt1, bi, 3 ) ); bpt6 = SelectedValue ( ValueWhen ( pt2, bi, 3 ) ); PlotShapeAt( bpt1, C , shapeDigit1 , upshift ); PlotShapeAt( bpt2, C , shapeDigit2 , -upshift ); PlotShapeAt( bpt3, C , shapeDigit3 , upshift ); PlotShapeAt( bpt4, C , shapeDigit4 , -upshift ); PlotShapeAt( bpt5, C , shapeDigit5 , upshift ); PlotShapeAt( bpt6, C , shapeDigit6 , -upshift ); Level = SelectedValue ( ValueWhen ( pt1, C ) ); PlotBlueDot( round ( bpt1 + 1.618 * ( bpt1 - bpt2 ) ), Level ); PlotBlueDot( round ( bpt1 + 0.382 * ( bpt1 - bpt2 ) ), Level ); PlotBlueDot( round ( bpt1 + 0.5 * ( bpt2 - bpt3 ) ), Level ); PlotBlueDot( round ( bpt1 + 1.732 * ( bpt2 - bpt3 ) ), Level ); PlotBlueDot( round ( bpt1 + 0.618 * ( bpt4 - bpt5 ) ), Level ); PlotBlueDot( round ( bpt1 + 2 * ( bpt4 - bpt5 ) ), Level ); PlotBlueDot( round ( bpt2 + 0.6707 * ( bpt4 - bpt2 ) ), Level ); PlotBlueDot( round ( bpt2 + 2.618 * ( bpt4 - bpt2 ) ), Level ); PlotBlueDot( round ( bpt2 + 1 * ( bpt6 - bpt2 ) ), Level ); PlotBlueDot( round ( bpt2 + 3 * ( bpt6 - bpt2 ) ), Level ); _SECTION_END (); |
1 comments
Leave Comment
Please login here to leave a comment.
Back
very good