indicatore 4 roc

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #243367 quote
    pignolaus
    Participant
    Average

    Buongiorno, vorrei creare un indicatore personalizzato che mi indichi ad esempio con un istogramma positivo, quando i seguenti indicatori sono contemporaneamente positivi; Roc200, Roc 100, Roc 50 e Roc 10. Si timeframe giornaliero.

    Questo mi serve praticamente a vedere quando un titolo è in potenziale situazione rialzista senza dover visualizzare i 4 differenti indicatori di cui sopra.

    Ho provato a scrivere un codice ma senza esito positivo. Potete darmi qualche indicazione?  Grazie

    #243383 quote
    Iván González
    Moderator
    Master

    Qui faccio un esempio senza tenere conto del valore del ROC. Analizziamo solo se è positivo o negativo. Puoi cambiare i colori nell'ultima riga di codice.

    // ROC
    roc200=roc[200](close)
    roc100=roc[100](close)
    roc50=roc[50](close)
    roc10=roc[10](close)
    
    //Transformation ROC200
    if roc200>0 then
    roc200=4
    else
    roc200=-4
    endif
    //Transformation ROC100
    if roc100>0 then
    roc100=3
    else
    roc100=-3
    endif
    //Transformation ROC50
    if roc50>0 then
    roc50=2
    else
    roc50=-2
    endif
    //Transformation ROC10
    if roc10>0 then
    roc10=1
    else
    roc10=-1
    endif
    
    return roc200 style(histogram)coloured("red"),roc100 style(histogram)coloured("blue"),roc50 style(histogram)coloured("green"),roc10 style(histogram)coloured("lime"),0 style(line) 
    robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

indicatore 4 roc


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
pignolaus @pignolaus Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
1 year ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 02/03/2025
Status: Active
Attachments: No files
Logo Logo
Loading...