Creazione indicatore di pattern

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #79791 quote
    AntonioAntonio
    Participant
    Junior

    Salve a tutti,

    Sto creando un’indicatore secondo lo schema che riassumo di seguito:

    If condizione1 then

    Indicatore=1

    Elsif condizione2 then

    Indicatore=2

    Elsif……… Fino a 40 condizioni e valore indicatore 40

    Endif

    L’indicatore funziona ma sul grafico espone il risultato fino alla condizione numero 5.

    Se richiamo l’indicatore con la funzione Call in un TS, e provo una ottimizzazione funzionano anche in quel caso solo le prime 5 condizioni.

    Nei manuali nòn sono riuscito a trovare alcuna informazione.

    Qualche idea su cosa sbaglio?

    Grazie.

    #79807 quote
    NicolasNicolas
    Keymaster
    Legend

    C’è sicuramente qualcosa di sbagliato nel tuo blocco condizionale. Senza guardare il tuo codice, è molto difficile aiutare di più ..

    #79822 quote
    AntonioAntonio
    Participant
    Junior

    This is the code for now, I need to put around 40 conditions.

    Thank you in advance for support.

    data1 = abs(Dopen(1)-Dclose(1))<0.5*(Dhigh(1)-Dlow(1)) //VOLATILITY INDECISION
    data2 = abs(Dopen(1)-Dclose(5))<0.5*(Dhigh(5)-Dclose(1)) //VOLATILITY INDECISION
    data3 = abs(Dopen(5)-Dclose(1))<0.5*(HIGHEST[5](Dhigh(1)) - LOWEST[5](Dlow(1))) //VOLATILITY INDECISION
    data4 = ((Dhigh(0)-Dopen(0)> ((Dhigh(1)-Dopen(1))*1))) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 6
    data5 = ((Dhigh(0)-Dopen(0))> ((Dhigh(1)-Dopen(1)*1.5))) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 7
    data6 = ((Dopen(0)-Dlow(0))> ((Dopen(1)-Dlow(1)*1))) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 4
    data7 = ((Dopen(0)-Dlow(0))> ((Dopen(1)-Dlow(1)*1.5))) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 5
    data8 = Dclose(1)>Dclose(2) and Dclose(2)>Dclose(3) and Dclose(3)>Dclose(4) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 9
    data9 = Dclose(1)<Dclose(2) and Dclose(2)<Dclose(3) and Dclose(3)<Dclose(4) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 8
    data10 = Dhigh(1)>Dhigh(2) and Dlow(1)>Dlow(2) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 11
    data11 = Dhigh(1)<Dhigh(2) and Dlow(1)<Dlow(2) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 10
    data12 = (Dhigh(0)>(Dlow(0)+Dlow(0)*0.75/100)) //EXPANSION - MIRROR 13
    data13 = (Dhigh(0)<(Dlow(0)+Dlow(0)*0.75/100)) //COMPRESSION - MIRROR 12
    
    if data1 then
    pattern=1
    elsif data2 then
    pattern=2
    elsif data3 then
    pattern=3
    elsif data4 then
    pattern=4
    elsif data5 then
    pattern=5
    elsif data6 then
    pattern=6
    elsif data7 then
    pattern=7
    elsif data8 then
    pattern=8
    elsif data9 then
    pattern=9
    elsif data10 then
    pattern=10
    elsif data11 then
    pattern=11
    elsif data12 then
    pattern=12
    elsif data13 then
    pattern=13
    else
    pattern=0
    endif
    
    RETURN PATTERN
    #79823 quote
    NicolasNicolas
    Keymaster
    Legend

    > Per chiarezza dei messaggi sul Forum di Prorealcode, separate le parti del vostro codice usando il pulsante per l’inserimento del testo del codice. <<

    Hai provato a restituire ‘data6’ a ‘data13’ per sapere se si sono realmente verificati? In questo modo sarai sicuro che il problema non proviene da questi rilevamenti di pattern.

    RETURN data6, data7, data8, .....
    #79825 quote
    AntonioAntonio
    Participant
    Junior

    Yes, I did.

    All conditions have some occurrence.

    #79831 quote
    AntonioAntonio
    Participant
    Junior

    Look the result deleting some line of code in random way….

    data1 = abs(Dopen(1)-Dclose(1))<0.5*(Dhigh(1)-Dlow(1)) //VOLATILITY INDECISION
    data2 = abs(Dopen(1)-Dclose(5))<0.5*(Dhigh(5)-Dclose(1)) //VOLATILITY INDECISION
    data3 = abs(Dopen(5)-Dclose(1))<0.5*(HIGHEST[5](Dhigh(1)) - LOWEST[5](Dlow(1)))  //VOLATILITY INDECISION
    data4 = ((Dhigh(0)-Dopen(0)> ((Dhigh(1)-Dopen(1))*1)))  //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 6
    //data5 = ((Dhigh(0)-Dopen(0))> ((Dhigh(1)-Dopen(1)*1.5)))  //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 7
    data6 = ((Dopen(0)-Dlow(0))> ((Dopen(1)-Dlow(1)*1))) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 4
    //data7 = ((Dopen(0)-Dlow(0))> ((Dopen(1)-Dlow(1)*1.5))) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 5
    data8 = Dclose(1)>Dclose(2) and Dclose(2)>Dclose(3) and Dclose(3)>Dclose(4) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 9
    data9 = Dclose(1)<Dclose(2) and Dclose(2)<Dclose(3) and Dclose(3)<Dclose(4) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 8
    //data10 = Dhigh(1)>Dhigh(2) and Dlow(1)>Dlow(2) //DIRECTIONAL UP - STRENGHT BULLISH - MIRROR 11
    data11 = Dhigh(1)<Dhigh(2) and Dlow(1)<Dlow(2) //DIRECTIONAL DOWN - WEAKNESS BEARISH - MIRROR 10
    data12 = (Dhigh(0)>(Dlow(0)+Dlow(0)*0.75/100)) //EXPANSION - MIRROR 13
    data13 = (Dhigh(0)<(Dlow(0)+Dlow(0)*0.75/100)) //COMPRESSION - MIRROR 12
    //
    if data1 then
    pattern=1
    elsif data2 then
    pattern=2
    elsif data3 then
    pattern=3
    elsif data4 then
    pattern=4
    //elsif data5 then
    //pattern=5
    elsif data6 then
    pattern=6
    //elsif data7 then
    //pattern=7
    elsif data8 then
    pattern=8
    elsif data9 then
    pattern=9
    //elsif data10 then
    //pattern=10
    elsif data11 then
    pattern=11
    elsif data12 then
    pattern=12
    elsif data13 then
    pattern=13
    else
    pattern=0
    endif
    
    
    
    RETURN pattern
    Schermata-2018-09-05-alle-20.20.20.png Schermata-2018-09-05-alle-20.20.20.png
    #79833 quote
    AntonioAntonio
    Participant
    Junior

    I have solved.

    Was mistakes in conditions about round brackets.

    Thanks the same for your interest.

    #79850 quote
    NicolasNicolas
    Keymaster
    Legend

    Fine but .. per favore parla italiano su un argomento italiano la prossima volta! 🙂
    e saremmo felici di far funzionare anche il codice!

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

Creazione indicatore di pattern


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Antonio @amarra500 Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by NicolasNicolas
8 years ago.

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