ProOrder che non danno stessi risultati

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #254201 quote
    Alessandro Furlani
    Participant
    Junior

    Buongiorno, vi sottopongo il rompicapo della settimana.

    Ho 2 ProOrder con codice leggermente differente ma che esegue esattamente le stesse istruzioni con lo stesso setup. In pratica uno è l’evoluzione dell’altro ma con un determinato setup, cioè AutoReverse=0 deve funzionare come il suo predecessore. Invece no i risultati sono completamente diversi come potete vedere nello screesnhot allegato.

    Mi potete spiegare come mai ?

    Grazie

    #254205 quote
    GraHal
    Participant
    Master

    Un sistema ha la funzione “Tick by Tick” abilitata e l’altro sistema no?

    Oppure, più probabilmente…

    Un sistema ha un valore per lo Spread impostato nel motore di backtest e l’altro sistema ha un valore pari a 0 per lo Spread?

    #254206 quote
    Alessandro Furlani
    Participant
    Junior

    Allora, effettivamente uno aveva le commissioni settate e l’altro no. Ora sono esattamente uguali, e comunque il risultato è diverso.

    #254209 quote
    GraHal
    Participant
    Master

    Inserisci entrambe le versioni del codice nel diffchecker al link qui sotto… per essere sicuro al 100% che i due codici siano identici.

    Confronta il testo e trova le differenze online o offline – Diffchecker

    #254214 quote
    Alessandro Furlani
    Participant
    Junior

    come ho detto i due codici non sono esattamente identici, ma con l’opzione AutoReverse=0, devono fare esattamente la stessa cosa, cosa che non accade

    #254215 quote
    GraHal
    Participant
    Master

    devono fare esattamente la stessa cosa, cosa che non accade

    Rendi i 2 codici “esattamente” uguali per ottenere lo stesso risultato.

    Quindi inverti una modifica alla volta su un solo codice finché non vedi una differenza nel risultato… dovresti essere vicino al problema? 

    #254216 quote
    Alessandro Furlani
    Participant
    Junior

    Grazie ma fin qui ci arrivavo anch’io, è una normale procedure di bug detecting, chiedevo sul forum perchè, dato che il codice è semplice, se c’è qualche regola che non ho rispettato o qualche comportamento che non conosco del codice, qualcuno più esperto se ne accorge subito.

     

    Saluti

    #254218 quote
    GraHal
    Participant
    Master

    Ci sono molti blocchi di codice (ripetuti) che sono diversi tra Code1 e Code2… vedi le evidenziazioni verdi a sinistra dell’allegato.  Lo saprai.

    I “Coding Wizards” potrebbero notare qualcosa se pubblicassi il codice (sono molto impegnati e potrebbero non riuscire a scaricare e aprire i file .itf nell’editor di codice, ecc.).    

    Iván González thanked this post
    #254220 quote
    Iván González
    Moderator
    Master

    Fanno esattamente la stessa cosa. Ovviamente… prima bisogna uniformare le variabili…
    Come dice bene @Grahal, è molto meglio copiare e incollare il codice piuttosto che doverlo scaricare.

    #254223 quote
    Alessandro Furlani
    Participant
    Junior

    cosa intendi scusa, le variabili sono esattamente le stesse. Il codice non può essere esattamente uguale perchè, come dicevo il Maximus3.2AV è una evoluzione e quindi  ha delle funzioni in più.

    Mi chiarisci meglio cosa intendi ?

    Pubblico il codice qui sotto, l’avevo allegato perchè pensavo di fare meglio.

    //-------------------------------------------------------------------------
    // Codice principale : Maximus3.0
    //-------------------------------------------------------------------------
    // MAXIMUS ======
    // Creado Por TradingenelIbex35 para Prorealcode
    // Version 3.0 Lite
    // periodo de Prueba NASDAQ Composite index date 010109 hasta hoy
    //
    Defparam CUMULATEORDERS = TRUE
    //Defparam NOCASHUPDATE = TRUE
    //
    //
    //
    //
    //Filtro  =180
    //Sloss = 10  // %
    //SProfit = 85 // %
    //ONCE Filtro = 40.0
    //ONCE LongTrade = 1.0
    //ONCE MaxLot = 5.0
    //ONCE MinLot = 1.0
    //ONCE SProfit = 10.0
    //ONCE ShortTrade = 1.0
    //ONCE Sloss = 1.0
    //ONCE Switch = 1.0
    X = 0
    Y = 1
    Z = 2
    //
    //
    //==== CONTRATOS A NEGOCIAR =========
    //
    Xhares = MinLot
    //
    // ======  Numero Maximo de contratos a negociar   ============
    //
    NLshares = MaxLot
    NSshares = MaxLot
    //
    
    //
    // ==========  CODIGO  ===================
    //
    
    HULL = weightedaverage[filtro](close)
    
    //Long trading
    if LongTrade = 1 then
    IF BarIndex>LastOrderBar and close[x] crosses over highest[6](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < NLshares THEN
    buy Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[20](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < NLshares THEN
    buy Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[50](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < NLshares THEN
    buy Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[100](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < NLshares THEN
    buy Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[200](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < NLshares THEN
    buy Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    endif
    // Short trading
    if ShortTrade = 1 then
    IF BarIndex>LastOrderBar and close[x] crosses under highest[6](high[1]) and hull[y] < hull[z] and COUNTOFSHORTSHARES < NSshares THEN
    SellShort Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[20](high[1]) and hull[y] < hull[z] and COUNTOFSHORTSHARES < NSshares THEN
    SellShort Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[50](high[1]) and hull[y] < hull[z] and COUNTOFSHORTSHARES < NSshares THEN
    SellShort Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[100](high[1]) and hull[y] < hull[z] and COUNTOFSHORTSHARES < NSshares THEN
    SellShort Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[200](high[1]) and hull[y] < hull[z] and COUNTOFSHORTSHARES < NSshares THEN
    SellShort Xhares CONTRACTS AT MARKET
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    endif
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // MAXIMUS 3.2 AV                                                    Author: Alessandro Furlani
    // File: Maximus3.2AV                                                email: alex.furlani@gmail.com
    //
    // Note: Maximus 3.2 AV is inspirated by the draft free code of Maximus 3.0 lite, published on
    //       ProRealCode web site so, first thanks to the author who was able to inspire me.
    //       This improved version, was completed with the short section not present on the original code
    //       and tuned for a more efficient behaviour.
    //       This version is extremely effective on H1 timeframe but wioth an high drawdown so, to adjust
    //       the robot to different needs, i have made some changes to adapt the robot to more fast
    //       timeframe.
    //       At the moment the robot is giving us good results on M5 timeframe with acceptable drawdown
    //       but timeframe of 10m or 15m should be considered to tune.
    //
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    Defparam CUMULATEORDERS = TRUE
    //Defparam NOCASHUPDATE = TRUE
    
    X = 0
    Y = 1
    Z = 2
    Xhares = MinLot
    
    // Setup Indicators
    HULL = weightedaverage[Filtro](close)
    if AutoReverse = 1 then
    ARHULL = weightedaverage[ARFiltro](close)
    if ARHULL[y]>ARHULL[z] then
    Trend=1
    else
    Trend=0
    endif
    endif
    
    //Long trading
    if LongTrade = 1 then
    IF BarIndex>LastOrderBar and close[x] crosses over highest[6](high[1]) and hull[y] > hull[z] then
    if AutoReverse=0 and COUNTOFLONGSHARES < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLongShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[20](high[1]) and hull[y] > hull[z] then
    if AutoReverse=0 and COUNTOFLONGSHARES < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLongShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[50](high[1]) and hull[y] > hull[z] then
    if AutoReverse=0 and COUNTOFLONGSHARES < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLongShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[100](high[1]) and hull[y] > hull[z] then
    if AutoReverse=0 and COUNTOFLONGSHARES < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLongShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses over highest[200](high[1]) and hull[y] > hull[z] then
    if AutoReverse=0 and COUNTOFLONGSHARES < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLongShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofShortShares < MaxLot then
    sellshort Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    endif
    // Short trading
    if ShortTrade = 1 then
    IF BarIndex>LastOrderBar and close[x] crosses under highest[6](high[1]) and hull[y] < hull[z] then
    if AutoReverse=0 and COUNTOFSHORTSHARES < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[20](high[1]) and hull[y] < hull[z] then
    if AutoReverse=0 and COUNTOFSHORTSHARES < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[50](high[1]) and hull[y] < hull[z] then
    if AutoReverse=0 and COUNTOFSHORTSHARES < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[100](high[1]) and hull[y] < hull[z] then
    if AutoReverse=0 and COUNTOFSHORTSHARES < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    
    IF BarIndex>LastOrderBar and close[x] crosses under highest[200](high[1]) and hull[y] < hull[z] then
    if AutoReverse=0 and COUNTOFSHORTSHARES < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=1 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    elsif AutoReverse=1 and Trend=0 and CountofShortShares < MaxLot then
    SellShort Xhares CONTRACTS AT MARKET
    elsif AutoReverse=2 and CountofLONGShares < MaxLot then
    buy Xhares CONTRACTS AT MARKET
    endif
    SET STOP %LOSS sloss
    SET TARGET %PROFIT sprofit
    LastOrderBar=BarIndex
    ENDIF
    endif
    
    
    #254228 quote
    GraHal
    Participant
    Master

    Dai file .itf che hai pubblicato nel tuo post originale/primo…

    Maximus 3.0 mostra 8 variabili nell’Optimiser.

    Maximus 3.2 ne mostra 10.

    Il codice pubblicato sopra è lo stesso… v3 – 8 variabili e v3.2 – 10 variabili?

    #254230 quote
    JS
    Participant
    Senior

    In Maximus 3.0 alla riga 114 è indicato “Crosses Over”, mentre dovrebbe essere “Crosses Under”…

    In Maximus 3.2 AV invece è già presente “Crosses Under”…

    Una volta corretto questo en, utilizzando gli stessi parametri, i due codici producono esattamente lo stesso risultato…

    GraHal thanked this post
    #254233 quote
    Alessandro Furlani
    Participant
    Junior

    Ti ringrazio questa è la risposta giusta, non sò come ma mi è sfuggito

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

ProOrder che non danno stessi risultati


ProOrder: Trading Automatico & Backtesting

New Reply
Summary

This topic contains 12 replies,
has 4 voices, and was last updated by Alessandro Furlani
2 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/03/2025
Status: Active
Attachments: 7 files
Logo Logo
Loading...