威廉多空力度線

By | 2019-02-15

 

函數腳本

SetBarMode(2);

{
XQ: WA/D 指標
}

variable: wadt(0), adt(0);

if CurrentBar = 1 then
 wadt = 0
else
 begin
 if close = close[1] then
 adt = 0
 else
 begin
 if close < close[1] then
 adt = close - TrueHigh
 else
 adt = close - TrueLow;
 end;

 wadt = adt + wadt[1];
 end;

WAD = wadt;

指標腳本

// XQ: WA/D 指標
//

variable: wad(0), _ad(0);

if CurrentBar = 1 then
 wad = 0
else
 begin 
 if close = close[1] then
 _ad = 0
 else 
 begin
 if close < close[1] then
 _ad = close - TrueHigh
 else { close > close[1] }
 _ad = close - TrueLow;
 end;

 wad = _ad + wad[1];
 end;
 
Plot1(wad, "WA/D");

參考圖