Ayuda para crear Indicador SCTR

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #188162 quote
    robertogozzi
    Moderator
    Master

    ¿Has comprobado que la línea 1 es la misma que la original?

    #201112 quote
    christophe11560
    Participant
    Senior

    Buenos días a todos,
    Noté que había algunos errores para el cálculo a corto plazo. Adjunto el código corregido (líneas 40,42,44,49,51 de mi código)

    A màs 😉

    christophe

    defparam calculateonlastbars = 100
    defparam drawonlastbaronly = true
    iATR=average[20](tr)
    
    IF TFJour THEN
    P1=200
    P2=125
    P3=50
    P4=20
    p5=13
    elsif TFSemaine then
    P1=40
    P2=25
    P3=10
    P4=4
    p5=52
    endif
    //Long terme:
    //PPO
    F1LT = 100*(close - exponentialaverage[p1](close))/exponentialaverage[p1](close)
    //ROC
    F2LT=ROC[p2](close)
    //Resulat LT
    NoteLT=(F1LT+F2LT)*0.6
    //Moyen terme:
    //PPO
    F1MT = 100*(close - exponentialaverage[p3](close))/exponentialaverage[p3](close)
    //ROC
    F2MT=ROC[p4](close)
    //Resulat MT
    NoteMT=(F1MT+F2MT)*0.3
    //court terme:
    //PPO
    SlowAvgCT    = exponentialAverage[26](close)
    FastAvgCT    = exponentialAverage[12](close)
    DifferenceCT = (FastAvgCT - SlowAvgCT)
    macdPPO=exponentialAverage[9](DifferenceCT)
    PENTEmacdPPO=(macdPPO-macdPPO[3])/3
    if PENTEmacdPPO>1 then
    F1CT=100*0.05
    elsif PENTEmacdPPO<-1 then
    F1CT=-100*0.05
    else
    F1CT=(PENTEmacdPPO+1)*50*0.05
    endif
    //RSI
    RSIct=Rsi[14](close)
    if RSIct>50 then
    F2CT=100*0.05
    elsif RSIct<=50 then
    F2CT=-100*0.05
    endif
    //Resulat CT
    NoteCT=(F1CT+F2CT)
    // Rapport
    RPP = NoteLT+NoteMT+NoteCT
    XR = round (RPP)
    // Evolution du rapport dans le temps
    EvolXR=round(100*(XR-XR[p5])/XR[p5])
    if xr > 0 then
    drawtext("Note:#XR# ,GL depuis 3 mois:#EvolXR#% ",barindex+decalagetexte,low-iatr*2,Dialog,Bold,14) coloured(0,102,255)
    elsif xr =< 0 then
    drawtext("Note:#XR# ,GL depuis 3 mois:#EvolXR#% ",barindex+decalagetexte,low-iatr*2,Dialog,Bold,14) coloured(204,0,0)
    endif
    return
    
    robertogozzi thanked this post
    #215118 quote
    christophe11560
    Participant
    Senior

    Buenos dias,
    El principio de puntuación del SCTR debe variar entre 0 y 99.
    Los resultados obtenidos con este código pueden ser mayores a 100 o negativos.
    Tiene alguna idea de cómo devolver el resultado a un valor entre 0 y 100??

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Ayuda para crear Indicador SCTR


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
mateo @mateo Participant
Summary

This topic contains 17 replies,
has 7 voices, and was last updated by christophe11560
2 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 03/19/2021
Status: Active
Attachments: 5 files
Logo Logo
Loading...