new indicator: ALMA TREND DETECTOR

Forums ProRealTime English forum ProBuilder support new indicator: ALMA TREND DETECTOR

Viewing 3 posts - 1 through 3 (of 3 total)
  • #243987

    Hello all,

    I tried to code a trend indicator based on ALMA indicator…so far so good.

    BUT, my coding skills are basic and I couldn`t code the “coloring” of the bars.

    Please could anyone help finalizing this code and adding correct colouring to bars?

    Thank you all very much in advance.

    Regards,

    Micha

    {// ALMA Trend Detector Indicator für ProRealTime

    DEFPARAM CalculateOnLastBars = 1200

    // Eingaben
    inputLength = 48 // Arnaud Legoux MA Länge
    inputOffset = 0.15 // ALMA Offset
    inputSigma = 6 // ALMA Sigma Wert

    // ALMA
    m = (inputOffset * (inputLength – 1))
    s = inputLength / inputSigma

    WtdSum = 0
    CumWt = 0

    FOR k = 0 TO inputLength – 1 DO
    Wtd = EXP(-((k – m) * (k – m)) / (2 * s * s))
    WtdSum = WtdSum + Wtd * Close[inputLength – 1 – k]
    CumWt = CumWt + Wtd
    NEXT

    trendALMA = WtdSum / CumWt

    // Farben
    IF trendALMA >= trendALMA[1] THEN
    r1 = 0
    g1 = 255
    b1 = 255 // Aqua
    ELSE
    r1 = 255
    g1 = 0
    b1 = 255 // Fuchsia
    ENDIF

    IF Low < trendALMA THEN
    r12 = 255
    g12 = 0
    b12 = 0 // Rot
    ELSE
    r12 = 0
    g12 = 255
    b12 = 0 // Grün
    ENDIF

    // Zeichnen der ALMA-Linie
    FOR i = 1 TO BarNumber DO
    DRAWSEGMENT(i-1, trendALMA[i-1], i, trendALMA[i], RGB(r1, g1, b1), 2)
    NEXT

    // Balkenfarben
    BACKGROUNDCOLOR(Low < trendALMA, RGB(r12, g12, b12)) // Rot für Balken unter ALMA //???????
    BACKGROUNDCOLOR(Low >= trendALMA, RGB(0, 255, 0)) // Grün für Balken über ALMA // ????????

    RETURN trendALMA}

    #244012
    JS

    This is with the coloring of the candles…

    3 users thanked author for this post.
    #244097

    @JS

    Hello JS,

    thank you very, very much for your support and help.

    Now, the indicator is completely runnig!

    Bedankt, mein Freund!

    CU all.

    Thank you.

    1 user thanked author for this post.
    avatar JS
Viewing 3 posts - 1 through 3 (of 3 total)

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