Affichage lignes horizontales

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #95963 quote
    fireleg79
    Participant
    Junior

    Bonjour,

    Grâce à ce code, j’affiche automatiquement les lignes horizontales qui correspondent à des plats de droite du système Ichimoku.

    DEFPARAM CalculateOnLastBars = 1000
    
    kijun = (highest[26](High) + lowest[26](Low)) / 2
    kijunold1 = kijun[1]
    
    SenkouB = (highest[52](High) + lowest[52](Low)) / 2
    SenkouBold1 = SenkouB[1]
    
    if DisplayALL = 1 then
    if KijunSEN = 1 then
    if kijun = kijunold1 then
    DRAWHLINE(kijun) coloured (115,8,0)
    endif
    endif
    if SSB = 1 then
    if SenkouB = SenkouBold1 then
    DRAWHLINE(SenkouB) coloured (0,0,0)
    endif
    endif
    if SSBKJ = 1 then
    if SenkouB = SenkouBold1 AND SenkouB = kijun then
    DRAWHLINE(SenkouB) coloured (0,0,0)
    endif
    endif
    endif
    return

    Je voudrais ajouter un code afin de n’afficher que les lignes horizontales comprises dans une plage de -10% à + 10% par rapport au cours de clôture de la dernière bougie.

    Merci pour votre aide!

    Ichiline.jpg Ichiline.jpg
    #95967 quote
    robertogozzi
    Moderator
    Master

    Pour ajouter du code , veuillez utiliser le bouton <> “insert PRT code”. Merci.

    Insert-PRT-Code-FR.png Insert-PRT-Code-FR.png
    #95976 quote
    fireleg79
    Participant
    Junior

    Désolé. Voici le code. Merci.

    DEFPARAM CalculateOnLastBars = 1000
    
    kijun = (highest[26](High) + lowest[26](Low)) / 2
    kijunold1 = kijun[1]
    
    SenkouB = (highest[52](High) + lowest[52](Low)) / 2
    SenkouBold1 = SenkouB[1]
    
    
    if DisplayALL = 1 then
    if KijunSEN = 1 then
    if kijun = kijunold1 then
    DRAWHLINE(kijun) coloured (115,8,0)
    endif
    endif
    if SSB = 1 then
    if SenkouB = SenkouBold1 then
    DRAWHLINE(SenkouB) coloured (0,0,0)
    endif
    endif
    if SSBKJ = 1 then
    if SenkouB = SenkouBold1 AND SenkouB = kijun then
    DRAWHLINE(SenkouB) coloured (0,0,0)
    endif
    endif
    endif
    return
    
    #95988 quote
    Nicolas
    Keymaster
    Master

    Je voudrais ajouter un code afin de n’afficher que les lignes horizontales comprises dans une plage de -10% à + 10% par rapport au cours de clôture de la dernière bougie.

    Vis à vis du cours de clôture de la bougie actuelle, la toute dernière ? Et donc n’utiliser que les anciens plats ? Si oui il faudra utiliser une boucle dans toutes les valeurs du passé car on ne peut pas enregistrer de variables dynamiques et donc limiter la recherche dans les dernières X barres uniquement, je préfère prévenir 🙂

    fireleg79 thanked this post
    #95989 quote
    fireleg79
    Participant
    Junior

    Nicolas,

    Pas uniquement les anciens plats. Les plats “futurs” également.
    Pour la bougie actuelle tout à fait.

    Merci d’avance

    #95990 quote
    Nicolas
    Keymaster
    Master

    Les plats “futurs” également

    ahaha très drôle ! 😆 Je vais sortir la boule de crystal, c’est une nouvelle instruction de programmation.

    Je reviens dés que possible.

    #95991 quote
    fireleg79
    Participant
    Junior

    🙂

    On s’est compris 😉
    Les plats du nuage affiché dans le “futur” évidemment… 🙂

    Merci d’avance

    #95992 quote
    Nicolas
    Keymaster
    Master

    Voilà qui est fait je pense, il faut régler la “period” de recherche, ici sur 300 chandeliers et le “ipercent” d’écart possible, +/-10% par défaut.

    DEFPARAM CalculateOnLastBars = 1000
    DEFPARAM DRAWONLASTBARONLY = true
    
    // ON/OFF
    kijunsen=1
    ssb=1
    ssbkj=1
    period=300
    ipercent= 10 //10% range
    // ----
    
    kijun = (highest[26](High) + lowest[26](Low)) / 2
    kijunold1 = kijun[1]
    
    SenkouB = (highest[52](High) + lowest[52](Low)) / 2
    SenkouBold1 = SenkouB[1]
    
    testkijun = kijun = kijunold1
    testSSB = SenkouB = SenkouBold1
    testSSBKJ = SenkouB = SenkouBold1 AND SenkouB = kijun
    
    for i = 0 to period-1 do
    kijunrange = abs(close-kijun[i])/kijun[i]*100<ipercent/100 
    senkourange = abs(close-senkoub[i])/senkoub[i]*100<ipercent/100
    if KijunSEN = 1 then
    if testkijun[i] and kijunrange then
    DRAWHLINE(kijun[i]) coloured (115,8,0)
    endif
    endif
    if SSB = 1 then
    if testSSB[i] and senkourange then
    DRAWHLINE(SenkouB[i]) coloured (0,0,0)
    endif
    endif
    if SSBKJ = 1 then
    if testSSBKJ[i] and senkourange then
    DRAWHLINE(SenkouB[i]) coloured (0,0,0)
    endif
    endif
    next
    
    return

    Comme tu avais certainement des switchs on/off pour chaque type de ligne dans ton fichier original et qu’ils n’étaient pas présents dans le code que tu as posté, je les ai ajouté dans la tête du code.

    swapping thanked this post
    #95995 quote
    fireleg79
    Participant
    Junior

    J’avais fait les switches avec des variables booléennes.
    J’ai testé mais aucune ligne ne s’affiche :-s

    Une idée où cela pourrait coincer..?

    Encore merci!

    #96015 quote
    Nicolas
    Keymaster
    Master

    J’ai fait une erreur dans les pourcentages, au lieu de se situer à 10%, on était à 0.10%. C’est corrigé :

    DEFPARAM CalculateOnLastBars = 1000
    DEFPARAM DRAWONLASTBARONLY = true
    
    // ON/OFF
    kijunsen=1
    ssb=1
    ssbkj=1
    period=300
    ipercent= 10 //10% range
    // ----
    
    kijun = (highest[26](High) + lowest[26](Low)) / 2
    kijunold1 = kijun[1]
    
    SenkouB = (highest[52](High) + lowest[52](Low)) / 2
    SenkouBold1 = SenkouB[1]
    
    testkijun = kijun = kijunold1
    testSSB = SenkouB = SenkouBold1
    testSSBKJ = SenkouB = SenkouBold1 AND SenkouB = kijun
    
    for i = 0 to period-1 do
    kijunrange = abs(close-kijun[i])/kijun[i]*100<ipercent
    senkourange = abs(close-senkoub[i])/senkoub[i]*100<ipercent
    if KijunSEN = 1 then
    if testkijun[i] and kijunrange then
    DRAWHLINE(kijun[i]) coloured (115,8,0)
    endif
    endif
    if SSB = 1 then
    if testSSB[i] and senkourange then
    DRAWHLINE(SenkouB[i]) coloured (0,0,0)
    endif
    endif
    if SSBKJ = 1 then
    if testSSBKJ[i] and senkourange then
    DRAWHLINE(SenkouB[i]) coloured (0,0,0)
    endif
    endif
    next
    
    return
    
    fireleg79 thanked this post
    plat-kijun-ichimoku.png plat-kijun-ichimoku.png
    #96117 quote
    fireleg79
    Participant
    Junior

    Un grand merci Nicolas!

    #96158 quote
    swapping
    Participant
    Master

    Nicolas, si tu n’y vois pas d’objection je vais me servir d’une partie de ton code pour un autre programme que je suis en train de peaufiner et que je mettrais bien évidement à disposition de tout les utilisateurs de PRT 😉

    Cela fait parti d’un ensemble d’utilitaire un sous forme de DashBoard (à mettre sous le graphique des prix) indiquant le comportement des éléments du système Kinko Hyo qui sera suivie d’un autre programme indépendant visualisant les principaux évènements comportementaliste des cinq lignes avec détection (et visualisation) du Katana, du Twist Crossing ainsi que du Twist Flat et d’autre comme justement les plats de la Senkou SB et la Kijun-Sen

    Bref je vais te la “pirater” pour la bonne cause 😉

    Cordialement Swapping

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

Affichage lignes horizontales


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
fireleg79 @fireleg79 Participant
Summary

This topic contains 11 replies,
has 4 voices, and was last updated by swapping
6 years, 11 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/10/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...