Comportamento anomalo

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #142175 quote
    othelloothello
    Participant
    Senior

    Buonasera.

    Chiedo aiuto sul codice di un semplice indicatore che, però, non si comporta come dovrebbe.

    Il comportamento deve essere il seguente. Sotto la candela la cui chiusura si è portata sotto il SuperTrend dovrà essere scritto il valore della Close di tale candela. Sopra la candela la cui chiusura si è portata sopra il SuperTrend dovrà essere scritto il valore della Close di tale candela.

    Allego il codice ed un’immagine del grafico dove si vedono casi corretti e casi errati. Da notare che nei casi errati la scrittura avviene sulla candela successiva a quella corretta (ma anche due candele dopo).

    st = supertrend[3,10]
    //CambioVerde = close[1] < st[1] AND close > st
    //CambioRosso = close[1] > st[1] AND close < st
    
    CambioVerde = close crosses over St
    CambioRosso = close crosses under St
    
    if cambioVerde then
    c=close
    DRAWTEXT("#c#", barindex, high+5)
    endif
    
    if cambioRosso then
    c=close
    DRAWTEXT("#c#", barindex, Low-5)
    endif
    
    return
    
    fig1.png fig1.png
    #145338 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    A me funziona perfettamente, sia sulla v10.3 che sulla v11.

    Un suggerimento, scrivi 5*pipsize per renderlo funzionante su tutti gli strumenti.

    Seui sicuro che i parametri [3,10] siano uguali sia nel codice che nell’indicatore SuperTrend che è sul grafico?

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

Comportamento anomalo


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
othello @othello Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years ago.

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