OPEN-SOURCE SCRIPT

Market Indicator by Atilla Yurtseven

מעודכן
This TradingView script is designed to analyze and visualize market trends by showing the percentage drops from the all-time high (ATH) of a stock or any other financial instrument. It also calculates and displays key statistical levels such as the mean, median, and various percentage thresholds. This indicator helps traders identify significant retracement levels and possible support/resistance zones based on historical price movements.

  • Indicator Settings:
    - The indicator is named "Market // Atilla Yurtseven" and can be overlaid on the price chart.
    - Users can choose to use the closing price (Use Close Price) or the high/low prices.
    - Options are provided to show the ATH, ATL (All-Time Low), mean, median, and various minor and macro percentage levels.

  • Color Customization:
    - The script allows customization of text and line colors for different levels, making it adaptable to different charting styles.

  • Initial Variable Setup:
    - The script initializes several variables, including ATH, ATL, and arrays to store price data.
    The round and roundy functions are used to format the values for display purposes.

  • ATH/ATL Calculation:
    - The script checks if the current price exceeds the previous ATH and updates the ATH accordingly.
    - Similarly, the script calculates the ATL based on the lowest point after reaching the ATH.

  • Mean and Median Calculation:
    - The mean is calculated as the average drop from the ATH, while the median is the middle value in the sorted array of drops.
    - These statistics provide insight into the overall trend and are used to identify significant price levels.

  • Plotting the Levels:
    The script plots the ATH, ATL, mean, median, and various percentage retracement levels (12.5%, 25%, 37.5%, etc.).
    The levels are color-coded based on user preferences, making it easier to interpret the chart visually.

  • Labels and Text Display:
    - The script dynamically creates and updates labels on the chart to show the values of the ATH, ATL, mean, median, and other key levels.
    - This feature allows traders to see at a glance how far the current price is from these critical levels.

  • Hit Detection:
    - The script includes logic to detect if the price is within the range of the mean and median. If the price is within this range, the color of the fill between these levels changes, highlighting this area on the chart.


This script is a powerful tool for traders who want to analyze the retracement levels from historical highs. By displaying the mean, median, and various percentage levels, it provides a comprehensive view of potential support and resistance areas, helping traders make more informed decisions. The customizable nature of the script allows it to fit seamlessly into different trading strategies and charting styles.

Disclaimer:

This script is provided for informational and educational purposes only and does not constitute financial or investment advice. The author, Atilla Yurtseven, is not responsible for any financial losses or damages that may occur as a result of using this script. Trading and investing in financial markets involve risk, and past performance is not indicative of future results. Users should conduct their own research and consult with a qualified financial advisor before making any investment decisions. Use this script at your own risk.

Trade smart, stay safe.

Atilla Yurtseven
הערות שחרור
Due to TradingView house rules, I received a warning for publishing two similar indicators separately. Therefore, I updated the script so that both the indicator and the oscillator work on the same script. Additionally, the oscillator plots in candlestick form.
CyclesforecastingTrend Analysis

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?


I know Kung-Fu!
גם על:

כתב ויתור