Indicateur défaillant

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #129991 quote
    Lurubu
    Participant
    Senior
    // Calcul MACD
    Zero = 0
    MMc = average[9]
    MMl = average[19]
    
    MADC = MMc - MMl
    
    // Recherche des PH
    If MADC[1] < MADC[2] and MADC[1] < MADC and MADC < 0 then
    DrawArrowUp(BarIndex[0],MADC[1] ) coloured(0,150,0)
    endif
    
    If MADC[1] > MADC[2] and MADC[1] > MADC and MADC > 0 then
    DrawArrowDown(BarIndex[0],MADC[1] ) coloured(255,50,0)
    endif
    
    return MADC as "MADC",Zero as "Zero"
    

    Bonjour, ce code simple ne fonctionne pas sur toutes les valeurs (voir exemples)

    sans que je comprenne pourquoi.

    Pouvez vous m’aider ?

    Merci

    Ex-2.png Ex-2.png Ex-1.png Ex-1.png
    #129997 quote
    JC_Bywan
    Moderator
    Master

    Si ce que tu veux dans la 2e image c’est une flèche verte malgré la ligne 9 qui a parmi ses conditions que ta variable “madc” de la bougie en cours soit négative, alors il est normal de ne pas avoir la flèche verte car ton “madc” est repassé positif, rien de défaillant.

    Si tu veux modifier le code pour inclure ce cas, alors sur les 3 valeurs consécutives de madc c’est celle du milieu plutôt que celle en cours qui doit être testée pour voir si elle est négative, ce qui donnerait en ligne 9:

    If MADC[1] < MADC[2] and MADC[1] < MADC and MADC[1] < 0 then

    (et  aussi en ligne 13 madc[1]>0 par symétrie)

    #130000 quote
    Lurubu
    Participant
    Senior

    Merci de ta réponse.

    En fait, je me suis aperçu de mon erreur qui venait de ce que la condition >0 ou <0 n’apparaissait pas dans le screener attaché.

    C’est l’erreur bête.

    Merci tout de même.

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

Indicateur défaillant


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Lurubu @lurubu Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Lurubu
5 years, 10 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/05/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...