PureBytes Links
Trading Reference Links
|
Hello List,
As I was re-working through the DBS system by Thomas Stridsman,
I noticed what seems to be an error or I guess I should say it doesn't
seem to work as he intended. The error seems to be in the line: VarA =
VarA * (1 + ZDelta);
If you bracket out the rest of the code and plot VarA, it seems to
converge towards zero over time. This in turn seems to cause VarA to
become a fixed look-back period at some point in time as opposed to a
variable look-back. Has anyone else noticed this? Does anyone have any
suggestions for a fix? It seems that it may need a beg/end condition or
something along those lines.
Thanks,
Trey
Inputs: Ceil(60), Flr(20);
Vars: X(0), ZDelta(0), OldVarA(0), VarA(0), VarB(0), Y(0),
EntryL(0), EntryS(0), ExitL(0), ExitS(0);
Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;
If CurrentBar = 1 then
VarA = 20;
VarA = VarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;
EntryL = Highest(High, VarA);
EntryS = Lowest(Low, VarA);
ExitL = Lowest(Low, VarB);
ExitS = Highest(High, VarB);
Plot1(EntryL, "EntryL");
Plot2(EntryS, "EntryS");
Plot3(ExitL, "ExitL");
Plot4(ExitS, "ExitS");
|