Tallinn
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 1
|
TOS standardDevChannel code:
input price = close;
input deviations = 2.0;
input fullRange = Yes;
input length = 21;
def regression;
def stdDeviation;
if (fullRange) {
regression = InertiaAll(price);
stdDeviation = stdevAll(price);
} else {
regression = InertiaAll(price, length);
stdDeviation = stdevAll(price, length);
}
plot UpperLine = regression + deviations * stdDeviation;
plot MiddleLine = regression;
plot LowerLine = regression - deviations * stdDeviation;
UpperLine.SetDefaultColor(GetColor(8));
MiddleLine.SetDefaultColor(GetColor(8));
LowerLine.SetDefaultColor(GetColor(8));
Can someone modify it to Tradestation? But I don't see the "code" what make's it calculate from first bar? Length seems to be 21 in default, but if you put timeframe "today only" then it starts calculating from first bar.
|