Linea orizzontale e ciclo For

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #237880 quote
    EdisoneEdisone
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    EdisoneEdisone
    Participant
    Average

    anche con questa modifica non funziona per la condizione CONDL

    #237904 quote
    JSJS
    Participant
    Master

    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
    Scherm­afbeelding-2024-09-21-om-12.43.39.png Scherm­afbeelding-2024-09-21-om-12.43.39.png
Viewing 4 posts - 1 through 4 (of 4 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

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 JSJS
1 year, 12 months ago.

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