
이 전략은 제한된 부피 요소 방법을 사용하여, 변동성 측정과 함께 가격 변화에 대한 다공간 판단을 수행하며, 트렌드 추적 유형 전략에 속한다. 이 전략은 각 시간 주기에 적용되며, 다양한 변동성 수준에 적응하기 위해 매개 변수를 자동으로 조정할 수 있다.
전략은 가장 최근의 N 루트 K 선의 높고 낮은 평균값, 닫기 가격 평균값, 그리고 이전 K 선의 높고 낮은 닫기 가격 평균값을 먼저 계산한다. 그 다음에는 현재 K 선과 이전 K 선의 대수익률 인트라와 인터 (Intra and Inter) 을 계산한다. 또한 인트라와 인터 (Intra and Inter) 의 변동성 Vintra와 Vinter (Vinter) 을 계산한다.
변동성 수준과 조정 가능한 파라미터를 기준으로, 적응 절단 계수인 CutOff를 계산한다. 가격 변화가 CutOff을 초과할 때, 공백 신호를 준다. 구체적으로, MF가 CutOff보다 크면 다단계 신호로, MF가 마이너스보다 작으면 공백 신호로, 현재 K선 종료 가격과 높은 낮은 평균값의 차이를 계산한다.
마지막으로, 신호에 따라 자금 흐름을 계산하고, 신호 pos를 출력하며, 제한적 부피 요소 곡선을 FVE 로 그려낸다.
이 전략은 전체적으로 신뢰성이 높고, 원칙이 우수하며, 트렌드 추적 전략의 구성 요소로 사용할 수 있으며, 다른 전략과 적절히 결합하면 효과가 더 좋다. 핵심은 최적의 매개 변수를 찾아, 좋은 풍력 조절 조치를 구축하는 것이다. 후기에는 계속 최적화할 수 있다면, 매우 강력한 트렌드 추적 전략이 될 것이다.
/*backtest
start: 2022-10-10 00:00:00
end: 2023-10-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 18/08/2017
// This is another version of FVE indicator that we have posted earlier
// in this forum.
// This version has an important enhancement to the previous one that`s
// especially useful with intraday minute charts.
// Due to the volatility had not been taken into account to avoid the extra
// complication in the formula, the previous formula has some drawbacks:
// The main drawback is that the constant cutoff coefficient will overestimate
// price changes in minute charts and underestimate corresponding changes in
// weekly or monthly charts.
// And now the indicator uses adaptive cutoff coefficient which will adjust to
// all time frames automatically.
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Volatility Finite Volume Elements", shorttitle="FVI")
Samples = input(22, minval=1)
Perma = input(40, minval=1)
Cintra = input(0.1, step=0.1)
Cinter = input(0.1, step=0.1)
reverse = input(false, title="Trade reverse")
xhl2 = hl2
xhlc3 = hlc3
xClose = close
xIntra = log(high) - log(low)
xInter = log(xhlc3) - log(xhlc3[1])
xStDevIntra = stdev(sma(xIntra, Samples) , Samples)
xStDevInter = stdev(sma(xInter, Samples) , Samples)
xVolume = volume
TP = xhlc3
TP1 = xhlc3[1]
Intra = xIntra
Vintra = xStDevIntra
Inter = xInter
Vinter = xStDevInter
CutOff = Cintra * Vintra + Cinter * Vinter
MF = xClose - xhl2 + TP - TP1
FveFactor = iff(MF > CutOff * xClose, 1,
iff(MF < -1 * CutOff * xClose, -1, 0))
xVolumePlusMinus = xVolume * FveFactor
Fvesum = sum(xVolumePlusMinus, Samples)
VolSum = sum(xVolume, Samples)
xFVE = (Fvesum / VolSum) * 100
xEMAFVE = ema(xFVE, Perma)
pos = iff(xFVE > xEMAFVE, 1,
iff(xFVE < xEMAFVE, -1, nz(pos[1], 0)))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(xFVE, color=green, title="FVI")
plot(xEMAFVE, color=blue, title="FVI EMA")