
이 전략은 전날 거래의 최고 가격, 최저 가격, 그리고 종결 가격으로 계산된 지지부진한 지위를 기반으로, 현재 거래의 날에 긴 위치 또는 짧은 위치의 작업을 수행합니다. 가격이 상위 지지부진 R1을 돌파 할 때, 더 많은 것을하고, 가격이 하위 지지부진 S1을 넘어서는 경우, 공백을합니다. 이 전략은 동적 지지부진 전략에 속합니다.
vPP = (xHigh+xLow+xClose) / 3
vR1 = vPP+(vPP-xLow)
vS1 = vPP-(xHigh - vPP)
pos = iff(close > vR1, 1,
iff(close < vS1, -1, nz(pos[1], 0)))
possig 실제 거래 방향을 기록한다. 역전 거래 reverse=true를 열면 거래 신호가 반전된다.
포시그 신호에 따르면, vR1을 돌파할 때 더하고, vS1을 돌파할 때 공백한다.
위험 해결 방법:
이 전략은 동적 지원 저항 지표에 기반하여 가격 돌파의 방향에 따라 포지션을 유지한다. 전략 아이디어는 간단하고 이해하기 쉽고 실행할 수 있으며, 트렌드의 전환점을 효과적으로 포착할 수 있다. 그러나 또한 다른 지표와 함께 추가적인 최적화가 필요한 위험이 있습니다. 거래 신호를 더 정확하고 신뢰할 수 있도록.
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 14/06/2018
// This Pivot points is calculated on the current day.
// Pivot points simply took the high, low, and closing price from the previous period and
// divided by 3 to find the pivot. From this pivot, traders would then base their
// calculations for three support, and three resistance levels. The calculation for the most
// basic flavor of pivot points, known as ‘floor-trader pivots’, along with their support and
// resistance levels.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Dynamic Pivot Point Backtest", shorttitle="Dynamic Pivot Point", overlay = true)
reverse = input(false, title="Trade reverse")
xHigh = request.security(syminfo.tickerid,"D", high[1])
xLow = request.security(syminfo.tickerid,"D", low[1])
xClose = request.security(syminfo.tickerid,"D", close[1])
vPP = (xHigh+xLow+xClose) / 3
vR1 = vPP+(vPP-xLow)
vS1 = vPP-(xHigh - vPP)
pos = iff(close > vR1, 1,
iff(close < vS1, -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(vS1, color=#ff0000, title="S1", style = circles, linewidth = 1)
plot(vR1, color=#009600, title="R1", style = circles, linewidth = 1)