Tradespot

ADW - Colour Trend

Tradespot 업데이트됨   
Colour Trend is an indicator that will give you a visual representation of the trend in a selected market, and alert you when the trend changes. The green colour represents a bullish trend (prices are going up), the red colour represents a bearish trend (prices are going down), and silver represents a neutral trend (prices are relatively stable). The script calculates these trends based on the relative price levels and their moving averages.

Below is a breakdown of the script so you can better understand how these trends are defined.

  • Function f_p(_length, price): This function calculates the price relative to its highest and lowest point over the given `_length` of time. This calculation is normalized by multiplying it by 100, giving us a percentage-like measure.
  • User Inputs: The length of the period (default 12), you can choose to show or hide bar colours (default is true).
  • Variables cycle_avg, cycle_counter, cycle_count, cycle_trend, cycle_col: These variables are used to calculate the trend cycles. The `cycle_avg` is the average trend cycle, `cycle_counter` keeps track of the current trend cycle, `cycle_count` counts the total number of cycles, `cycle_trend` keeps track of the direction of the cycle (1 for up, -1 for down), and `cycle_col` defines the colour of the current cycle.
  • Variables ph, pl, avg, mean: These variables calculate the price level relative to the highest and lowest prices (`ph` and `pl`), the average of these two levels (`avg`), and the cumulative average of the price level (`mean`).
  • Conditionals for cycle trend: The if-statements are checking whether the price level has reached a trend extreme and then updating the trend cycle, colour, count, and average accordingly.
  • Variable col and bar color: The variable `col` is used to define the colour of the bars based on the average price level. If the `show_barcolor` is true, the colour is determined based on the `avg` value.
  • Alert Conditions: These are conditions that will send alerts to the user when the trend changes. Specifically, the alerts occur when the colour changes from non-green to green (bull trend), from non-red to red (bear trend), or from non-silver to silver (no trend).
릴리즈 노트:
  • Initialised variables to 'na' for consistency
  • Simplified alert conditions for readability
릴리즈 노트:
Updated license

Wizard money evangelist 🪄✨
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?