이것은 「캔들 마감 몇 초 전에 실시간 드로잉(그리기)을 시작할지 0초에서 5분 사이에서 조절할 수 있는」 기능이 탑재된 RSI입니다. 그 외에도 있으면 유용한 보조 기능들을 함께 추가했습니다.
[RSI]
RSI(상대강도지수)는 지정된 기간 내의 '평균 상승폭'과 '평균 하락폭'의 균형을 계산하여, 현재 시장의 상대적인 강세(매수세)와 약세(매도세)의 정도를 0에서 100까지의 백분율(퍼센티지)로 수치화한 것입니다. 가격의 절대값이 아니라 '변동의 속도와 편향(모멘텀)'을 측정합니다.
출처: TradingView
[NOTICE & LICENSE]
・학습 및 정보 제공만을 목적으로 하며, 투자 조언이 아닙니다. 툴 사용으로 인해 발생한 경제적 손실에 대해 일절 책임을 지지 않습니다.
・Pine Script v6에서 동작을 확인했습니다. 향후 TradingView의 사양 변경에 따른 업데이트를 보장하지 않으며, 개별적인 설치 지원이나 수정 요청은 일절 받지 않습니다 (있는 그대로(As-is) 제공).
・MIT 라이선스가 적용됩니다.
// SPDX-FileCopyrightText: 2026 NK-report https://www.nk-report.com/
// SPDX-License-Identifier: MIT
//
// Disclaimer: This script is for educational purposes only and does not constitute investment advice.
//@version=6
indicator("NK-Fixed RSI", shorttitle="NK-Fixed RSI", overlay=false)
// ==============================================================================
// 【01】 免責・ライセンス
// ==============================================================================
//
// 지표를 무료로 공개하고 있습니다: https://www.nk-report.com/p/kr-tradingview.html
//
// 면책 조항: 본 스크립트는 학습 및 정보 제공만을 목적으로 하며, 투자 조언이 아닙니다.
//
// 1. 본 코드는 2026년 기준 Pine Script v6에서 동작 확인을 마쳤습니다.
// 향후 사양 변경으로 인한 오류 등에 대해 개별적인 지원이나 수정은 제공하지 않습니다.
// 2. 본 스크립트는 일반적인 계산 로직을 바탕으로 LLM을 활용하여 독자적으로 작성된 것입니다.
// MIT 라이선스를 따릅니다.
// ------------------------------------------------------------------------------
// MIT License
//
// Copyright 2026 NK-report https://www.nk-report.com/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// ==============================================================================
// 【02】 UI設定と言語
// ==============================================================================
// 1. 言語辞書の定義(テキストの定数化)
const string GRP_FIXED = "▼ 그리기 제어"
const string LBL_SEC = "실시간 그리기 시작 (캔들 마감 X초 전)"
const string TT_SEC = "0초에서 300초(5분) 사이로 조절. 지정 시간(예: 10초 전)이 될 때까지 현재 캔들의 그리기를 숨깁니다.\n0초를 입력하면 숨김 기능을 비활성화하고 항상 실시간으로 그립니다."
const string GRP_RSI = "▼ RSI 설정"
const string LBL_SH_RSI = "RSI "
const string LBL_LEN = "기간"
const string LBL_SRC = "소스"
const string LBL_SH_MA1 = "스무딩 1"
const string LBL_S1_TYPE = "종류"
const string LBL_S1_LEN = "기간"
const string LBL_SH_MA2 = "스무딩 2"
const string LBL_S2_TYPE = "종류"
const string LBL_S2_LEN = "기간"
// 2. UI(ユーザー入力画面)の構築 & 3. トップダウン処理への適合
i_sec = input.int(0, title=LBL_SEC, minval=0, maxval=300, group=GRP_FIXED, tooltip=TT_SEC)
// RSI設定
i_show_rsi = input.bool(true, title=LBL_SH_RSI, group=GRP_RSI, inline="RSI0")
i_len = input.int(14, title=LBL_LEN, minval=1, group=GRP_RSI, inline="RSI0")
i_src = input.source(close, title=LBL_SRC, group=GRP_RSI, inline="RSI0")
// 平滑化1の設定
i_show_ma1 = input.bool(false, title=LBL_SH_MA1, group=GRP_RSI, inline="RSI1")
i_ma1_type = input.string("SMA", title=LBL_S1_TYPE, options=["SMA", "EMA", "WMA"], group=GRP_RSI, inline="RSI1")
i_ma1_len = input.int(20, title=LBL_S1_LEN, minval=1, group=GRP_RSI, inline="RSI1")
// 平滑化2の設定
i_show_ma2 = input.bool(false, title=LBL_SH_MA2, group=GRP_RSI, inline="RSI2")
i_ma2_type = input.string("SMA", title=LBL_S2_TYPE, options=["SMA", "EMA", "WMA"], group=GRP_RSI, inline="RSI2")
i_ma2_len = input.int(50, title=LBL_S2_LEN, minval=1, group=GRP_RSI, inline="RSI2")
// ==============================================================================
// 【03】 全コード共通仕様(タイムゾーン・時間インフラ処理)
// ==============================================================================
const int MS_PER_SEC = 1000
// ==============================================================================
// 【04】 各カテゴリ共通仕様 (NK-Fixed Core Logic)
// ==============================================================================
bool is_draw_ready = true
if barstate.isrealtime and i_sec > 0
if not na(time_close)
int time_left_ms = time_close - timenow
int threshold_ms = i_sec * MS_PER_SEC
if time_left_ms > threshold_ms
is_draw_ready := false
// ==============================================================================
// 【05】 このコード固有の計算仕様 (Specific Indicator Logic)
// ==============================================================================
// 1. 純正RSIの計算
float raw_rsi = ta.rsi(i_src, i_len)
// 2. 平滑化処理の共通関数
f_calc_smooth(type_str, src_val, len_val) =>
float res = na
switch type_str
"SMA" => res := ta.sma(src_val, len_val)
"EMA" => res := ta.ema(src_val, len_val)
"WMA" => res := ta.wma(src_val, len_val)
res
// 平滑化ラインの計算
float raw_ma1 = f_calc_smooth(i_ma1_type, raw_rsi, i_ma1_len)
float raw_ma2 = f_calc_smooth(i_ma2_type, raw_rsi, i_ma2_len)
// 3. データ引き渡し
float final_rsi = (is_draw_ready and i_show_rsi) ? raw_rsi : na
float final_ma1 = (is_draw_ready and i_show_ma1) ? raw_ma1 : na
float final_ma2 = (is_draw_ready and i_show_ma2) ? raw_ma2 : na
// ==============================================================================
// 【06】 描画と出力 (Rendering & Outputs)
// ==============================================================================
// カラー定義(座標指定から抽出したHEXコード)
color col_rsi = #7E57C2 // 右から3、下から3
color col_lvl_70 = #787B86 // 右から5、上から1
color col_lvl_50 = color.black // 右から1、上から1
color col_lvl_30 = #787B86 // 右から5、上から1
// メインラインの描画
plot(final_rsi, title="NK-Fixed RSI", color=col_rsi, linewidth=1, style=plot.style_line)
plot(final_ma1, title="스무딩 1", color=color.green, linewidth=1, style=plot.style_line)
plot(final_ma2, title="스무딩 2", color=color.blue, linewidth=1, style=plot.style_line)
// 標準的な水平線の描画 (70, 50, 30)
h70 = hline(70, title="레벨 1", color=col_lvl_70, linestyle=hline.style_dashed)
h50 = hline(50, title="레벨 2", color=col_lvl_50, linestyle=hline.style_dashed)
h30 = hline(30, title="레벨 3", color=col_lvl_30, linestyle=hline.style_dashed)
// 背景の塗りつぶし (不透明度10% = Pine Scriptの透明度90)
fill(h70, h30, title="배경", color=color.new(col_rsi, 90))
// ユーザー追加ライン (Extra Line) - デフォルトは非表示(スタイルタブで設定可能)
hline(50, title="레벨 4", color=color.black, linestyle=hline.style_solid, display=display.none)
hline(50, title="레벨 5", color=color.black, linestyle=hline.style_solid, display=display.none)
// 3. アラート(通知)条件の統合
bool overbought = ta.crossover(raw_rsi, 70) and is_draw_ready
bool oversold = ta.crossunder(raw_rsi, 30) and is_draw_ready
alertcondition(overbought, title="RSI Over 70", message="NK-Fixed RSI crossed over 70")
alertcondition(oversold, title="RSI Under 30", message="NK-Fixed RSI crossed under 30")
* 원하는 색상으로 설정한 후, 설정 탭에서 '기본값으로 저장'을 눌러주세요.
* 새로 만들기 -> 지표 -> 붙여넣기 순서로 진행하지 않으면 정상적으로 표시되지 않을 수 있습니다.