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 sjsj2732, Today, 04:31 AM
        0 responses
        20 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        280 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        279 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        130 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        90 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X