Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Hi,
Is it possible to modify the formula below to calculate and plot lines
for say a nine 9 sided and other Polygons.
I would appreciate any improvements you can suggest on the formula
{ Gann Hexagon }
-----------8<----------------------------------------------
{ Pivot:=Input(" Enter Low or High ",1,20000,408); }
Pivot:= LastValue(Lowest(Low));
Rg:=(Sqrt((9 + 12* Pivot))+3)/6; { Rg Ring of Hexagon }
Inc:=Input("Enter Increments or Decrements..",-12,100,6); {Increment Ring of Hexagon }
St:=Input(" Enter Angular Shift in Degrees.. ",-359,360,0);
T1:=(Power((((Rg+(1+St/360))*6) -3),2) -9)/12;
T2:=(Power((((Rg+(2+St/360))*6) -3),2) -9)/12;
T3:=(Power((((Rg+(3+St/360))*6) -3),2) -9)/12;
T4:=(Power((((Rg+(4+St/360))*6) -3),2) -9)/12;
T5:=(Power((((Rg+(5+St/360))*6) -3),2) -9)/12;
T6:=(Power((((Rg+(6+St/360))*6) -3),2) -9)/12;
Pivot;
T1;T2;T3;T4;T5;T6;
-----------------------8<-----------------------------------
Kind regards,
Derek
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
The MetaStock formula language can not plot a vertical line. all other angles are possible.
When plotting a line, the line must be defined with a starting point (date and time plus a value) and a slope. If the line is to change direction, a date of the change and a new slope is needed. Likewise, a date is needed for when the line will end.
All lines will be drawn from the earliest date toward the latest date (left to right).
With these restrictions, it is possible to draw polygon shape but you will likely require the indicator to draw two lines, one for the top half and one for the bottom half.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Dear Equis,
The idea of the Gann Hexagon formula is the draw on a Metastock Chart
Support & Resistance Lines equal to the values at 60 Degrees angle on the attached Hexagon Chart.
( or 120 or 180 or 240 or 300 Degrees )
Derek
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Dear Equis,
The Horizontal lines on the attached MS Chart are equal to the values along the 60 Degree line on the Gann Hexagon
Derek
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
From memory, in order to compute the "shapes" there is some polynomial which needs to be solved; I don't know which polynomial, or even the degree (but as we are looking to count around a "circular-ish" shape, I'm going to guess it's a second degree function)
wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Dear Equis,
Major Low Pivot on the above Chart at = 408
Ring:=(Sqrt(( 9 + 12* Pivot))+3 ) /6 ;
{ Ring:of Hexagon =12.172 }
( Ring = 12 th Ring of Hexagon }
{ Angle = 0.1726 * 360 }
{ Angle = 62.136 Degrees }
{ Next Ring =12.1726 + 1 }
1st Resistance Line:=(Power((((Ring+1)*6) -3),2) -9)/12;
{ 1st Resistance Line :=481.036 }
[ Angular Shift omitted to make it simpler }
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.