Variable Moving Average (VMA)

Forums ProRealTime English forum ProBuilder support Variable Moving Average (VMA)

Viewing 2 posts - 1 through 2 (of 2 total)
  • #207580

    Hello, I would convert this code to PROFIT PRO, with .psf file extension

     

    //PRC_Variable Moving Average | indicator
    //14.12.2016
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    //converted and adapted from Pinescript version

    // — parameters
    src=customclose
    //l = 6

    if barindex>l then
    k = 1.0/l
    pdm = max((src – src[1]), 0)
    mdm = max((src[1] – src), 0)
    pdmS = ((1 – k)*(pdmS[1]) + k*pdm)
    mdmS = ((1 – k)*(mdmS[1]) + k*mdm)
    s = pdmS + mdmS
    pdi = pdmS/s
    mdi = mdmS/s
    pdiS = ((1 – k)*(pdiS[1]) + k*pdi)
    mdiS = ((1 – k)*(mdiS[1]) + k*mdi)
    d = abs(pdiS – mdiS)
    s1 = pdiS + mdiS
    iS = ((1 – k)*(iS[1]) + k*d/s1)
    hhv = highest[l](iS)
    llv = lowest[l](iS)
    d1 = hhv – llv
    vI = (iS – llv)/d1
    vma = (1 – k*vI)*(vma[1]) + k*vI*src
    endif

    RETURN VMA
    <table class=”crayon-table” style=”height: 638px;” width=”16″>
    <tbody>
    <tr class=”crayon-row”>
    <td class=”crayon-nums ” data-settings=”show”>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32

    </td>
    <td class=”crayon-code”></td>
    </tr>
    </tbody>
    </table>

    #207590

    This forum only supports the ProRealTime platform.

    Conversions to PRT are free.

    For other conversations you must apply for paid services at https://www.prorealcode.com/trading-programming-services/.

     

Viewing 2 posts - 1 through 2 (of 2 total)

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