
이 전략은 Nifty50 지수에서 3분 K선 데이터를 기반으로, 매 거래일 첫 3분 K선에서 최고 가격과 최저 가격을 추적하고, 가격이 이 범위를 돌파할 때 거래 신호를 발산한다. 전략의 주요 아이디어는 시장이 상장할 때 종종 큰 불확실성과 변동성이 존재하며, 첫 K선의 높고 낮은 점은 당일 가격의 중요한 참조가 될 수 있다. 가격이 이 범위를 돌파했는지 여부를 판단함으로써 당일 트렌드 기회를 잡을 수 있다.
Nifty50 3분 상장 가격 돌파 전략은 매일 상장 3분의 고하점을 포착하여 당일 트렌드 방향을 판단하여 간단하고 사용하기 쉽다. 그러나 상장 당시의 큰 변동과 불확실성으로 인해 전략 자체에는 허위 돌파 신호를 많이 생성하고, 포지션 관리 및 중지 장치가 부족하는 등의 제한이 있습니다. 따라서 실제 응용에서는 다른 기술 지표, 포지션 관리 및 엄격한 중지 등의 수단과 결합하여 전략 성능을 최적화하고, 위험 제어 능력을 향상시킬 필요가 있습니다.
/*backtest
start: 2023-05-11 00:00:00
end: 2024-05-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Nifty 50 Strategy", overlay=true)
// Define 3-minute timeframe
timeframe = "3"
// Track if the current bar is the first bar of the session
isNewSession = ta.change(hour(time, "D")) != 0
// Track the open of the first candle of the session
firstCandleOpen = isNewSession ? open : na
// Track the high and low of the first candle
var float firstCandleHigh = na
var float firstCandleLow = na
if isNewSession
firstCandleHigh := high
firstCandleLow := low
// Alert when the first candle is completed
if ta.barssince(isNewSession) == 3
alert("First Candle Completed - High: " + str.tostring(firstCandleHigh) + ", Low: " + str.tostring(firstCandleLow))
// Track if the high or low of the first candle is broken
highBroken = high > firstCandleHigh
lowBroken = low < firstCandleLow
// Alert when the high or low of the first candle is broken
if highBroken
alert("High of First Candle Broken - High: " + str.tostring(high))
strategy.entry("Enter Long", strategy.long)
if lowBroken
alert("Low of First Candle Broken - Low: " + str.tostring(low))
strategy.entry("Enter Short", strategy.short)