Arnaud Legoux Moving Average

Optuma Forums Optuma Feature Requests Arnaud Legoux Moving Average

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #65117
    Keith
    • Topics: 3
    • Replies: 0
    • Posts: 3

    Could you investigate adding this moving average to Optuma as other packages use it and I have been told it is very useful.  There is plenty of information via Google.  Thanks KM

    Arnaud Legoux Moving Average (ALMA) removes small price fluctuations and enhances the trend by applying a moving average twice, once from left to right, and once from right to left. At the end of this process the phase shift (price lag) commonly associated with moving averages is significantly reduced. Zero-phase digital filtering reduces noise in the signal. Conventional filtering reduces noise in the signal, but adds a delay.

    //@version=3
    study(“Double ALMA”, overlay=true)
    // INPUTS:
    almaLen = input(48, title=”ALMA Length”, minval=1)
    almaOffSet = input(0.15, type=float, title=”ALMA Offset”, minval=0.0, maxval=1.0)
    almaSigma = input(6, title=”ALMA Sigma”, minval=1)
    fastALMALen = input(10, title=”Fast ALMA Length”, minval=1)
    fastALMAOffSet = input(0.75, type=float, title=”Fast ALMA Offset”, minval=0.0, maxval=1.0)
    fastALMASigma = input(6, title=”Fast ALMA Sigma”, minval=1)
    src = input(title=”Source”, type=source, defval=close)
    // FAST AND SLOW AL MOVING AVGS:
    alma = alma(src,almaLen, almaOffSet, almaSigma)
    fastALMA = alma(src, fastALMALen, fastALMAOffSet, fastALMASigma)
    //Upper and lower bands at +/- 1.25 standard deviations.
    stDev = 1.25 * stdev(alma, almaLen * 2)
    upperBand = alma + stDev
    lowerBand = alma – stDev
    // ENTRY AND EXIT CONDITIONS:
    //Bullish when slow ALMA increasing.
    bullish = alma >= alma[1] ? 1 : 0
    //Bearish when slow ALMA decreasing.
    bearish = alma < alma[1] ? 1 : 0
    //True when fast ALMA crosses up over the lower stand. dev. band.
    crossUpLower = fastALMA[1] < lowerBand[1] and fastALMA >= lowerBand
    //True when fast ALMA crosses down under the upper stand. dev. band.
    crossDownUpper = fastALMA[1] > upperBand[1] and fastALMA <= upperBand
    //Enter Long when bearish and crossUpLower is true.
    enterLong = bearish == 1 and crossUpLower
    //Exit Long when Bullish and crossDownUpper is true.
    exitLong = bullish == 1 and crossDownUpper
    //Prevents Repeat Signals.
    lastBuy = barssince(enterLong[1] == 1)
    lastSell = barssince(exitLong[1] == 1)
    buyer = lastBuy > lastSell
    seller = lastSell > lastBuy
    entrySig = buyer and enterLong == 1
    exitSig = seller and exitLong == 1
    bgcolor(entrySig ? lime : na, transp=0)

    #65129
    Mathew
    • Topics: 40
    • Replies: 1,958
    • Posts: 1,998

    Hi Keith,

    We’ll have a look but there are no guarantees it will make the next update.

    All the best

    Mathew

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest