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

Convert Clyde Lee Gann ind. for Forex



PureBytes Links

Trading Reference Links

I have a Clyde Lee Gann Angle indicator that works good for the emini, Dow, etc. However the scaling does not work properly for Forex markets. Perhaps because of the 4 decimals? Here is the code, does someone know how to fix this anomaly?

{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(7.5),
Angle2(11.25),
Angle3(19);
Vars: Direct(0);
Vars: OldBar(0), OldPrice(0),
NewBar(0), NewPrice(0);
Vars: PriceRoot(0),Price1(0),Price2(0),Price3(0);


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;