Problème niveau 100

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

    Bonjour,

    Ce code fonctionnait bien, je l’ai retiré puis j’ai voulu le remettre et maintenant il m’affiche une ligne à chaque niveau, soit + 1 à chaque fois
    au lieu de 100 comme demandé.
    Je ne vois pas ce qui cloche, une idée ?

    IF NOT DID THEN
    NV = 0
    FOR NV = 0 TO 30000 DO
    drawhline(NV)coloured("cyan")
    NV = NV + 100 - 1
    NEXT
    ONCE DID = 1
    ENDIF
    RETURN

    Merci

    #195600 quote
    turameturame
    Participant
    Master

    Ce code fonctionne pour moi :

    centaine = round(Close/100) * 100
    //DRAWHLINE (centaine) coloured(0,0,0) STYLE(line,1)
    
    lp2 = centaine + 1000
    //DRAWHLINE (lp2) coloured(0,0,0) STYLE(line,1)
    lp4 = centaine + 2000
    //DRAWHLINE (lp4) coloured(0,0,0) STYLE(line,1)
    lp6 = centaine + 3000
    //DRAWHLINE (lp6) coloured(0,0,0) STYLE(line,1)
    lp8 = centaine + 4000
    //DRAWHLINE (lp8) coloured(0,0,0) STYLE(line,1)
    lp12 = centaine + 5000
    //DRAWHLINE (lp12) coloured(0,0,0) STYLE(line,1)
    
    lm2 = centaine - 1000
    //DRAWHLINE (lm2) coloured(0,0,0) STYLE(line,1)
    lm4 = centaine - 2000
    //DRAWHLINE (lm4) coloured(0,0,0) STYLE(line,1)
    lm6 = centaine - 3000
    //DRAWHLINE (lm6) coloured(0,0,0) STYLE(line,1)
    lm8 = centaine - 4000
    //DRAWHLINE (lm8) coloured(0,0,0) STYLE(line,1)
    lm9 = centaine - 5000
    //DRAWHLINE (lm9) coloured(0,0,0) STYLE(line,1)
    lm10 = centaine - 6000
    //DRAWHLINE (lm10) coloured(0,0,0) STYLE(line,1)
    
    
    Yvan63 thanked this post
    #195634 quote
    NicolasNicolas
    Keymaster
    Legend

    Je ne pense pas que ton code ai fonctionnait ? On ne peut pas modifier l’incrément d’une boucle FOR/NEXT, il est toujours de 1. Dans ce cas utiliser une boucle WHILE/WEND en utilisant un incrément de 100, comme ceci :

    IF NOT DID THEN
     NV = 0
     while NV <= 30000 DO
      drawhline(NV)coloured("cyan")
      NV = NV + 100 
     wend
     ONCE DID = 1
    ENDIF
    RETURN
    Yvan63 thanked this post
    #196408 quote
    Yvan63Yvan63
    Participant
    Senior

    Bonsoir,

    Effectivement j’ai du me tromper …
    En tout cas, cela fonctionne, merci 👍

    #196409 quote
    Yvan63Yvan63
    Participant
    Senior

    Bonsoir,

    Merci pour cette solution 👍

Viewing 5 posts - 1 through 5 (of 5 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

Problème niveau 100


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Yvan63 @yvan63 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Yvan63Yvan63
4 years, 3 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/17/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...