EasyTradr ArtNo 243
由 Thomas DeMark 在1994年的 [The New Science of Technical Analysis] 所提出的(REI)範圍膨脹指標,它主要的原理是將短期價格變化與期間的價格總變化作一比較,用來衡量價格運動方向的速度與力道,因此可被歸類為動量擺盪指標。它對價格上升和下降階段的變化非常敏感,但在價格橫向盤整階段或股價急升和暴跌時卻無大的變化。該指標主要用於預測價格的未來走勢,並提供買賣時機,發出信號的準確率很高;但由於發出信號頻率較低,所以一般不宜單獨使用,應結合其他指標綜合研判。指標計算方式
Two sums are calculated for each day. One is the conditional sum of the "strong" price changes:
where is the period of calculation (usually, 8),
is a first condition:
if ((High[j – 2] < Close[j - 7]) && (High[j - 2] < Close[j - 8]) && (High[j] < High[j - 5]) && (High[j] < High[j - 6])) else
is a second condition:
if ((Low[j – 2] > Close[j – 7]) && (Low[j – 2] > Close[j – 8]) && (Low[j] > Low[j – 5]) && (Low[j] > Low[j – 6])) else
and is the price change parameter:
The second sum is calculated as following:
For each trading day the value of the indicator is calculated:
這個指標還蠻像心電圖的波形喔,透過它是否也能為進出場找到良好的交易時機呢 ?
範圍膨脹指標的研判法則
- 1、範圍膨脹指數在-0.6以下,屬弱勢區,當範圍膨脹指數由下向上過-0.6時,預示市場走強,是買入信號。
- 2、範圍膨脹指數在0.6以上,屬強勢區,當範圍膨脹指數由上向下過0.6時,預示市場走弱,是賣出信號。
input:EntryType(2),ExitType(1) ;
inputs:NBarL(55),NBarS(35),TradeProfit(0.012),TradeStopLoss(0.024),ATRs_L(12.7),ATRs_S(4.6);
vars: IsBalanceDay(False),MP(0),PF(0),PL(0),HLRange(100);
inputs:Period(8),BaseLen(2),UB(0),DB(0),Len1(5),Len2(5) ;
Vars:FactA(0),FactB(0),FactC(0),SumA(0),SumB(0),REI(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 ;
{建立指標計算基礎 }
if High[2] < Close[7] and High[2] < Close[8]
and High < High[5] and High < High[6] then FactA = 0 else FactA = 1 ;
if Low[2] > Close[7] and Low[2] > Close[8]
and Low > Low[5] and Low > Low[6] then FactB = 0 else FactB = 1 ;
FactC = High-High[2]+Low-Low[2] ;
SumA = summation(FactA*FactB*FactC,Period) ;
SumB = summation(FactC,Period) ;
{原公式 S1/S2*100 在台指期計算得到的數值太大,因此我將公式依比例縮小}
if SumB <> 0 then REI = SumA/SumB/10 ;
if EntryType = 1 then begin
if MP <> 1 and REI < UB then Buy next bar at Highest(High,Len1) stop ;
if MP <> -1 and REI > DB then Sell next bar at Lowest(Low,Len2) stop ;
end;
if EntryType = 2 then begin
if MP <> 1 and REI - REI[2] > UB then Buy next bar at Highest(High,Len1) stop ;
if MP <> -1 and REI - REI[2] < DB then Sell next bar at Lowest(Low,Len2) stop ;
end;
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 then setExitonClose ;
台指期 60 min K 留倉 交易期間 2004/11/29 ~ 2014/11/28 交易成本 1200
0 留言:
張貼留言
如果有私人問題想請教,請透過網站右方『與站長聯絡』之表單,謝謝!