首先…新增函式:
DTrueLow
vars:closeOfD2(0), lowOfD1(0)
Array:CoD2[84](-1), LoD1[84](-1)
closeOfD2 = CloseOfD(2, CoD2)
lowOfD1 = lowOfD(1, Lod1)
if closeOfD2 < lowOfD1 then
DTrueLow = closeOfD2
else
DTrueLow = LowOfD1
end if
DTrueHigh
vars:closeOfD2(0), highOfD1(0)
Array:CoD2[84](-1), HoD1[84](-1)
closeOfD2 = CloseOfD(2, CoD2)
HighOfD1 = highOfD(1, HoD1)
if closeOfD2 > highOfD1 then
DTrueHigh = closeOfD2
else
DTrueHigh = HighOfD1
end if
DTrueRange
DTrueRange = DTrueHigh - DTrueLow
DAvgTrueRange
Parameter: Length(Numeric)
DAvgTrueRange = MA(DTrueRange, Length)
接著…新增指標:
DTrueRange
vars:openOfD0(0)
Array:OoD0[84](-1)
openOfD0 = openOfD(0, OoD0)
draw1(openOfD0+DAvgTrueRange(10), "ATR", yellow, yellow, 2)
draw2(openOfD0-DAvgTrueRange(10), "ATR", green, green, 2)
這樣就完成了…不過在 HTS 裡面也許是因為 HTS 所提供的分線抓日線資料有些差異…畫出來就沒 TS 這麼好看了…如果覺得上面程式碼太多…自己很懶的新增的話…我連檔案都準備好了…直接下載匯入吧…
DTrueRange SPE 檔
大概有人要翻桌了…有檔案前面還寫這麼多幹嘛?嗯........為了增加版面長度嘛.......
沒有留言:
張貼留言
請留下您的大名…匿名者恕不回應…