
この戦略は,前日取引の最高価格,最低価格,および閉店価格の計算されたサポートレジスタンスレベルに基づいて,現在の取引日にロングポジションまたはショートポジションの操作を行います. 価格が上方レジスタンスレベル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に開いた場合,取引信号は反転する.
POSSIG信号によると,vR1を突破すると多行,vS1を突破すると空行.
リスク対策:
この戦略は,動的サポート・レジスタンス指標に基づいて,価格突破の方向に応じてポジションを保持する.戦略の構想は単純で,理解しやすく,実行でき,トレンドの転換点を効果的に捕捉することができる.しかし,他の指標と組み合わせてさらに最適化する必要のあるリスクもあります.取引信号をより正確に信頼できるようにする.全体的に,この戦略は,補助判断指標として使用する,または取引を量化するための基礎戦略の1つとして適しています.
//@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)