[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding price labels to end of horizontal lines TS2000i



PureBytes Links

Trading Reference Links

Since you sent an .els that had the needed function, this is a "cut
and paste"  solution to your problem. 

Note the added parameter as to whether to list all or only last values.

Remember GANN ANGLES IN TS ARE IN DEGREES not radians or
other values.

You might like to know that the point at which text starts is the
point at which the prior pivot was detected. 

Clyde

[Two pictures can be found at:
  ftp://ftp.eskimo.com/u/j/jimo/clee-gann-labels.gif
and
  ftp://ftp.eskimo.com/u/j/jimo/clee-labels-lastonly.gif
-list maintainer]


+++++++++++++++++++++++++++++++++++++++++++++++++++++
{Indicator:  C.Lee_GannS&R
Purpose:  Plot 3 Gann support and resistance lines
             at each pivot detected by SwingLee
User specifies Gann angles to use.
Author:   Clyde Lee, Copyright 6/2000
Permission: Permission to use in any fashion desired if proper credit
is given crediting author and indicating copyright.}


Inputs: NBars(19), {Number bars to use in SwingLee for detection of
swing points}
    Angle1(0.19),
    Angle2(0.33),
    Angle3(0.55),
    ShowTextLabels(True),
    OnlyLast(false);
Vars:  Direct(0);
Vars:  OldBar(0), OldPrice(0),
    NewBar(0), NewPrice(0);
Vars:  PriceRoot(0),Price1(0),Price2(0),Price3(0);
Vars:   TextID1(-1), TextID2(-1), TextID3(-1), TextID4(-1),
    Text1(-1),   Text2(-1),   Text3(-1),   Text4(-1),
        FPC(GetBackGroundColor);

Direct = Swing_Lee(NBars);

If Sign(Direct)<>Sign(Direct[1]) then begin
 OldBar = NewBar;
 OldPrice = NewPrice;
 NewBar = CurrentBar-AbsValue(Direct);
  If Direct<0 then
  NewPrice = H[-Direct]
 else
  NewPrice = L[Direct];

 PriceRoot = SquareRoot(NewPrice);
 Price1 = Square(PriceRoot+Sign(Direct)*Angle1/360*2);
 Price2 = Square(PriceRoot+Sign(Direct)*Angle2/360*2);
 Price3 = Square(PriceRoot+Sign(Direct)*Angle3/360*2);

 For Value1=AbsValue(Direct) downto 0 begin
  Plot1[Value1](Price1,"GP1");
  Plot2[Value1](Price2,"GP2");
  Plot3[Value1](Price3,"GP3");
  Plot4[Value1](NewPrice,"np");
 End;
End
Else if OldPrice>0 then begin
 Plot1[Value1](Price1,"GP1");
 Plot2[Value1](Price2,"GP2");
 Plot3[Value1](Price3,"GP3");
 Plot4[Value1](NewPrice,"np");
End;


If ShowTextLabels and Sign(Direct)<>Sign(Direct[1]) then begin
   If TextID1<>-1 and OnlyLast Then  Text_Delete(TextID1);
    TextID1=Text_New(D,T,Plot1,NumToStr(Plot1,2));
   Text_SetLocation(TextID1,D,T,Plot1);
   Text_SetColor(TextID1,Red);
   Text_SetStyle(TextID1,0,2);

   If TextID2<>-1 and OnlyLast  Then  Text_Delete(TextID2);
    TextID2=Text_New(D,T,Plot2,NumToStr(Plot2,2));
   Text_SetLocation(TextID2,D,T,Plot2);
   Text_SetColor(TextID2,Red);
   Text_SetStyle(TextID2,0,2);

   If TextID3<>-1 and OnlyLast  Then  Text_Delete(TextID3);
    TextID3=Text_New(D,T,Plot3,NumToStr(Plot3,2));
   Text_SetLocation(TextID3,D,T,Plot3);
   Text_SetColor(TextID3,Red);
   Text_SetStyle(TextID3,0,2);

   If TextID4<>-1 and OnlyLast  Then  Text_Delete(TextID4);
    TextID4=Text_New(D,T,Plot4,NumToStr(Plot4,2));
   Text_SetLocation(TextID4,D,T,Plot4);
   Text_SetColor(TextID4,Red);
   Text_SetStyle(TextID4,0,2);
end;


+++++++++++++++++++++++++++++++++++++++++++++++++++++

----- Original Message -----
From: "Brian Smiley" <bsmiley@xxxxxxxxx>
To: "Clyde Lee" <clydelee@xxxxxxxxxx>; <omega-list@xxxxxxxxxx>;
   "John Corrion" <corrion@xxxxxxxxxxx>;
   "Harrison Cai" <Harrison@xxxxxxxxxxxxxxxxxxxxxxx>

>thanks for the several replies, however I am now more confused as to
>where to apply the code. Here is an upload of the file for those to
>check out. All your help is greatly appreciated, its just that I am
>not experienced enough to do this without all your valuable input.