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 ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Gartley Tool for Amibroker (AFL)
kaiji
about 15 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 1)
Tags:
amibroker, gartley

Here is a tool which is used to plot Gartley with ratios in amibroker.

By kaka at inditrader.com

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn over 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly over 13 years ago
Williams Alligator System
Submitted by durgesh1712 over 13 years ago
*Level Breakout system*
Submitted by Tinych over 13 years ago

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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
_SECTION_BEGIN("Gartley Tool");
Gartley=ParamToggle("Gartley","OFF|ON",1);
Trg=ParamToggle("Show Targets","Yes|No",1);
 
Type=ParamToggle("Label","ABCD|PRICE",1);
Snap=ParamToggle("Snap","Yes|No",1);
 
if(Gartley==1)
{
SetBarsRequired( -2, -2 );
bi = BarIndex();
bis = SelectedValue( bi );
 
symbol = Name();
tframe = Interval();
chartID = GetChartID();
Xname = "X" + chartID + symbol + tframe;
Yname = "Y" + chartID + symbol + tframe;
 
LeftButton = GetCursorMouseButtons() & 1;
a = Nz(StaticVarGet("counter"));
if ( leftButton )
{
   StaticVarSet("counter", a+1);
     
    x = GetCursorXPosition(  );
   y = GetCursorYPosition(  );
   StaticVarSet( Xname + bis, x );
   StaticVarSet( Yname + bis, y );
     
}
 
 
j = 0;
dt = DateTime();
shapePlot = 0;
shapePos = Null;
xx = yy = Null;
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );
for ( i = FirstVisibleBar; i <Lastvisiblebar AND i<BarCount; i++ )
{
   x = StaticVarGet( Xname + i );
   y = StaticVarGet( Yname + i );
 
   if ( x == dt[i] AND snap==0)
   {
       shapePlot[i] = 1;
       shapePos[i] = IIf(abs(H[i]-y) < abs(L[i]-y), H[i], L[i]);
       xx[j] = i;
       yy[j] = IIf(abs(H[i]-y) < abs(L[i]-y), H[i], L[i]);
       j++;
   }
    else if ( x == dt[i] AND snap==1)
   {
       shapePlot[i] = 1;
       shapePos[i] = y;
       xx[j] = i;
       yy[j] = y;
       j++;
   }
 
}
 
 
 
shape = shapeSmallCircle;
PlotShapes( shapePlot*shape, colorRed, 0, shapePos, 0 );
Values=ParamToggle("Segment Values","No|Yes",1);
vr=ParamToggle("R1","No|Yes",1);
vr2=ParamToggle("R2","No|Yes",0);
vr3=ParamToggle("R3","No|Yes",1);
 
for ( i = 1; i <= j ; i++ )
 
{
if(i==1 AND Type==0)
{
PlotText("X ",xx[i-1]-2,yy[i-1],colorWhite);
}
if(i==2 AND Type==0)
{
PlotText("A ",xx[i-1]-2,yy[i-1],colorWhite);
}
if(i==3 AND Type==0)
{
PlotText("B ",xx[i-1]-2,yy[i-1],colorWhite);
}
if(i==4 AND Type==0)
{
PlotText("C ",xx[i-1]+2,yy[i-1],colorWhite);
}
if(i==5 AND Type==0)
{
PlotText("D ",xx[i-1]+2,yy[i-1],colorWhite);
}
if(i==6 AND Type==0)
{
PlotText("E ",xx[i-1]+2,yy[i-1],colorWhite);
}
if(i==7 AND Type==0)
{
PlotText("F ",xx[i-1]+2,yy[i-1],colorWhite);
}
if(i==8 AND Type==0)
{
PlotText("G ",xx[i-1]+2,yy[i-1],colorWhite);
}
if(Type==1)
{
PlotText(""+yy[i-1],xx[i-1]+2,yy[i-1],colorWhite);
}
 
 
 
Plot( LineArray( xx[i-1], yy[i-1], xx[i], yy[i] ), "", colorBlue, styleThick );
XA=yy[i]-yy[i-1];
AB=yy[i]-yy[i+1];
AD=yy[i]-yy[i+3];
BC=yy[i+1]-yy[i+2];
CD=yy[i+2]-yy[i+3];
r=CD/XA;
r2=AB/XA;
r3=XA/BC;
 
if(Trg==0)
{
target1=yy[i+3]+AD*0.618;
Line1=LineArray(xx[i+2],target1,BarCount-1,target1);
Plot(Line1,"",colorYellow,styleDashed|styleNoRescale);
 
target2=yy[i+3]+AD*1.272;
Line2=LineArray(xx[i+2],target2,BarCount-1,target2);
Plot(Line2,"",colorYellow,styleDashed|styleNoRescale);
 
target3=yy[i+3]+AD*2.618;
Line3=LineArray(xx[i+2],target3,BarCount-1,target3);
Plot(Line3,"",colorYellow,styleDashed|styleNoRescale);
}
 
 
 
if(vr==1)
{
PlotText(""+Prec(abs(r2), 2 )+" ("+(abs(xx[i-1]-XX[i+1]))+")",XX[i-1]+int((xx[i+1]-XX[i-1])/2),yy[i-1]+((yy[i+1]-yy[i-1])/2),colorBlack,colorYellow);
Plot( LineArray( xx[i-1], yy[i-1], xx[i+1], yy[i+1] ), "", colorBlue, styleDashed );
}
if(vr2==1)
{
PlotText(""+Prec(abs(r3), 2 )+" ("+(abs(xx[i-1]-XX[i+2]))+")",XX[i-1]+int((xx[i+2]-XX[i-1])/2),yy[i-1]+((yy[i+2]-yy[i-1])/2),colorBlack,colorYellow);
Plot( LineArray( xx[i-1], yy[i-1], xx[i+2], yy[i+2] ), "", colorBlue, styleDashed );
}
if(vr3==1)
{
PlotText(""+Prec(abs(r), 2 )+" ("+(abs(xx[i-1]-XX[i+3]))+")",XX[i-1]+int((xx[i+3]-XX[i-1])/2),yy[i-1]+((yy[i+3]-yy[i-1])/2),colorBlack,colorYellow);
Plot( LineArray( xx[i-1], yy[i-1], xx[i+3], yy[i+3] ), "", colorBlue, styleDashed );
}
if(Values==1)
{
PlotText(""+Prec(abs(XA), 2 ),XX[i-1]+int((xx[i]-xx[i-1])/2),yy[i-1]+XA/2,colorBlack,colorWhite);
}
 
}
 
if ( GetCursorMouseButtons() == 12 )
{
 
for ( i = 0; i < BarCount; i++ )
 
   {
       StaticVarRemove("counter");
       StaticVarRemove( Xname + i );
       StaticVarRemove( Yname + i );
     RequestTimedRefresh(1,True );
 
    }
}
 
}
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back