Linea orizzontale e ciclo For

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #237880 quote
    Edisone
    Participant
    Average

    Ciao, sto cercando di tracciare delle line orizzontali al verificarsi delle condizioni (vedi script). Funziona solo per una condizione (la prima) e non capisco il perchè.

    Allego il codice.

    Grazie per l’aiuto

     

    TIMEFRAME(default)
    TF = GetTimeFrame
    
    MM = Average[10](close)
    
    CONDS = HIGH and LOW >= MM
    CONDL = LOW and HIGH <= MM
    
    IF CONDS and TF >= 14400 THEN //(>= H4)
    DRAWARROWDOWN(barindex,high ) COLOURED(255,0,0,255)
    alto = high
    if islastbarupdate then
    for i=0 to 100 do
    drawsegment(barindex[i],alto[i] ,barindex,alto[i] )coloured("red",100)
    next
    endif
    ENDIF
    
    
    IF CONDL and TF >= 14400 THEN
    DRAWARROWUP(barindex,low ) COLOURED(0,255,0,255)
    basso = low
    if islastbarupdate then
    for i=0 to 100 do
    drawsegment(barindex[i],basso[i] ,barindex,basso[i] )coloured("green",100)
    next
    endif
    ENDIF
    
    RETURN MM coloured(255,128,192) AS "MM"
    #237886 quote
    robertogozzi
    Moderator
    Master

    Le righe 6 e 7 vanno scritte così:

    CONDS = HIGH >= MM and LOW >= MM
    CONDL = LOW  <= MM and HIGH <= MM
    Edisone and Iván González thanked this post
    #237895 quote
    Edisone
    Participant
    Average

    anche con questa modifica non funziona per la condizione CONDL

    #237904 quote
    JS
    Participant
    Senior

    Ciao,

    Può essere vera solo 1 condizione alla volta, CONDS o CONDL

    A seconda di quale condizione è attualmente vera, l’indicatore disegnerà le linee rosse o verdi…

    Se vuoi vedere tutto, non dovresti usare “IsLastBarUpdate”…

    robertogozzi, Edisone and Iván González thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Linea orizzontale e ciclo For


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Edisone @edisone Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by JS
1 year, 4 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 09/20/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...