TS su Repulse 1 5 15

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #135277 quote
    tonitoni
    Participant
    New

    Sì capisco perfettamente anzi non smetto di ringraziarvi per la vostra disponibilità.

    Provo a lavorarci su ma fammi capire Roberto: ci sono differenze sostanziali tra il tuo codice e quello di Francesco ( a parte che lui ha previsto solo due Rep) ?

     

    Grazie

    #136245 quote
    robertogozzi
    Moderator
    Master

    Ti allego l’indicatore MyRepulseDivergences che richiede due segnali (Periodi e Tipo di Candele: 0=regolari, 1=HA) e restituisce 0 (nessuna divergenza, 1=divergenza rislzista, -1=divergenza ribassista). Questo indicatore derova da un altro esistente nella libreria e predisposto originariamente per il Macd (nel file c’è il link di riferimento).

    Questa è la strategia, che potrai modificare come vuoi:

    DEFPARAM CumulateOrders = false
    //
    HA         = 1                                   //1=usa HA,  0=usa candele giapponesi
    //
    once xOpen = open
    xClose     = (open + close + high + low) / 4
    if barindex > 0 then
       xOpen   = (xOpen + xClose[1]) / 2
    endif
    xLow       = min(low,min(xClose,xOpen))
    xHigh      = max(high,max(xClose,xOpen))
    IF HA = 0 THEN
       xClose  = close
       xOpen   = open
       xHigh   = high
       xLow    = low
    ENDIF
    //
    //ONCE p1  = 1
    //Bull1    = average[5*p1,1](((3*xClose)-(2*lowest[p1](xLow))-xOpen[p1])/xClose*100)
    //Bear1    = average[5*p1,1]((xOpen[p1]+(2*highest[p1](xHigh))-(3*xClose))/xClose*100)
    //Repuls1  = Bull1 - Bear1
    //
    ONCE p2    = 5
    Bull2      = average[5*p2,1](((3*xClose)-(2*lowest[p2](xLow))-xOpen[p2])/xClose*100)
    Bear2      = average[5*p2,1]((xOpen[p2]+(2*highest[p2](xHigh))-(3*xClose))/xClose*100)
    Repuls2    = Bull2 - Bear2
    //
    ONCE p3    = 15
    Bull3      = average[5*p3,1](((3*xClose)-(2*lowest[p3](xLow))-xOpen[p3])/xClose*100)
    Bear3      = average[5*p3,1]((xOpen[p3]+(2*highest[p3](xHigh))-(3*xClose))/xClose*100)
    Repuls3    = Bull3 - Bear3
    //
    MyAdx      = ADX[14]
    Diverg     = CALL MyRepulseDivergences[p2, HA]
    //
    // --- LONG
    L1         = Repuls2 CROSSES OVER  Repuls3
    L2         = Diverg = 1
    L3         = MyAdx > 25
    IF (L1 OR L2) AND L3 AND Not Onmarket THEN
       BUY 1 Contract AT Market
    ENDIF
    //
    // --- SHORT
    S1         = Repuls2 CROSSES UNDER Repuls3
    S2         = Diverg = -1
    S3         = L3
    IF (S1 OR S2) AND S3 AND Not Onmarket THEN
       SELLSHORT 1 Contract AT Market
    ENDIF
    //
    SET TARGET pPROFIT 100
    SET STOP   pLOSS   50

    Ho commentato le righe che si riferiscono al Repuls1 in quanto inutilizzate.

    MyRepulseDivergences.itf
    #136279 quote
    tonitoni
    Participant
    New

    Grazie Roberto.  Ho copiato il ts ma ricevo l’errore in allegato…

     

    Che vuol dire ” Ho commentato le righe che si riferiscono al Repuls1 in quanto inutilizzate” ?

    screen-2.png screen-2.png screen-3.png screen-3.png
    #136288 quote
    robertogozzi
    Moderator
    Master

    Significa che nella strategia non l’ho utilizzato, quindi quelle righe non servono.

    Quanto all’errore è dovuto alla mancanza dell’indicatore.

    Scarica il file ed importalo in ProBuilder come ogni altro indicatore personalizzato.

    #136365 quote
    tonitoni
    Participant
    New

    OK.

     

    Perfetto. Adesso lo devo rifinire .

     

    Grazie mille per il tuo prezioso contributo.

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.

TS su Repulse 1 5 15


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
tonitoni @tonitoni Participant
Summary

This topic contains 19 replies,
has 3 voices, and was last updated by tonitoni
5 years, 7 months ago.

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