InvestorUnknown

Aroon ForLoop [InvestorUnknown]

Overview

The Aroon ForLoop indicator is designed to calculate an array of Aroon values over a range of lengths, providing trend signals based on various moving averages. It offers flexibility with different signal modes and visual customizations.

User Input

  • Start Length (a) and End Length (b): Defines the range for calculating Aroon values.
  • MA Type (maType) and MA Length (c): Selects the moving average type (EMA, SMA, WMA, VWMA, TMA) and its length.
  • Calculation Source (s): Specifies the data source for calculations.
  • Signal Mode (sigmode): Offers options like Fast, Slow, Thresholds Crossing, and Fast Threshold to generate signals.
  • Thresholds: Configures long and short thresholds for signal generation.
  • Visualization Options: Customizes bull and bear colors, and enables/disables bar coloring.
  • Alert Settings: Chooses whether to wait for bar close for alert confirmation.

Signal Calculation

Signal Mode (sigmode): Determines the type of signal generated by the indicator. Options are "Fast", "Slow", "Thresholds Crossing", and "Fast Threshold".
1. Slow: is a simple crossing of the midline (0).
2. Fast: positive signal depends if the current MA > MA or MA is above 0.99, negative signals comes if MA < MA or MA is below -0.99.
3. Thresholds Crossing: simple ta.crossover and ta.crossunder of the user defined threshold for Long and Short.
4. Fast Threshold: signal changes if the value of Aroon MA changes by more than user defined threshold against the current signal

col1 = MA > 0 ? colup : coldn
var color col2 = na
if MA > MA[1] or MA > 0.99
    col2 := colup
if MA < MA[1] or MA < -0.99
    col2 := coldn
var color col3 = na
if ta.crossover(MA,longth)
    col3 := colup
if ta.crossunder(MA,shortth)
    col3 := coldn
var color col4 = na 
if (MA > MA[1] + fastth)
    col4 := colup
if (MA < MA[1] - fastth)
    col4 := coldn

color col = na
if sigmode == "Slow"
    col := col1
if sigmode == "Fast"
    col := col2
if sigmode == "Thresholds Crossing"
    col := col3
if sigmode == "Fast Threshold"
    col := col4
else
    na

Visualization Settings

  • Bull Color (colup): The color used to indicate bullish signals.
  • Bear Color (coldn): The color used to indicate bearish signals.
  • Color Bars (barcol): Option to color the bars based on the signal.

Custom Function

AroonForLoop: Calculates Aroon values over the specified range, determines the trend, and averages the results using the chosen moving average type.

AroonForLoop(a, b, c) =>
    var SignalArray = array.new_float(b - a + 1, 0.0)
    for x = 0 to (b - a)
        len = a + x
        upper = 100 * (ta.highestbars(high, len + 1) + len)/len
        lower = 100 * (ta.lowestbars(low, len + 1) + len)/len
        trend = upper > lower ? 1 : -1
        array.set(SignalArray, x, trend)
    Avg = array.avg(SignalArray)
    float MA = switch maType
        "EMA" =>   ta.ema(Avg,    c)
        "SMA" =>   ta.sma(Avg,    c)
        "WMA" =>   ta.wma(Avg,    c)
        "VWMA" =>  ta.vwma(Avg,   c)
        "TMA" =>   ta.trima(Avg,  c)
        => 
            runtime.error("No matching MA type found.")
            float(na)
    [SignalArray, Avg, MA]

Important Considerations

  • Fast Responses: The Aroon ForLoop indicator is designed for quick identification of trend changes, making it ideal for fast-paced trading environments.
  • Moving Average Types: Supports various MA types (EMA, SMA, WMA, VWMA, TMA) for adaptable smoothing of trend signals.
  • Combination with Other Indicators: For more reliable signals, use this indicator in conjunction with other technical indicators.

오픈 소스 스크립트

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

면책사항

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

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