Strategia fallita in real

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #206996 quote
    Michele80
    Participant
    New

    Buongiorno,

    non capisco come mai ma durante i backtest questa strategia funziona benissimo, mentre se la metto in esecuzione alla prima barra di esecuzione del codice viene interrotta con questo messaggio “server.strategy.probacktest.error.obacktest.error.missing_data”.

    Qualcuno ha idea di quale sia il problema?

    Grazie

    DEFPARAM PreLoadBars = 0
    DEFPARAM CumulateOrders = FALSE
    
    
    //------------
    
    timeframe(daily, updateonclose)
    myAdx = Adx[5]
    AdxMaxOk = (myAdx[1] < 45)
    AdxMinOk = (myAdx[1] > 25)
    
    timeframe(default)
    
    
    
    
    myRange = DHigh(1)-DLow(1)
    myBody = ABS(DOpen(1)-DClose(1))
    if myRange=0 then
    myRange=1
    endif
    RangeOk = myBody/myRange < 0.4
    
    
    //------------
    
    //Calcolo Livelli
    LivelloH = Highest[48](High)
    LivelloL = Lowest[48](Low)
    
    
    //Condizioni generali di ingresso
    CondizioniOk = Month <> 8 AND Time >= 010000 AND Time < 210000 AND AdxMaxOk AND AdxMinOk AND RangeOk
    
    
    //Ingresso a mercato
    IF CondizioniOk and Not LongOnMarket THEN
    BUY 5 LOT AT LivelloH STOP
    DaysLong = Days
    ENDIF
    IF CondizioniOk and Not ShortOnMarket THEN
    SELLSHORT 5 LOT AT LivelloL STOP
    DaysShort = Days
    ENDIF
    
    //Condizioni di uscita
    UscitaLong = (((DayOfWeek=5) OR ( Days>=(DaysLong+5) AND POSITIONPERF > 0) OR ( Days>=(DaysLong+5) AND POSITIONPERF < 0) ) AND Time >= 210000 )
    UscitaShort = (((DayOfWeek=5) OR ( Days>=(DaysShort+5) AND POSITIONPERF > 0) OR ( Days>=(DaysShort+5) AND POSITIONPERF < 0) ) AND Time >= 210000 )
    
    //Uscita dal mercato
    IF LongOnMarket AND UscitaLong THEN
    SELL AT MARKET
    ENDIF
    IF ShortOnMarket AND UscitaShort THEN
    EXITSHORT AT MARKET
    ENDIF
    
    
    //SL & TP
    SET STOP pLOSS 50
    SET TARGET pPROFIT 150
    #207097 quote
    robertogozzi
    Moderator
    Master

    Sembra sia nella prima riga, evidentemente non ha un numero sufficiente di barre per fare i calcoli.

    Commenta la riga 1 (dove c’è PreLoadBars) e fai una prova.

    Michele80 thanked this post
    #207147 quote
    Michele80
    Participant
    New

    esattamente come hai scritto…avevo interpretato male il parametro, pensavo che lo “0” avrebbe disattivato il caricamento di un numero finito di valori…

    grazie!

    #207190 quote
    robertogozzi
    Moderator
    Master

    PreLoadBars ha come limite massimo 20000 barre. Se viene omesso ne carica 2000. 0 non ne fa caricare nessuna.

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

Strategia fallita in real


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Michele80 @michele80 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
3 years, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 01/07/2023
Status: Active
Attachments: No files
Logo Logo
Loading...