doppio massimo e doppio minimo

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #87807 quote
    lucifox
    Participant
    New

    ciao, sono nuovo di questo mondo utilizzo proscreener per alcune analisi,

    purtroppo a livello di analisi grafica non riesco a trovare tanto, potresti gentilmente suggerirmi il codice per individuare un doppio minimo ed un doppio massimo

    grazie

    Luciano Rinaldi

    #87848 quote
    robertogozzi
    Moderator
    Master

    Utilizzando la SEARCH BOX (si apre quando passi col mouse sul tuo avatar in alto a destra), puoi effettuare ricerche di parole o frasi sul forum. Cercando prima DOPPIO e poi DOUBLE ho trovato questi link a screener, indicatore e strategia:

    https://www.prorealcode.com/prorealtime-market-screeners/double-top-double-bottom-screener/

    https://www.prorealcode.com/prorealtime-indicators/double-top-double-bottom-detector/

    https://www.prorealcode.com/topic/double-top-bottom-hunter/

    #87849 quote
    lucifox
    Participant
    New

    grazi ci provo

    #111779 quote
    dollarieur
    Participant
    Senior

    Ciao, stavo giusto cercando se fosse possibile avere un Proscreener in grado di evidenziare eventuali doppi minimi o massimi. Cercando su questo forum, ho visto questa pagina e cercato di capire qualcosa all’indirizzo https://www.prorealcode.com/prorealtime-market-screeners/double-top-double-bottom-screener/,  sopra elencata.

    Sinceramente, devo ammettere di avere provato tale formula senza tuttavia trovare alcun doppio massimo / minimo. Almeno IO, in tutta sincerità…non ne ho proprio visti. 🙂

    Suppongo quindi, per far bene funzionare la “formula”, sia assai importante comprenderla in modo approfondito in modo da poter “tarare” diversi valori (PERIOD, KDOUBLE, LMA, BULLCROSS, ecc.…) correttamente.

     

    Ti chiedo allora se potresti gentilmente “tradurre” questa formula in italiano, permettendoci cosi anche di vedere le annotazioni in italiano e potere quindi comprendere il significato e la funzione delle singole righe e dei vari fattori da inserire manualmente.

    Ti ringrazio se riesci.

    ciao

    #111799 quote
    robertogozzi
    Moderator
    Master

    Darò un’occhiata lunedì.

    Buon fine settimana.

    #111878 quote
    dollarieur
    Participant
    Senior

    Molte grazie. Senza fretta, quando riesci… 🙂

    Grazie ancora!

    Andrea

    #111982 quote
    robertogozzi
    Moderator
    Master

    L’ho convertito in indicatore, prova a vedere cosa ti restituisce, aggiustando i vari parametri iniziali per adattarlo alle tue esigenze:

    //LOCALS MINIMUMS AND MAXIMUMS USING LEO MOVING AVERAGE
    //Autor: LEO
     
    //VARIABLES TO BE OPTIMIZED
     
    PERIOD=40    //Period for analysis
     
     
    //Definition of what is a double top or double bottom
    Kdouble=0.2 //Factor for defining what is double top or bottom
     
    //-----------
     
    //Leo Moving Average, formula: LMA= WMA+(WMA-SMA)
    LMA=2*weightedaverage[period](close)-average[period](close)
     
    //Smoothed curve of Leo Moving Average
    IF BARINDEX > period THEN
    smoothLMA=weightedaverage[period](LMA)
    ELSE
    smoothLMA=undefined
    ENDIF
     
    // Direction or trend of the LMA
     
     
    // << Storage of minimums and maximums >>
    once mintemp=low
    once posmintemp=1
    once maxtemp=high
    once posmaxtemp=1
     
    IF BARINDEX>2 THEN
    // the value 0.7 is to ensure that the donchian channel is faster than the curves analysis (this value to be checked)
    IF low < lowest[round(0.7*period)](low[1]) THEN
    mintemp=low //minimum temporal
    posmintemp=BARINDEX //postition of minimum temporal
    ENDIF
    IF high > highest[round(0.7*period)](high[1]) then
    maxtemp=high //maximum temporal
    posmaxtemp=BARINDEX //position maximum temporal
    ENDIF
    ENDIF
     
    //  << Detecting and locating a local minimums >>
    //  Where the LMA is crossing the smoothed LMA, there is a maximum or minimum nearby
    //  If there is a new local min/max, the preivus one is stored in de varible B... (before)
    once LEVMIN=low
    once POSLEVMIN=1
    once LEVMAX=high
    once POSLEVMAX=1
    once bullcross=0
    once bearcross=0
     
    IF BARINDEX > PERIOD THEN //For avoid computer errors
    bullcross=LMA crosses over smoothLMA
    bearcross=LMA crosses under smoothLMA
    ENDIF
     
     
    IF bullcross and POSLEVMIN<>posmintemp  THEN
    BLEVMIN=LEVMIN        //previus local minimum is saved
    BPOSLEVMIN=POSLEVMIN
    LEVMIN=mintemp
    POSLEVMIN=posmintemp
    support=LEVMIN
    ENDIF
     
    // --> Detecting and locating a local maximum
    IF bearcross and POSLEVMAX<>posmaxtemp THEN
    BLEVMAX=LEVMAX       //previus local maximum is saved
    BPOSLEVMAX=POSLEVMAX
    LEVMAX=maxtemp
    POSLEVMAX=posmaxtemp
    resistance=LEVMAX
    ENDIF
     
    support=min(low,support)
    resistance=max(high,resistance)
     
     
    // << DETECTING DOUBLE TOP OR BOTTOMS  >>
     
    once WidthDoubleTop = high-low
    once WidthDoubleBottom = high-low
    once Wpattern=0
    once Mpattern=0
     
     
    //  <<<<<<  Double bottoms   >>>>>>>>>
     
    //looking for the top between two local minimums
    IF bullcross THEN
    doublebottomtop=high[BARINDEX-POSLEVMIN+1] // we start looking for the top in between two local minimums
    //POSdoublebottomtop=BARINDEX-POSLEVMIN+1
    FOR i = (BARINDEX-POSLEVMIN+1) to (BARINDEX-BPOSLEVMIN-1) DO
    IF high[i] > doublebottomtop THEN
    doublebottomtop=high[i]
    //POSdoublebottomtop=BARINDEX-i
    ENDIF
    NEXT
    WidthDoubleBottom = doublebottomtop-(BLEVMIN+LEVMIN)/2 // (top betwen local minimums) - (average of the las two local minimums)
    IF abs(BLEVMIN-LEVMIN) < Kdouble*WidthDoubleBottom THEN
    // we have a double bottom
    Wpattern=1
    else
    Wpattern=0
    ENDIF
    ENDIF
     
    //   <<<<<<<<<<  Double tops    >>>>>>>
     
    //looking for the bottom between two local maximums
    IF bearcross THEN
    doubletopbottom=low[BARINDEX-POSLEVMAX+1]
    //POSdoubletopbottom=BARINDEX-POSLEVMAX+1
    FOR i = (BARINDEX-POSLEVMAX+1) to (BARINDEX-BPOSLEVMAX-1) DO
    IF low[i] < doubletopbottom THEN
    doubletopbottom=low[i]
    //POSdoubletopbottom=BARINDEX-i
    ENDIF
    NEXT
    WidthDoubleTop=(BLEVMAX+LEVMAX)/2 -doubletopbottom
    IF abs(BLEVMAX-LEVMAX) < Kdouble*WidthDoubleTop THEN
    // we have a double top
    Mpattern=1
    else
    Mpattern=0
    ENDIF
    ENDIF
     
    //    <<<<<<<<<<  DOUBLE TOP AND DOUBLE BOTTOM FOR TRADING  >>>>>>>>
     
     
    myATR=AverageTrueRange[2*period](close)
     
    IF Wpattern=1 THEN
    IF close > (doublebottomtop+myATR) or close < (LEVMIN-0.5*myATR) THEN
    Wpattern=0 //  <<<< double bottom has been activated or it was cancelled >>>>>
    ELSE
    //       <<<<<<<  HERE WE HAVE A DOUBLE BOTTOM FOR TRADING  >>>>>
    //exactness=abs(BLEVMIN-LEVMIN) / WidthDoubleBottom
    ENDIF
    ENDIF
     
    IF Mpattern=1 THEN
    IF close < (doubletopbottom-myATR) or close > (LEVMAX+0.5*myATR) THEN
    Mpattern=0 //double top has been activated or it was cancelled
    ELSE
    //       <<<<<<<  HERE WE HAVE A DOUBLE TOP FOR TRADING  >>>>>
    //exactness= abs(BLEVMAX-LEVMAX) / WidthDoubleTop
    ENDIF
    ENDIF
    
    x = Wpattern
    IF x = 0 THEN
    x = -Mpattern
    ENDIF
    RETURN x,0
    //SCREENER[Wpattern=1 or Mpattern=1](exactness)
    x-1.jpg x-1.jpg
    #112132 quote
    dollarieur
    Participant
    Senior

    Molte grazie della conversione ma, devo essere sincero….non sono proprio riuscito a capire…nulla…..ma proprio nulla….. 😀

    Ti ho allegato 2 immagini..che fanno capire io non abbia…capito…. 🙂

    Se tu o qualcun altro che magari è riuscito ad apprendere nei mesi il funzionamento di tale Proscreener, riusciste a chiarirmene il funzionamento…il significato dei vari valori da immettere alle voci PERIOD, KDOUBLE, LMA, BULLCROSS, ecc.…sarei molto grato.

    Grazie comunque!

    Andrea

    Cattura.png Cattura.png zoom.png zoom.png
    #112135 quote
    robertogozzi
    Moderator
    Master

    No, non ho avuto tempo di studiarlo. Da quei paramteri (priodo di osservazione e fattore di precisione, credo) si affina la ricerca o meno dei due pattern.

    L’individuazione è sempre molto difficile, non esistono due massimi o minimi identici, bisogna consiuderarli uguali quando rientrano in una certa differenza. Credo sia quello che fa questo codice, sulla base della Leo Moving Average, ideata dall’utente LEO (non so se è ancora attivo o meno sul forum).

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

doppio massimo e doppio minimo


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
lucifox @lucifox Participant
Summary

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

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 12/31/2018
Status: Active
Attachments: 3 files
Logo Logo
Loading...