Changer les couleurs de l'indicateur VMA

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #18975 quote
    supertiti
    Participant
    Master

    Bonjour Nicolas,

    Est-il possible d’avoir la version avec les trois couleurs (hausse,range,baisse) de l’indicateur VMA que tu nous propose.

    merci.

     //  VMA LB
    
    src=close
    l =input(6, title="VMA Length") 
    std=input(false, title="Show Trend Direction")
    bc=input(false, title="Color bars based on Trend")
    k = 1.0/l
    pdm = max((src - src[1]), 0)
    mdm = max((src[1] - src), 0)
    pdmS = ((1 - k)*nz(pdmS[1]) + k*pdm)
    mdmS = ((1 - k)*nz(mdmS[1]) + k*mdm)
    s = pdmS + mdmS
    pdi = pdmS/s
    mdi = mdmS/s
    pdiS = ((1 - k)*nz(pdiS[1]) + k*pdi)
    mdiS = ((1 - k)*nz(mdiS[1]) + k*mdi)
    d = abs(pdiS - mdiS)
    s1 = pdiS + mdiS
    iS = ((1 - k)*nz(iS[1]) + k*d/s1)
    hhv = highest(iS, l) 
    llv = lowest(iS, l) 
    d1 = hhv - llv
    vI = (iS - llv)/d1
    vma = (1 - k*vI)*nz(vma[1]) + k*vI*src
    
    vmaC=(vma > vma[1]) ? 
    
    green : (vma<vma[1]) ?
    red : (vma==vma[1]) ?
    blue : black 
    plot(vma, color=std?vmaC:black, linewidth=3, title="VMA")
    barcolor(bc?vmaC:na)
    
    VMA-LB.jpg VMA-LB.jpg
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Changer les couleurs de l'indicateur VMA


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
supertiti @supertiti Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 12/22/2016
Status: Active
Attachments: No files
Logo Logo
Loading...