strategia non funzionante

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #184181 quote
    emanuele81
    Participant
    Senior

    Buongiorno, sto cercando di far funzionare una strategia basata sul triplo supertrend però non riesco a farla funzionare, qualcuno può darmi una mano.

    Non riesco a capire il problema. Grazie in anticipo

    supertrend-triplo.itf
    #184183 quote
    robertogozzi
    Moderator
    Master

    Cosa vuol dire “non funzionante”?
    Ti segnala un errore (quale)?
    Entra in modo errato, o altro?

    #184184 quote
    robertogozzi
    Moderator
    Master

    E’ meglio sempre postare anche il codice (a meno che non sia vafie centinaia di righe):

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    indicator1 = CALL "Kevins (Supertrend Kev)"[f, p]
    c1 = (close CROSSES OVER indicator1)
    
    IF c1 THEN
    BUY 10 SHARES AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = CALL "Kevins (Supertrend Kev)"[f, p]
    c2 = (close CROSSES UNDER indicator2)
    
    IF c2 THEN
    SELL  AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = CALL "Kevins (Supertrend Kev)"[f, p]
    c3 = (close CROSSES UNDER indicator3)
    
    IF c3 THEN
    SELLSHORT 10 SHARES AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator4 = CALL "Kevins (Supertrend Kev)"[f, p]
    c4 = (close CROSSES OVER indicator4)
    
    IF c4 THEN
    EXITSHORT  AT MARKET
    ENDIF
    
    // Stops and targets
    #184188 quote
    emanuele81
    Participant
    Senior

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l’orario “Flat Before” non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 080000
    // Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all’orario “Flat After”
    DEFPARAM FLATAFTER = 220000

    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

    // Condizioni per entrare su posizioni long
    ignored, ignored, indicator1 = CALL “3 supertrend”
    c1 = (close > indicator1)
    ignored, indicator2, ignored = CALL “3 supertrend”
    c2 = (close > indicator2)
    indicator3, ignored, ignored = CALL “3 supertrend”
    c3 = (close CROSSES OVER indicator3)

    IF (c1 AND c2 AND c3) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Condizioni per entrare su posizioni short
    ignored, ignored, indicator4 = CALL “3 supertrend”
    c4 = (close < indicator4)
    ignored, indicator5, ignored = CALL “3 supertrend”
    c5 = (close < indicator5)
    indicator6, ignored, ignored = CALL “3 supertrend”
    c6 = (close CROSSES UNDER indicator6)

    IF (c4 AND c5 AND c6) AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    #184189 quote
    emanuele81
    Participant
    Senior

    l’errore che mi segnala è il seguente:

    il backtest non può partire a causa di un errore di analisi nel codice:linea 1 colonna 0

    #184192 quote
    robertogozzi
    Moderator
    Master

    A me funziona perfettamnente, ho solo aumentato il capitale altrimenti non riusciva ad arrivare alla fine, ma partiva comunque.

    x-14.jpg x-14.jpg
    #184198 quote
    GraHal
    Participant
    Master

    I get same parsing error as emanuele81 .
    Roberto how come you tested Supertrend Kev System and not Supertrend-Triplo as in the original post?

    Ottengo lo stesso errore di analisi di emanuele81 . Roberto come mai hai testato Supertrend Kev System e non Supertrend-Triplo come nel post originale?

    #184201 quote
    GraHal
    Participant
    Master

    Ooops, sorry … please delete above.

    Ottengo lo stesso errore di analisi di emanuele81 .

    Roberto come mai hai testato Supertrend Kev System e non Supertrend-Triplo come nel post originale?

    #184202 quote
    robertogozzi
    Moderator
    Master

    Ho importasto il file ITF e l’ho provato, solo cambiando il capotale iniziale,

    Pubblica solo nella lingua del forum in cui stai postando. Ad esempio solo l’inglese nei forum di lingua inglese e il francese solo nei forum di lingua francese.
    Grazie 🙂

    #184203 quote
    robertogozzi
    Moderator
    Master

    Il SuperTrend 3 non so cosa sia, dovresti postarlo. manon mki sembra ci sia nessun errore nella linea 1.
    Forse hai fatto un copia e incolla errato.
    Prova a vedere se ci sono altre righe indesiderate.

    #184204 quote
    robertogozzi
    Moderator
    Master

    @GraHal
    ho risposto nello stesso momento in cui anche tu stavi rispondendo 🙂

    GraHal thanked this post
    #184219 quote
    emanuele81
    Participant
    Senior

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l’orario “Flat Before” non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 080000
    // Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all’orario “Flat After”
    DEFPARAM FLATAFTER = 220000

    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

    // Condizioni per entrare su posizioni long
    ignored, ignored, indicator1 = CALL “3 supertrend”
    c1 = (close > indicator1)
    ignored, indicator2, ignored = CALL “3 supertrend”
    c2 = (close > indicator2)
    indicator3, ignored, ignored = CALL “3 supertrend”
    c3 = (close CROSSES OVER indicator3)

    IF (c1 AND c2 AND c3) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Condizioni per entrare su posizioni short
    ignored, ignored, indicator4 = CALL “3 supertrend”
    c4 = (close < indicator4) ignored, indicator5, ignored = CALL "3 supertrend" c5 = (close < indicator5) indicator6, ignored, ignored = CALL "3 supertrend" c6 = (close CROSSES UNDER indicator6) IF (c4 AND c5 AND c6) AND not daysForbiddenEntry THEN SELLSHORT 1 CONTRACT AT MARKET ENDIF

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

strategia non funzionante


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by emanuele81
4 years, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/31/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...