OPEN-SOURCE SCRIPT
업데이트됨 Median Kijun-Sen [InvestorUnknown]

The Median Kijun-Sen is a versatile technical indicator designed for both trend-following strategies and long-term market valuation. It incorporates various display modes and includes a backtest mode to simulate its performance on historical price action.
Key Features:
1. Trend-Following and Long-Term Valuation:

2. Display Modes:
The indicator can be displayed in three main modes, each serving a different purpose:


3. Backtest Functionality:
Pine Script®

4. Hint Table for Pane Suggestions:
An inbuilt hint table guides users on how to best visualize the indicator in different display modes:
This table also provides step-by-step instructions on how to move the indicator to a different pane and adjust scaling, making it user-friendly.

Potential Weakness
Alerts
Summary
Key Features:
1. Trend-Following and Long-Term Valuation:
- The indicator is ideal for trend-following strategies, helping traders identify entry and exit points based on the relationship between price and the Kijun-Sen calculated from median price (customizable price source).
- With longer-term settings, it can also serve as a valuation tool (in oscillator display mode), assisting in identifying potential overbought or oversold conditions over extended timeframes.
2. Display Modes:
The indicator can be displayed in three main modes, each serving a different purpose:
- Overlay Mode: Plots the Median Kijun-Sen directly over the price chart, useful for visualizing trends relative to price action.
- Oscillator Mode: Displays the oscillator that compares the current price to the Median Kijun-Sen, providing a clearer signal of trend strength and direction
- Backtest Mode: Simulates the performance of the indicator with different settings on historical data, offering traders a way to evaluate its reliability and effectiveness without needing TradingView's built-in strategy tool
3. Backtest Functionality:
- The inbuilt backtest mode enables users to evaluate the indicator's performance across historical data by simulating long and short trades. Users can customize the start and end dates for the backtest, as well as specify whether to allow long & short, long only, or short only signals.
- This backtest functionality mimics TradingView's strategy feature, allowing users to test the effectiveness of their chosen settings before applying them to live markets.
equity(series int sig, series float r, startDate, string signals, bool endDate_bool) =>
if time >= startDate and endDate_bool
float a = 0
if signals == "Long & Short"
if sig[1] > 0
a := r
else
a := -r
else if signals == "Long Only"
if sig[1] > 0
a := r
else if signals == "Short Only"
if sig[1] < 0
a := -r
else
runtime.error("No Signal Type found")
var float e = na
if na(e[1])
e := 1
else
e := e[1] * (1 + a)
float r = 0.0
bool endDate_bool = use_endDate ? (time <= endDate ? true : false) : true
float eq = 1.0
if disp_mode == "Backtest Mode"
r := (close[0] - close[1]) / close[1]
eq := equity(sig, r, startDate, signals, endDate_bool)
4. Hint Table for Pane Suggestions:
An inbuilt hint table guides users on how to best visualize the indicator in different display modes:
- For Overlay Mode, it is recommended to use the same pane as the price action.
- For Oscillator and Backtest Modes, it is advised to plot them in a separate pane for better clarity.
This table also provides step-by-step instructions on how to move the indicator to a different pane and adjust scaling, making it user-friendly.
Potential Weakness
- One of the key drawbacks is the indicator’s tendency to produce false signals during price consolidations, where price action lacks clear direction and may trigger unnecessary trades. This is particularly noticeable in markets with low volatility.
Alerts
- The indicator includes alert conditions for when it crosses above or below key levels, enabling traders to receive notifications of LONG or SHORT signals.
Summary
- The Median Kijun-Sen is a highly adaptable tool that serves multiple purposes, from trend-following to long-term valuation. With its customizable settings, backtest functionality, and built-in hints, it provides traders with valuable insights into market trends while allowing them to optimize the indicator to their specific strategy.
- This versatility, however, comes with the potential weakness of false signals during consolidation phases, so it's most effective in trending markets.
릴리즈 노트
Updated the code to pinescript v6, added backtesting library v2 with more backtesting functions and removed old backtesting functions from the code오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.