Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting Andean Oscillator from Pinescript to Ninjascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Converting Andean Oscillator from Pinescript to Ninjascript

    Hi all,
    I was hoping if anyone would find an interest in converting over this great indicator called the Andean Oscillator from TradingView.
    https://www.tradingview.com/script/x...an-Oscillator/

    I've been searching for a substitute to use on NT 8 but to no avail hence my request. Its integral to my strategy so any help would be greatly appreciated!


    // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © alexgrover

    //Original post : Alpaca.markets/learn/andean-oscillator-a-new-technical-indicator-based-on-an-online-algorithm-for-trend-analysis/

    //@version=5
    indicator("Andean Oscillator")
    //------------------------------------------------------------------------------
    //Settings
    //-----------------------------------------------------------------------------{
    length = input(50)

    sig_length = input(9,'Signal Length')

    //-----------------------------------------------------------------------------}
    //Exponential Envelopes
    //-----------------------------------------------------------------------------{
    var alpha = 2/(length+1)

    var up1 = 0.,var up2 = 0.
    var dn1 = 0.,var dn2 = 0.

    C = close
    O = open

    up1 := nz(math.max(C, O, up1[1] - (up1[1] - C) * alpha), C)
    up2 := nz(math.max(C * C, O * O, up2[1] - (up2[1] - C * C) * alpha), C * C)

    dn1 := nz(math.min(C, O, dn1[1] + (C - dn1[1]) * alpha), C)
    dn2 := nz(math.min(C * C, O * O, dn2[1] + (C * C - dn2[1]) * alpha), C * C)

    //Components
    bull = math.sqrt(dn2 - dn1 * dn1)
    bear = math.sqrt(up2 - up1 * up1)

    signal = ta.ema(math.max(bull, bear), sig_length)

    //-----------------------------------------------------------------------------}
    //Plots
    //-----------------------------------------------------------------------------{
    plot(bull, 'Bullish Component', #089981)

    plot(bear, 'Bearish Component', #f23645)

    plot(signal, 'Signal', #ff9800)

    //-----------------------------------------------------------------------------}​

    #2
    Hello Splinterhead,

    Thank you for your post.

    While our support team does not provide conversion services, this post will remain open for any members of the community who may wish to convert this on your behalf.

    Comment


      #3
      Originally posted by Splinterhead View Post
      Hi all,
      I was hoping if anyone would find an interest in converting over this great indicator called the Andean Oscillator from TradingView.
      https://www.tradingview.com/script/x...an-Oscillator/

      I've been searching for a substitute to use on NT 8 but to no avail hence my request. Its integral to my strategy so any help would be greatly appreciated!


      // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
      // © alexgrover

      //Original post : Alpaca.markets/learn/andean-oscillator-a-new-technical-indicator-based-on-an-online-algorithm-for-trend-analysis/

      //@version=5
      indicator("Andean Oscillator")
      //------------------------------------------------------------------------------
      //Settings
      //-----------------------------------------------------------------------------{
      length = input(50)

      sig_length = input(9,'Signal Length')

      //-----------------------------------------------------------------------------}
      //Exponential Envelopes
      //-----------------------------------------------------------------------------{
      var alpha = 2/(length+1)

      var up1 = 0.,var up2 = 0.
      var dn1 = 0.,var dn2 = 0.

      C = close
      O = open

      up1 := nz(math.max(C, O, up1[1] - (up1[1] - C) * alpha), C)
      up2 := nz(math.max(C * C, O * O, up2[1] - (up2[1] - C * C) * alpha), C * C)

      dn1 := nz(math.min(C, O, dn1[1] + (C - dn1[1]) * alpha), C)
      dn2 := nz(math.min(C * C, O * O, dn2[1] + (C * C - dn2[1]) * alpha), C * C)

      //Components
      bull = math.sqrt(dn2 - dn1 * dn1)
      bear = math.sqrt(up2 - up1 * up1)

      signal = ta.ema(math.max(bull, bear), sig_length)

      //-----------------------------------------------------------------------------}
      //Plots
      //-----------------------------------------------------------------------------{
      plot(bull, 'Bullish Component', #089981)

      plot(bear, 'Bearish Component', #f23645)

      plot(signal, 'Signal', #ff9800)

      //-----------------------------------------------------------------------------}​
      I have this converted already for NT8, send me a DM if you are interested
      Attached Files

      Comment


        #4
        Bonjour, je suis intéressé par cet indicateur.

        Hello, I am interested in this indicator.​

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X