Help with conversion of Pinescipt code

Forums ProRealTime English forum ProBuilder support Help with conversion of Pinescipt code

Viewing 5 posts - 1 through 5 (of 5 total)
  • #199405

    Hi

    Could someone please help with the conversion of the second line of code ….. I can convert the first line

    rsi14 = rsi(src, 14)
    // => rsi14 = RSI[14](close)
    k14 = sma(stoch(rsi14, rsi14, rsi14, 14), smoothK1)

    Thanks Denmar

    #199406

    .oops .sorry … smoothK1 is just a value

    #199421
    JS

    I think this is the right conversion:

    smoothK1 = 5

    rsi14 = RSI[14](close)

    xStoch = 100 * (rsi14 – Lowest[14](rsi14)) / (Highest[14](rsi14) – Lowest[14](rsi14))

    k14 = Average[smoothK1](xStoch)

    Return k14

     

     

    #199438
    JS

    A little explanation:

    In TradingView / PineScript, the Stochastic is a built-in formula that is calculated with:

    Stoch = 100 * (Close – Lowest (Low, Length)) / (Highest(High, Length) – Lowest(Low, Length)

    De syntax is: Stoch (source, high, low, length)

    As you can see, the original script uses Stoch (rsi14, rsi14, rsi14, 14)

    So the source = rsi14, the high of rsi14, the low of rsi14, length = 14

    xStoch = 100 * (rsi14 – Lowest[14](rsi14)) / (Highest[14](rsi14) – Lowest[14](rsi14))

    1 user thanked author for this post.
    #199448

    Thank you so much.

Viewing 5 posts - 1 through 5 (of 5 total)

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