Type : Function, Name : HonyBake
Input:HamLen(Numeric),Price(NumericSeries);
Vars:RealHam(0),ImagHam(0),WaitoHam(0),J(0),P(0);
RealHam=0;
ImagHam=0;
For J=0 to HamLen-1 Begin
WaitoHam=Price[J];
If HamLen<>0 Then Begin
RealHam=RealHam+Cosine(360*J/HamLen)*WaitoHam;
ImagHam=ImagHam+Sine(360*J/HamLen)*WaitoHam;
End;
End;
If AbsValue(RealHam) > .001 Then Begin
P=ArcTangent(ImagHam/RealHam);
End
Else Begin
P=90*Sign(ImagHam);
End;
If RealHam<0 then P = P+180;
P=P+90;
If P<0 then P=P+360;
If P>360 then P=P-360;
HonyBake=P;
Type : Indicator, Name : HonyBaked
Input: HamLen(20), Price(TypicalPrice), P1Adv(0), P2Adv(15),SmooLen(10);
Vars: Spiral(0);
Spiral = HonyBake(HamLen,Price);
Plot1(50+50*Average(Sine(Spiral + P1Adv),SmooLen),»Honey Baked»);
{Plot2(50+50*Average(Sine(Spiral + P1Adv + P2Adv),SmooLen),»Hon Baked +»);}