
これは,1分間のK線閉店方向に基づく高頻度取引を行う戦略である.戦略は,K線の閉店価格と開店価格の関係を判断して市場の動きを決定し,看板K線が形成された後に多行し,看板K線が形成された後に空行する.戦略は,固定したポジション保持時間を採用し,次のK線閉店時にポジションを平行させ,最大日取引回数に制限を設け,リスクを制御する.
戦略の核心的な論理は,K線の閉店方向から短期市場の傾向を判断することです.
この戦略は,K線の閉店方向に基づく高周波取引システムで,簡単な価格行動分析によって短期市場の機会を捉えます.この戦略の優点は,論理的にシンプルで,ポジションの維持時間が短く,リスクが制御可能であることですが,同時に,取引コストが高く,偽ブレークなどの課題に直面しています.より多くの技術指標と最適化プログラムを導入することにより,戦略の安定性と収益性がさらに向上する見込みがあります.短期取引機会を追求する投資家にとって,これは試し,改善する価値のある取引戦略です.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-12-10 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Candle Close Strategy", overlay=true)
// Define conditions for bullish and bearish candlesticks
isBullish = close > open
isBearish = close < open
// Track the number of bars since the trade was opened and the number of trades per day
var int barsSinceTrade = na
var int tradesToday = 0
// Define a fixed position size for testing
fixedPositionSize = 1
// Entry condition: buy after the close of a bullish candlestick
if (isBullish and tradesToday < 200) // Limit to 200 trades per day
strategy.entry("Buy", strategy.long, qty=fixedPositionSize)
barsSinceTrade := 0
tradesToday := tradesToday + 1
// Entry condition: sell after the close of a bearish candlestick
if (isBearish and tradesToday < 200) // Limit to 200 trades per day
strategy.entry("Sell", strategy.short, qty=fixedPositionSize)
barsSinceTrade := 0
tradesToday := tradesToday + 1
// Update barsSinceTrade if a trade is open
if (strategy.opentrades > 0)
barsSinceTrade := nz(barsSinceTrade) + 1
// Reset tradesToday at the start of a new day
if (dayofmonth != dayofmonth[1])
tradesToday := 0
// Exit condition: close the trade after the next candlestick closes
if (barsSinceTrade == 2)
strategy.close("Buy")
strategy.close("Sell")
// Plot bullish and bearish conditions
plotshape(series=isBullish, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=isBearish, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Plot the candlesticks
plotcandle(open, high, low, close, title="Candlesticks")