traduzione codice TW ADx Candle

Forums ProRealTime forum Italiano Supporto ProBuilder traduzione codice TW ADx Candle

  • This topic has 1 reply, 2 voices, and was last updated 1 week ago by avatarIván.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #240231

    Buongiorno,

    richiedo cortese traduzione del seguente codice mi sembra piuttosto interessante mi piacerebbe testarlo; grazie come sempre per l’aiuto prezioso.

    https://www.tradingview.com/script/ZTxqGBuF/

    //@version=2
    study(“ADX Candle”,overlay=true)
    len = input(title=”Length”, type=integer, defval=10)
    th = input(title=”threshold”, type=integer, defval=20)

    TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))
    DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0
    DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0

    SmoothedTrueRange = nz(SmoothedTrueRange[1]) – (nz(SmoothedTrueRange[1])/len) + TrueRange
    SmoothedDirectionalMovementPlus = nz(SmoothedDirectionalMovementPlus[1]) – (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus
    SmoothedDirectionalMovementMinus = nz(SmoothedDirectionalMovementMinus[1]) – (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus

    DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
    DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
    DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100
    ADX = sma(DX, len)
    //smooth DI
    di=(sma((DIPlus-DIMinus),5)+(DIPlus-DIMinus))/2

    adxin=(ADX+ADX[14])/2
    cy=cross(ADX,adxin)?black:di>=0 and ADX>th?lime:di<0 and ADX>th?red:ADX<th?silver:na
    barcolor(color=cy)

    #240291

    Ecco qui

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login