Scalping test

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #131563 quote
    Giovanni Belli
    Participant
    Average
    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    defparam PRELOADBARS = 1000
    // Condizioni per entrare su posizioni long
    indicator1 = ExponentialAverage[500](close)
    indicator2 = ExponentialAverage[21](close)
    c1 = (close CROSSES OVER indicator1)
    c2 = (indicator1 >= indicator1[3])
    c3 = (indicator2 >= indicator2[3])
    
    
    once Sl=0
    once TP=0
    
    if c1 and c2 and c3 then
    Sl= abs(CLOSE-(lowest[24](low)))/pointsize
    TP= SL * 1.75
    Buy 1 contract at market
    
    endif
    
    set stop ploss sl
    set target pprofit tp

    Ero già arrivato alla conclusione del calcolo sbagliato ma con ABS si risolve anche in caso futuro di SL in vendita.

    Grazie

    bertrandpinoy thanked this post
    #131654 quote
    Giovanni Belli
    Participant
    Average

    Roberto sono ancora qui per un tuo preziosissimo aiuto.

    ho alzato il livello. Nella libreria ho trovato qualcosa di simile ad un indicatore zigzag visto che non posso usare l’originale di PRT per problemi di calcolo in tempo reale (mi sembra di aver letto una tua risposta a riguardo).

    Ti allego il codice da cui ho epurato la parte di drawing e ho mantenuto la parte di calcolo. Il tutto perchè vorrei aprire posizioni in acquisto solo se il tracciato è rialzista.

    Poi ti allego la foto che ti mostra come lui esegua il tutto solo in parte , poi apre posizioni anche con linee in ribasso.

    Spero sia tutto chiaro.

    Grazie anticipatamente

     

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    defparam PRELOADBARS = 1000
    // Condizioni per entrare su posizioni long
    
    //---external parameters
    cp = 10
     
    once lastpoint = 0
     
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH = 0
    endif
     
    if low[cp] <= lowest[2*cp+1](low)  then
    LL = -1
    else
    LL = 0
    endif
     
    if LH = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
     
    if LL = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    
    
    once lasty= 0
     
    if LH>0 and (lastpoint=-1 or lastpoint=0) then
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    endif
     
    
    if LL<0 and (lastpoint=1 or lastpoint=0) then
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    endif
     
    if lastx then
    endif
    
    indicator1 = ExponentialAverage[40]
    indicator2 = ExponentialAverage[20]
    indicator3 = ExponentialAverage[2000]
    
    
    
    c1 = (close CROSSES OVER indicator1)
    c2 = (indicator1 > indicator1[1])
    c3 = (indicator2 > indicator2[1])
    c4 = (indicator3 > indicator3[1])
    c5 = ( lasty < close)
    
    
    
    once Sl=0
    once TP=0
    
    if c1 and c2 and c3 and c4 and c5 then
    Sl= (abs(CLOSE-(lowest[24](low)))/pointsize)+3
    TP= SL * 2.5
    Buy 1 contract at market
    endif
    
    set stop ploss sl
    set target pprofit tp
    Schermata-2020-05-14-alle-13.47.36.png Schermata-2020-05-14-alle-13.47.36.png
    #131664 quote
    robertogozzi
    Moderator
    Master

    Lo ZigZag non si può usare perché i segnali li da solo dopo la conferma, magari qualche candela dopo, ma una strategia non può andare indietro. Quando lui calcola il segnale (anche avendo tolto la parte grafica) è troppo tardi, lui entra ma il mercato è cambiato.

    Gli indicatori che fanno repainting, anche se il repainting lo togli, non funzionano con le strategie.

    Oltre allo ZigZag c’è il Dpo ed altri.

    bertrandpinoy thanked this post
Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Scalping test


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 17 replies,
has 3 voices, and was last updated by robertogozzi
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/07/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...