Conversion of ADX moving average from TradingView

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #232532 quote
    mathiasKN
    Participant
    New

    Hello,

    Would kindly ask someone to please translate ADX smoothing Moving Average with trend color change.

     

    This is the code from TradingView:

    study(title=”Moving Average ADX”, shorttitle=”MA ADX”, overlay=true)

    lenadx = input(14, minval=1, title=”DI Length”)
    lensig = input(14, title=”ADX Smoothing”, minval=1, maxval=50)
    limadx = input(18, minval=1, title=”ADX MA Active”)

    up = change(high)
    down = -change(low)
    trur = rma(tr, lenadx)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, lenadx) / trur)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, lenadx) / trur)
    sum = plus + minus
    adx = 100 * rma(abs(plus – minus) / (sum == 0 ? 1 : sum), lensig)

    macol = adx > limadx and plus > minus ? lime : adx > limadx and plus < minus ? red :black

    len = input(34, minval=1, title=”Length”)
    src = input(close, title=”Source”)
    out = wma(src, len)
    plot(out, color=macol, title=”MA”, linewidth= 3)

    BR,
    Mathias

    #232611 quote
    JS
    Participant
    Senior

    Hi Mathias,

    This indicator, based on the ADX and ATR, is in the library…

    Adaptive ATR-ADX Trend
    Iván González and mathiasKN thanked this post
    #232644 quote
    mathiasKN
    Participant
    New
    Thank you JS for your reply and your recommendation, I believe the one you sent me is good for trailing stops. Although the ADX/DMI indicator that I´ve posted above is more for keeping track of the current trend, and keep you out when in the grey/black zone This is the description from the creator on TV: ADX Smoothing Trend Color Change on Moving Average and ADX Cross. Use on Hourly Charts – Green UpTrend – Red DownTrend – Black Choppy No Trend Posting a pic for further clarification, ADX MA on the upper tab and DMI on the lower. When the DMI- and + are close, the MA line goes grey
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Conversion of ADX moving average from TradingView


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
mathiasKN @mathiaskn Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by mathiasKN
1 year, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/10/2024
Status: Active
Attachments: No files
Logo Logo
Loading...