Screener Plus haut du mois précédent

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #126543 quote
    rodmcban
    Participant
    Junior

    Bonjour tout le monde,

    Je vous soumets un bout de code où j’utilise le TF daily pour détecter les jours appartenant au mois précédent afin de calculer le plus haut sur cette période.

    Si j’appelle la fonction highest avec une entier, pas de problème. Si cet entier est le résultat d’un calcul, plus de réponse ! Est-ce un problème de type implicite float au lieu de integer ? J’ai essayé d’appliquer round(monthsize) mais même problème.

    Merci d’avance pour tout tuyau !

    Bien à vous,

    Julien

    timeframe(daily)
    
    idxend = 0
    idxbegin = 0
    
    for i = 0 to 62 do
    // Détection du changement de mois et sauvegarde de l'indice correspondant
    // et de l'indice du mois précédent
    if (month[i] <> currentmonth) and (idxend = 0) then  
    idxend = i
    prevmonth = month[i]
    endif
    // Détection de l'indice du début du mois précédent
    if (idxend <>0 ) and (month[i] <> prevmonth) and (idxbegin = 0) then
    idxbegin = i
    endif
    next
    
    // Nombre de bougies journalières dans le mois précédent
    monthsize = idxbegin - idxend
    
    // Calcul du plus haut des hauts sur le mois précédent
    // Le screener ne rend rien
    mh = highest[monthsize](high[idxend])
    
    #126545 quote
    Nicolas
    Keymaster
    Master

    En effet, monthsize doit être de type entier positif et non nul.

    En général on s’en assure avec :

    mh = highest[max(1,monthsize)](high[idxend])
    rodmcban thanked this post
    #126547 quote
    rodmcban
    Participant
    Junior

    Super, merci Nicolas ! En fait je venais juste de trouver l’astuce et j’allais poster la réponse !

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

Screener Plus haut du mois précédent


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
rodmcban @rodmcban Participant
Summary

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

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 04/17/2020
Status: Active
Attachments: No files
Logo Logo
Loading...