Commencer PRINT 10 jours avant Today

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #255050 quote
    umrk
    Participant
    New

    Bonjour,

    A la fin d’un indicateur, je veux lancer des PRINT, mais seulement si je suis près proche de la date du jour (Today), disons 10 jours avant, pour être bien sûr qu’avant d’imprimer j’ai bien calculé tout ce qui m’intéresse.

    Je sais comment détecter que je suis sur la dernière barre, avec :

    LastBarOnChart=Date=Today

    Mais comment détecter que je suis sur la barre &à jours avant ?

    LastBarOnChart10DaysBefore=Date=Today[10] ne marche pas !!!!

    #255051 quote
    robertogozzi
    Moderator
    Master

    Essayez ceci :

    defparam DrawOnLastBarOnly = true
    myRSI = Rsi[14](close)
    print myRSI        //print the current RSI
    print myRSI[10]    //print RSI 10 bars before the current one
    return
    Iván González thanked this post
    #255052 quote
    umrk
    Participant
    New

    Merci, mais cela ne satisfait pas mon besoin. J’ai besoin de lancer mes PRINT sur les 10 dernières valeurs de BarIndex, pour obtenir le résultat en colonne que je souhaite …

    #255056 quote
    JS
    Participant
    Senior

    Bonjour,

    If Date >= Today-10 then

    Print(…)

    EndIf

    Iván González and robertogozzi thanked this post
    #255058 quote
    umrk
    Participant
    New

    Date10DaysBefore=Today-10
    TestDate=Date=Date10DaysBefore
    IF TestDate Then
    PRINT Date10DaysBefore AS “Date10DaysBefore”
    ENDIF

     

    ne marche pas (et c’est logique, la date courante  n’est jamais égale à celle de 10 jours avant)

    #255059 quote
    umrk
    Participant
    New

    en fait il faudrait que j’arrive à trouver la valeur de LastBarOnChart SANS utiliser Today ….

    #255060 quote
    JS
    Participant
    Senior

    La bonne approche consiste à comparer le BarIndex courant avec le BarIndex de la dernière barre…

    If BarIndex>=BarIndex-10 then

    Print(…)

    EndIf

    #255061 quote
    umrk
    Participant
    New

    Mais Barindex est TOUJOURS >= BarIndex-10, non ?

     

    Si je pouvais trouver le nombre total de barres dans le graphe sans utiliser Today mon problème serait résolu

    #255063 quote
    JS
    Participant
    Senior

    C’est ça, je vois le problème…

    #255199 quote
    umrk
    Participant
    New

    Bon en fait c’était tout simple, il suffit de faire :

    TenDaysBeforeLastBarOnChart=Date>Today-10

     

    (sauf qu’on a pas forcément 10 jours puisque qu’on n’a que les jours de bourse, mais c’est pas grave)

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

Commencer PRINT 10 jours avant Today


Support Plateforme : Graphiques, Données & Courtiers

New Reply
Author
author-avatar
umrk @umrk Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by umrk
1 month, 2 weeks ago.

Topic Details
Forum: Support Plateforme : Graphiques, Données & Courtiers
Language: French
Started: 01/07/2026
Status: Active
Attachments: No files
Logo Logo
Loading...