Variable Moving Average (VMA)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #207580 quote
    diegogasparotodiegogasparoto
    Participant
    New

    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 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Variable Moving Average (VMA)


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/17/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...