indicateur maison renvoyant des données erronées

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #205495 quote
    finplus
    Participant
    Master

    Bonsoir,

    j’ai programmé un petit indicateur maison.

    // KAMA200
    
    Period1 = 200
    FastPeriod1 = 2
    SlowPeriod1 = 30
     
    Fastest1 = 2 / (FastPeriod1 + 1)
    Slowest1 = 2 / (SlowPeriod1 + 1)
    if barindex < Period1+1 then
    Kama200=close
    else
    Num1 = abs(close-close[Period1])
    Den1 = summation[Period1](abs(close-close[1]))
    ER1 = Num1 / Den1
    Alpha1 = SQUARE(ER1 *(Fastest1 - Slowest1 )+ Slowest1)
    KAMA200 = (Alpha1 * Close) + ((1 -Alpha1)* Kama200[1])
    endif
    
    Period = 50
    
    xClose = (Open+High+Low+Close)/4
    
    
    Distance = xclose- kama200
    
    
    if distance > 0 then
    distanceUp = distance
    endif
    
    if distance < 0 then
    distanceDn = distance
    endif
    
    
    EcartUp = exponentialaverage[period](distanceup)
    EcartDn = exponentialaverage[period](distanceDn)
    
    
    
    if ecartUp > -ecartDn then
    spreadUp = ecartUp
    elsif ecartUp < -ecartDn then
    spreadUp = -ecartDn
    endif
    
    if ecartDn < -ecartUp then
    spreadDn = ecartDn
    elsif ecartDn > -ecartUp then
    spreadDn = -ecartUp
    endif
    
    period = 50
    dev = 2.0
    
    MA = average[period](distance)
    BolUp = average[50](spreadUp+STD[period]*dev)
    BolDn = average[50](spreadDn-STD[period]*dev)
    
    
    return Distance as "distance", spreadUp as "EcartUp", spreadDn as "EcartDn", BolUp as "Boll Sup", BolDn as "Boll Inf", MA as "Boll Milieu"

    or, j’ai programmé un screener identifiant les changements de direction tels que :

    ignored, ecartup, ignored, ignored, ignored, ignored = CALL “Distance cours / KAMA”(close)
    c5changeup = ( ecartup > ecartup[1]) and (ecartup[1] < ecartup[2])

    ignored, ignored, ecartdn, ignored, ignored, ignored = CALL “Distance cours / KAMA”(close)

    c6changedn = (ecartdn < ecartdn[1]) and (ecartdn[1] > ecartdn[2])

    SCREENER[(c5changeup AND c6changedn)] ((close/DClose(1)-1)*100 AS “% Veille”)

    j’ai un problème dans la mesure où le screener me renvoie des éléments erronés.

    Quelqu’un pourrait il voir ce qui ne fonctionne pas dans mon indicateur ? Je pense que le problème vient du calcul des ecartup et ecartdn.

    Merci

    #205690 quote
    finplus
    Participant
    Master

    Bonjour,

    je me permets de remonter ma demande.

    Merci.

    #205691 quote
    JC_Bywan
    Moderator
    Master

    Externaliser un morceau du code dans un indicateur ne change pas son historique par rapport à celui du screener, donc même problème et mêmes réponses que https://www.prorealcode.com/topic/franchissement-de-limites/

    #205700 quote
    finplus
    Participant
    Master

    Merci pour la réponse.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

indicateur maison renvoyant des données erronées


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by finplus
3 years, 3 months ago.

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