Proscreener che non mi fa vedere quello che voglio

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #252347 quote
    Alessandro Furlani
    Participant
    Junior

    Ho realizzato uno screener basato su un mio indicatore che funziona abbastanza bene ma non riesco a far vedere il  valore della variabile Direction come vorrei.

    Allego codici e immagine

    #252384 quote
    Iván González
    Moderator
    Master

    Buongiorno! Ho eliminato l’istruzione “call” e al suo posto ho inserito l’indicatore.
    I risultati a prima vista sembrano corretti.

    //
    //----------------------------------------------------------------
    //              Screener - Delphic Combo
    // Tmeframe 1H
    //      PeriodFast = 12
    //      PeriodSlow = 22
    //      MA = SMA
    //
    //
    //----------------------------------------------------------------
    
    ScreenerID = 0
    Segnale = 0
    
    Timeframe(daily)
    C2=Volume[1]>MinVolume
    C3=Supertrend[STMulti,STPeriod]
    Timeframe(default)
    
    // Setup indici x la ricerca D1
    // Step1 -----------------------------------------------------------
    //----------------------------------------------------------------
    once Signal=0
    
    PeriodFast=18
    PeriodSlow=40
    MAType=0
    SMAFast=average[PeriodFast](TotalPrice)
    SMASlow=average[PeriodSlow](TotalPrice)
    miRSI = RSI[PeriodSlow](TotalPrice)
    iRSISmoothed=(Average[PeriodFast,MAType](miRSI))-50
    
    once CLong=0
    once CShort=0
    
    //Conditions to signal Long
    if CLong=0 and SMAFast crosses over SMASlow and totalprice>SMAFast then
       CLong=1
       C1Bar=BarIndex
    endif
    if Clong=1 and SMAFast>SMASlow and low<SMAFast and BarIndex>C1Bar and C1Bar<>0 then
       CLong=CLong+10
       C2Bar=BarIndex
    endif
    if Clong=11 and SMAFast>SMASlow and close>SMAFast and BarIndex>C2Bar and C2Bar<>0 then
       CLong=CLong+100
    endif
    if SMAFast crosses under SMASlow then
       CLong=0
    endif
    //Conditions to signal Short
    if CShort=0 and SMAFast crosses under SMASlow and totalprice<SMAFast then
       CShort=1
       C1Bar=BarIndex
    endif
    if CShort=1 and SMAFast<SMASlow and High>SMAFast and BarIndex>C1Bar and C1Bar<>0 then
       CShort=CShort+10
       C2Bar=BarIndex
    endif
    if CShort =11 and SMAFast<SMASlow and close<SMAFast and BarIndex>C2Bar and C2Bar<>0 then
       CShort=CShort+100
    endif
    if SMAFast crosses over SMASlow then
       CShort=0
    endif
    //Build the Signal
    if CLong=111 and iRSISmoothed>0 then
       Signal=1
    elsif CShort=111 and iRSISmoothed<0 then
       Signal=-1
    elsif CLong=0 or CShort=0 then
       Signal=0
    endif
    Zeroline=0
    //------------------------------------------------
    C1=TotalPrice>MinPrice
    
    if Signal[0]=1 and Signal[1]<1 and Zeroline=0 and C1 and C2 and TotalPrice>C3 then
       ScreenerID = 1
       Segnale = 1
    elsif Signal[0]=-1 and Signal[1]>-1 and Zeroline=0 and C1 and C2 and TotalPrice<C3 then
       ScreenerID = -1
       Segnale = 2
    endif
    bars = barssince(Segnale)
    
    Screener [bars<=3 and bars>=0](ScreenerID as "Direction")
    
    #252390 quote
    Alessandro Furlani
    Participant
    Junior

    Non capisco cosa cambia. Lo screener funziona anche con la call ma a me da solo risultati con Direction = 0 era questo il problema. Il resto funzionava bene.

    Infatti anche nel tuo esempio ci sono Direction = 0 che non dovrebbero esserci. La Direction deve essere solo 1 o -1.

    C’è qualcosa che non va….

    #252395 quote
    robertogozzi
    Moderator
    Master

    Io l’ho eseguito senza cambiare niente e vedo i valori regolarmente, come da foto allegata.

    Solo che è lentissimo ad esaminare gli strumenti.

    #252398 quote
    Alessandro Furlani
    Participant
    Junior

    Non va bene Roberto, Direction=0 non ci dovrebbe essere. Lo scopo del codice è trovare titoli che abbiano il segnale entro 3 barre e che presentino la stessa direzione dell’indice nasdaq.

    quindi la direzione può essere solo 1 (Long) o -1(Short) in base all’andamento del Nasdaq sulla barra relativa.

    Cosa ho sbagliato ?

    #252400 quote
    robertogozzi
    Moderator
    Master

    Basta che cambi l’ultima riga, aggiungendo la condizione che ScreenerID sia <> 0:

    Screener [bars<=3 and bars>=0 and ScreenerID<>0](ScreenerID as "Direction")
    Iván González thanked this post
    #252412 quote
    Alessandro Furlani
    Participant
    Junior

    vi invio l’ultima versione dello screener. Funziona abbastanza bene ma ci sono ancora cose che non sono apposto.

    Ad esempio per come l’ho concepito dovrebbe far vedere solo titoli che hanno un trend uguale a quello del NASDAQ ma invece tira fuori sia titoli che stanno andando short che titoli che vanno long.

    Mi ci date una occhiata ?

    Grazie

    #252417 quote
    robertogozzi
    Moderator
    Master

    Ti sei dimenticato di allegare il codice.

    #252420 quote
    Alessandro Furlani
    Participant
    Junior

    Sorry, la fretta ….

    #252486 quote
    robertogozzi
    Moderator
    Master

    Questo è il codice di uno screener per fare il confronto tra Azioni dello stesso Indice:

    // Confronto tra azioni dello stesso indice
    //
    TIMEFRAME(daily)
    CloseVal = Close
    //
    //EQUITYFRAME("Azioni - US (NASDAQ","AMZN")
    EQUITYFRAME("Indices - MIB","Indices - MIB")
    CloseInd = Close
    EQUITYFRAME(default)
    Ratio = (CloseVal / CloseInd) *100
    //
    TIMEFRAME(default)
    RelativeStrength = (Ratio - Ratio[1]) *100
    MyAvg = average[20,0](RelativeStrength)       //Media Semplice a 20 periodi
    Cond = 0
    IF RelativeStrength CROSSES OVER MyAvg AND (close > 150) THEN
       cond = 1
    ELSIF RelativeStrength CROSSES UNDER MyAvg AND (close > 150) THEN
       cond = 2
    ENDIF
    SCREENER [Cond](Cond AS "1=↑,2=↓")//(RelativeStrength AS "RelativeStrength")

    Questo è il codice di uno screener perfare il confronto tra un indice e le azioni che lo compongono:

    // confronto tra un indice  e le azioni che lo compongono
    //
    ////////////////////////////////////////////////////////////////
    EQUITYFRAME("Indices - MIB","MIB")
    Indice = (close - close[1]) * 100 / close    //es.: 2.277%
    //
    EQUITYFRAME(default)
    Stock = (close - close[1]) * 100 / close    //es.: 2.277%
    //-------------------------------------------------------
    Cond  = (Stock > Indice)
    SCREENER[Cond](Stock AS "Performance")
    
    //////////////////////////////////////////////////////////////////////////////
    
    // confornto tra Valute FX
    //
    EQUITYFRAME("Currencies","EURUSD")
    eurusd=close
    //
    EQUITYFRAME("Currencies","GBPUSD")
    gbpusd=close
    //
    result=eurusd/gbpusd
    screener[1](result)

    se mi spieghi meglio le condizioni che desideri ed i timeframe utiluizzati, posso provare a verificarlo meglio o a riscriverlo.

    #252501 quote
    Alessandro Furlani
    Participant
    Junior

    Provo a spiegare come vorrei che funzionasse il tutto.

    Io ho sviluppato un  indicatore che mi dice con buona approssimazione quando inizia un trend Long o Short su un titolo. L’indicatore è quello che ti ho allegato Delphic-TP-Combo.

    I parametri sono 18, 40 per analisi daily e 12, 20 per quelle Hourly.

    Ho provato ad usare l’indicatore in uno screener DelphicComboScreener che ti ho allegato nel messaggio precedente dove cerco di fare la cosa seguente:

    Scansisco le liste PRT Titoli Tecnologici e non Tecnologici, dovrebbero essere circa 1200 titoli, con le seguenti condizioni:

    1. Il segnale (Short o Long) deve stare nelle ultime 3 barre.
    2. Il volume deve essere superiore a x (lo vario a seconda del timeframe)
    3. Il prezzo deve essere superiore a 10$
    4. Il segnale deve avere lo stesso trend attuale del NASDAQ rispetto al giorno precedente. Cioè se il NASDAQ sale rispetto alla sessione precedente, Long, altrimenti Short. Se durante la sessione cambia lo scan deve ripartire

    Vorrei che nella visualizzazione ci fosse anche un indicatore della direzione tipo 1=Long, -1=Short. In realtà questo dovrebbe essere superfluo ma serve anche da verifica.

    Lo screneer fatto da me funziona abbastanza bene ma :

    • Tira fuori anche titoli con direzione 0(indefinita) che poi ho dovuto filtrare in uscita (Direction <>0) ma questo rallenta molto la scansione
    • Non riesco a ordinarli in base al trend del NASDAQ

    Vorrei che mi aiutassi a farlo funzionare ottimizzando anche la performance

    Grazie

    #252642 quote
    robertogozzi
    Moderator
    Master

    Riporto alcuni tuoi rilievi:

    Tira fuori anche titoli con direzione 0(indefinita) che poi ho dovuto filtrare in uscita (Direction <>0) ma questo rallenta molto la scansione
    non si può fare diversamente, prova a scrivere come condizione SCREENER[bars<=3 and bars>=0 AND and abs(ScreenerID)], ma non dovrebbe cambiare molto. Non ci sono alternative.

    Non riesco a trovare qual’è la condizione che ti indica l’andamento del NASDAQ.

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

Proscreener che non mi fa vedere quello che voglio


Supporto ProScreener

New Reply
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by robertogozzi
3 months, 2 weeks ago.

Topic Details
Forum: Supporto ProScreener
Language: Italian
Started: 10/08/2025
Status: Active
Attachments: 7 files
Logo Logo
Loading...