memoriser le plus bas MACD

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #174248 quote
    BFBF
    Participant
    New

    Bonjour à tous,

    comment svp mémoriser la valeur précédente la plus basse d’une variable dans un indicateur sans notion de durée.

    exemple : Var= -2;-3;-2;-1;-4

    valeur à mémoriser est chronologiquement: -2;-3;-3;-3;-4

    d’avance merci

    #174253 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Bonsoir, si var est son nom, on peut faire varmini=min(var,varmini) en ayant initialisé varmini=var au début pour la barre d’où on veut commencer la série de var

    #174390 quote
    BFBF
    Participant
    New

    Super, un grand merci )))

    #174391 quote
    BFBF
    Participant
    New

    Malheureusement ceci ne conserve pas le plus pas précédent. Min donne le plus petit de 2 valeur (Var et Varmini) Ce que je souhaite c’est mémoriser la plus basse valeur de Var dans le temps même si c’était x barres en arrière. J’espère avoir été plus clair dans ma demande/ D’avance merci

    #174393 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Varmini transporte en lui de bougie en bougie le plus bas en question du passé, faire le min de lui-même avec chaque nouveau var résulte bien en l’obtention de la séquence chronologique -2;-3;-3;-3;-4 telle que demandée. Illustration avec code et image attachée:

    //
    // Simulation de la série Var= -2;-3;-2;-1;-4  proposée chronologiquement à partir du barindex=10 pour l'exemple
    //
    if barindex=10 then
     var=-2
    elsif barindex=11 then
     var=-3
    elsif barindex=12 then
     var=-2
    elsif barindex=13 then
     var=-1
    elsif barindex=14 then
     var=-4
    endif
    //
    // Initialisation de varmini au premier var, puis calcul du varmini via min(var,varmini) tel que proposé dans le post #174253
    //
    if barindex=10 then
     varmini=var
    elsif barindex>10 then
     varmini=min(var,varmini)
    endif
    //
    // Texte rajouté pour illustration
    //
    if barindex>=10 then
     if barindex<=14 then
      DRAWTEXT("var=#var#", barindex, 0, dialog, bold, 14)
     endif
     DRAWTEXT("varmini=#varmini#", barindex, varmini, dialog, bold, 14)
    endif
    //
    // Retour de var en pointillés épais bleu-ciel, et de varmini en ligne pleine fine rouge
    //
    return var coloured(0,255,255) style(dottedline,3) as "var", varmini coloured(255,0,0) style(line,1) as "varmini"
    Memoplusbaschronologique.png Memoplusbaschronologique.png
    #174398 quote
    BFBF
    Participant
    New

    Parfait c’est plus clair, merci pour le temps investi ))

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

memoriser le plus bas MACD


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
BF @bf Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by BFBF
5 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/27/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...