Type : Signal, Name: DBS-B
Inputs: Ceil(60), Flr(20);
Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0);
Y = X;
X = Stddev(Close, 30);
ZDelta = (X — Y) / X;
If CurrentBar =1 then
VarA = 20;
OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB=VarA * 0.5;
Buy tomorrow at Highest(High, VarA) Stop;
Sell tomorrow at Lowest(Low, VarA) Stop;
ExitLong tomorrow at Lowest(Low, VarB) Stop;
ExitShort tomorrow at Highest(High, VarB) Stop;