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隻出現底部上下箭頭形成的直線。
登錄後才可評論.