EasyTrader ArtNo 260
威廉多空力度線(WAD)的操作原則與OBV指標相同,但比OBV指標更有意義,能提前指出股價破位。威廉多空力度線的計算公式1.TRL=昨日收盤價與今日最低價中價格最低者;TRH=昨日收盤價與今日最高價中價格最高者;
2.如果今日的收盤價>昨日的收盤價,則今日的A/D=今日的收盤價-今日的TRL;
3.如果今日的收盤價<昨日的收盤價,則今日的A/D=今日的收盤價-今日的TRH;
4.如果今日的收盤價=昨日的收盤價,則今日的A/D=0;
5.WAD=今日的A/D+昨日的WAD;MAWAD=WAD的M日簡單移動平均;
6.參數M設置為30;
威廉多空力度線的應用法則
1.股價一頂比一頂高,而WAD一頂比一頂低,暗示頭部即將形成;股價一底比一底低,而WAD一底比一底高,暗示底部即將形成。
2.WAD向上交叉MAWAD,為買進信號;WAD向下交叉MAWAD,為賣出信號。
系統參數與變數
{ WAD 與均線交叉進場 }
if EntryType = 1 then Begin
if WAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if WAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{ 長短均線交叉進場 }
if EntryType = 2 then Begin
if FastWAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if FastWAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{ 增加長期均線上升與下降作濾網確認 }
if EntryType = 2 then Begin
if SlowWAD > SlowWAD[1] and FastWAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if SlowWAD < SlowWAD[1] and FastWAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{Exits}
if ExitType = 1 then SetStopLoss(PL * BigPointValue) ;
if ExitType = 2 then Begin
SetStopLoss(PL * BigPointValue) ;
setProfitTarget(PF * BigPointValue) ;
end;
if ExitType = 3 then Begin
if MP > 0 and BarsSinceEntry = NBarL then ExitLong next bar at Market ;
if MP < 0 and BarsSinceEntry = NBarS then ExitShort next bar at Market ;
end;
if ExitType = 4 then Begin
SetStopLoss(PL * BigPointValue) ;
setProfitTarget(PF * BigPointValue) ;
if MP > 0 and BarsSinceEntry = NBarL then {Sell } ExitLong next bar at Market ;
if MP < 0 and BarsSinceEntry = NBarS then {Buy} ExitShort next bar at Market ;
end;
if IsBalanceDay or date = 1150224 then setExitonClose ;
input:EntryType(1),ExitType(4);
inputs:NBarL(24),NBarS(12),TradeProfit(0.035),TradeStopLoss(0.05),ATRs_L(10.78),ATRs_S(6.4);
vars: IsBalanceDay(False),MP(0),PF(0),PL(0),HLRange(100);
input:FastLen(10),SlowR(1.7),HighBar(5),LowBar(1) ;
Vars:TH(0),TL(0),AD(0),WAD(0),PriceMove(0),Vol(0),SlowLen(30),FastWAD(0),SlowWAD(0) ;
MP = MarketPosition ;
if DAYofMonth(Date) > 14 and DAYofMonth(Date) < 22 and DAYofWeek(Date)= 3 then isBalanceDay = True else isBalanceDay =False ;
PF = AvgPrice*TradeProfit ;
PL = AvgPrice*TradeStopLoss ;
TH = TrueHigh ;
TL = TrueLow ;
{威廉多空力度線(WAD)}
if Close > Close[1] then PriceMove = Close-TL
else if Close < Close[1] then PriceMove = Close-TH
else PriceMove = 0 ;
AD = PriceMove;
WAD = AD + WAD[1] ;
{ 計算WAD長短期均線 }
SlowLen = IntPortion(FastLen*SlowR) ;
FastWAD = Average(WAD,FastLen) ;
SlowWAD = Average(WAD,SlowLen) ;
inputs:NBarL(24),NBarS(12),TradeProfit(0.035),TradeStopLoss(0.05),ATRs_L(10.78),ATRs_S(6.4);
vars: IsBalanceDay(False),MP(0),PF(0),PL(0),HLRange(100);
input:FastLen(10),SlowR(1.7),HighBar(5),LowBar(1) ;
Vars:TH(0),TL(0),AD(0),WAD(0),PriceMove(0),Vol(0),SlowLen(30),FastWAD(0),SlowWAD(0) ;
MP = MarketPosition ;
if DAYofMonth(Date) > 14 and DAYofMonth(Date) < 22 and DAYofWeek(Date)= 3 then isBalanceDay = True else isBalanceDay =False ;
PF = AvgPrice*TradeProfit ;
PL = AvgPrice*TradeStopLoss ;
TH = TrueHigh ;
TL = TrueLow ;
{威廉多空力度線(WAD)}
if Close > Close[1] then PriceMove = Close-TL
else if Close < Close[1] then PriceMove = Close-TH
else PriceMove = 0 ;
AD = PriceMove;
WAD = AD + WAD[1] ;
{ 計算WAD長短期均線 }
SlowLen = IntPortion(FastLen*SlowR) ;
FastWAD = Average(WAD,FastLen) ;
SlowWAD = Average(WAD,SlowLen) ;
{ WAD 與均線交叉進場 }
if EntryType = 1 then Begin
if WAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if WAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{ 長短均線交叉進場 }
if EntryType = 2 then Begin
if FastWAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if FastWAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{ 增加長期均線上升與下降作濾網確認 }
if EntryType = 2 then Begin
if SlowWAD > SlowWAD[1] and FastWAD Cross over SlowWAD then Buy next bar at Highest(High,HighBar) stop ;
if SlowWAD < SlowWAD[1] and FastWAD Cross under SlowWAD then Sell next bar at Lowest(Low,LowBar) stop ;
end;
{Exits}
if ExitType = 1 then SetStopLoss(PL * BigPointValue) ;
if ExitType = 2 then Begin
SetStopLoss(PL * BigPointValue) ;
setProfitTarget(PF * BigPointValue) ;
end;
if ExitType = 3 then Begin
if MP > 0 and BarsSinceEntry = NBarL then ExitLong next bar at Market ;
if MP < 0 and BarsSinceEntry = NBarS then ExitShort next bar at Market ;
end;
if ExitType = 4 then Begin
SetStopLoss(PL * BigPointValue) ;
setProfitTarget(PF * BigPointValue) ;
if MP > 0 and BarsSinceEntry = NBarL then {Sell } ExitLong next bar at Market ;
if MP < 0 and BarsSinceEntry = NBarS then {Buy} ExitShort next bar at Market ;
end;
if IsBalanceDay or date = 1150224 then setExitonClose ;
台指期 30 min K 多空留倉 交易週期 2004/12/31~ 2014/12/31 交易成本 1200
台指期 60 min K 多空留倉 交易週期 2004/12/31~ 2014/12/31 交易成本 1200
結論:WAD指標也是由 Larry Williams 所創建的指標,過去部落格有很多篇文章也是將他書中的精華想法與指標轉化為策略元素,都能展現不錯的績效表現
MagicQS169
沒有留言:
張貼留言