Help with conversion of Pinescipt code

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #199405 quote
    denmardenmar
    Participant
    Veteran
    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 quote
    denmardenmar
    Participant
    Veteran
    .oops .sorry … smoothK1 is just a value
    #199421 quote
    JSJS
    Participant
    Master
    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 quote
    JSJS
    Participant
    Master

    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))

    denmar thanked this post
    #199448 quote
    denmardenmar
    Participant
    Veteran
    Thank you so much.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Help with conversion of Pinescipt code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
denmar @denmar Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by denmardenmar
4 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/22/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...