PureBytes Links
Trading Reference Links
|
Hi Group,
I seem to be having a problem with a bit of code I wrote
for some pivots lines. I thought some of you in this group might be able
to shed some light on the matter. The code is supposed to create
Support/Resistance lines by referencing the prior day's high, low, and
close. I've noticed, however, that the position of these lines changes
whenever a new high or low is reached. Obviously, I'm missing something
here. Any ideas?
Cheers,
Ron.
Vars: Pivot(0), FirstR(0), FirstSup(0), SecR(0),SecSup(0);
Pivot=3D(HighD(1)+ LowD(1) + CloseD(1)) / 3;
FirstR =3D (2*Pivot) - LowD(1);
FirstSup =3D (2*Pivot) - HighD(1);
SecR =3D ((Pivot - FirstSup)+FirstR);
SecSup =3D (Pivot - (SecR - FirstSup));
Plot1 (FirstR,"R1");
Plot2 ((FirstSup),"S1");
Plot3 (SecR,"R2");
Plot4 (SecSup,"S2");
|