wavefollower

following the wave and trading happy
正文

Deviation

(2023-06-18 09:55:53) 下一个

#wizard input: length1
#wizard text: -period
#wizard input: averageType1
#wizard text: crosses
#wizard input: crossingType
#wizard input: length2
#wizard text: -period
#wizard input: averageType2
#wizard text: Price:
#wizard input: price

input price = close;
input length1 = 3;
input length2 = 22;
input averageType1 = AverageType.EXPONENTIAL;
input averageType2 = AverageType.EXPONENTIAL;

def avg1 = MovingAverage(averageType1, price, length1);
def avg2 = MovingAverage(averageType2, price, length2);
def avgDiff1 = avg1 - avg2;
def avgDiff2 = avg2 - avg1;

input ATRPeriod = 12;
input ATRMultipler = 2.0;
input averageType = AverageType.WILDERS;

def atr = MovingAverage(averageType, TrueRange(high, close, low), ATRPeriod);

plot DownSignal = avgDiff1 > atr * ATRMultipler;
plot upSignal = avgDiff2 > atr * ATRMultipler;

plot a1 = avgDiff1 * 1.0;
a1.SetDefaultColor(GetColor(8));
plot Arr = atr;

UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

[ 打印 ]
阅读 ()评论 (1)
评论
别摸我 回复 悄悄话 请问你这个script怎么加到TOS中去?我在Studies和Strategies分别新建指标,Chart只出现底部上下箭头形成的直线。
登录后才可评论.