Aide Code : changement d’état de variable=n/d

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #235657 quote
    RicLg
    Participant
    Senior

    Bonjour
    Comment identifier le changement d’état d’une variable lorsque
    variable = n/d    =undefined?          print(variable)
    Je voudrai juste récupérer le BarIndex lors du 1er changement d’état.
    Merci pour vos aides.
    Bien à Vous

    #235668 quote
    RicLg
    Participant
    Senior

    Re-bonjour
    Pour compléter ma demande, voici le code et une image-jointe.
    Je souhaite obtenir le barIndex du 8 novembre 2022.

    Merci de nouveau.
    Bien à Vous.

    periode1 = 100
    Mb2 = Average[periode1](close[5])
    lengthRSI   = 75 
    lengthStoch = 75 
    rem --
    myRSI = RSI[lengthRSI](Mb2)                    
    MinRSI = lowest[lengthStoch](myRSI)
    MaxRSI = highest[lengthStoch](myRSI)
    StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
    print ( StochRSI)
    
    return  StochRSI as "StochRSI"
    #235674 quote
    RicLg
    Participant
    Senior

    Je complète de nouveau.

    Lorsque je passe en UT 2 jours

    Je suis dans cette situation, et j’aimerai obtenir le barIndex du 6 juin 2023 (voir img1a).

    Merci

    Bien à vous

    #235677 quote
    Iván González
    Moderator
    Master
    periode1 = 100
    Mb2 = Average[periode1](close[5])
    lengthRSI   = 75
    lengthStoch = 75
    rem --
    myRSI = RSI[lengthRSI](Mb2)
    MinRSI = lowest[lengthStoch](myRSI)
    MaxRSI = highest[lengthStoch](myRSI)
    StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
    
    if stochRSI>=0  then
    else
    bar=barindex
    endif
    print bar
    
    return  StochRSI as "StochRSI"
    #235696 quote
    RicLg
    Participant
    Senior

    J’ai ajouté un bout de code pour identifier le barIndex concerné (img2)
    Merci Iván pour le solution.

     

    periode1 = 100
    Mb2 = Average[periode1](close[5])
    lengthRSI   = 75
    lengthStoch = 75
    rem --
    myRSI = RSI[lengthRSI](Mb2)
    MinRSI = lowest[lengthStoch](myRSI)
    MaxRSI = highest[lengthStoch](myRSI)
    StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
     
    if stochRSI>=0  then
    else
    stochRSI=0
    endif
    rem -----------------------------------
    rem BarIndex du 1er changement d’état
    if StochRSI>0 and StochRSI[1]=0  then     
    bar=barIndex
    endif
    DRAWVLINE(bar) style(DOTTEDLINE4 ,2)
     
    return  StochRSI as "StochRSI"
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Aide Code : changement d’état de variable=n/d


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
RicLg @riclg Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by RicLg
1 year, 6 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/23/2024
Status: Active
Attachments: 3 files
Logo Logo
Loading...