INTERROMPERE UN SISTEMA QUANDO RAGGIUNGE IL MASSIMO DRAWDOWN IMPOSTATO

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #183892 quote
    Wolf Trades
    Participant
    Average

    Salve a tutti, controllando il forum sull’argomento ho trovato il codice che inserisco.

    Purtroppo, anche se sembra scritto bene, i sistemi si interrompono durante trade molto negativi, anche se non viene raggiunto il drawdown storico che si inserisce manualmente.

    Durante i backtest queste interruzioni non si vedono (provare sul dow jones), altre volte invece ( provare sul copper) il sistema si interrompe anche durante i backtest.

    Qualcuno può fornire un codice testato in reale che permetta di utilizzare l’istruzione quit correttamente?

    Grazie

    //////////////////// ******************** CODICE MAX DRAWDOWN - MAX TRADE LOSS CONSECUTIVI E DATA DI SCADENZA ******************** ////////////////////
    // Max DRAWDOWN
    // Max Trade Lossconsecutivi
    // Data Scadenza TS
     
    MaxTradeLoss = 30                    // Massimo trade perdenti consecutivi
    Scadenza = date >= 20250331         // Data scadenza TS //Marzo 2025
    // Max Drawdown
    
    ONCE Capital  = 50000
    ONCE MinPoint = Capital
    ONCE MaxPoint = 0
    ONCE MaxRU    = 0
    ONCE MaxDD    = 50000 * size
    //------------------------------------------
    //       EQUITY
    Equity        = Capital + StrategyProfit
    TempProfit    = PositionPerf * PositionPrice / PipSize
    TempEquity    = Equity + TempProfit
    //------------------------------------------
    //       DrawDown
    MaxPoint      = max(MaxPoint,TempEquity)
    DD            = MaxPoint - TempEquity
    MaxDD         = max(MaxDD,DD)
    //
    //------------------------------------------
     
    // Max Trade Loss
     
    if StrategyProfit < StrategyProfit[1]  then
    Perdo = Perdo+1
    else
    if StrategyProfit > StrategyProfit[1] then
    Perdo=0
    endif
    endif
     
    if (abs(DD) >= MaxDD) or (perdo >= MaxTradeLoss ) or Scadenza then
    quit
    endif
    //
    //////////////////// ******************** FINE CODICE MAX DRAWDOWN - MAX TRADE LOSS CONSECUTIVI E DATA DI SCADENZA ******************** ////////////////////
    
    #184186 quote
    robertogozzi
    Moderator
    Master

    Non saprei, questa non esce (Dax, 1H-4H-Daily, 200K):

    //////////////////// ******************** CODICE MAX DRAWDOWN - MAX TRADE LOSS CONSECUTIVI E DATA DI SCADENZA ******************** ////////////////////
    // Max DRAWDOWN
    // Max Trade Lossconsecutivi
    // Data Scadenza TS
    Size         = 1
    MaxTradeLoss = 30                    // Massimo trade perdenti consecutivi
    Scadenza = date >= 20250331         // Data scadenza TS //Marzo 2025
    // Max Drawdown
     
    ONCE Capital  = 50000
    ONCE MinPoint = Capital
    ONCE MaxPoint = 0
    ONCE MaxRU    = 0
    ONCE MaxDD    = 50000 * size
    //------------------------------------------
    //       EQUITY
    Equity        = Capital + StrategyProfit
    TempProfit    = PositionPerf * PositionPrice / PipSize
    TempEquity    = Equity + TempProfit
    //------------------------------------------
    //       DrawDown
    MaxPoint      = max(MaxPoint,TempEquity)
    DD            = MaxPoint - TempEquity
    MaxDD         = max(MaxDD,DD)
    //
    //------------------------------------------
     
    // Max Trade Loss
     
    if StrategyProfit < StrategyProfit[1]  then
       Perdo = Perdo+1
    else
       if StrategyProfit > StrategyProfit[1] then
          Perdo=0
       endif
    endif
     
    if (abs(DD) >= MaxDD) or (perdo >= MaxTradeLoss ) or Scadenza then
       quit
    endif
    
    MyLongConditions = Not OnMarket AND close CROSSES OVER average[200,0](close)
    IF MyLongConditions and x=0 THEN
       BUY 1 CONTRACT AT MARKET
       SET STOP   pLOSS   500
       SET TARGET pPROFIT 1000
    ENDIF
    //graph Equity
    //graph TempEquity
    //graph MaxPoint
    //graph DD
    //graph MaxDD
    //graph Perdo
    x-12.jpg x-12.jpg
    #184500 quote
    Wolf Trades
    Participant
    Average

    Purtroppo non funziona.

    Puoi farmi un esempio dei tuoi che usi per il tuo live trading?

    #184505 quote
    robertogozzi
    Moderator
    Master

    Non uso questo sistema.

    Il DrawDown (quello che mi segnala il backtest, alla fine delle ottimizzazioni, sempre con 1 contratto) lo inserisco maualmente nel codice per poi attivare la gestione dei lotti, per il resto non lo uso.

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

INTERROMPERE UN SISTEMA QUANDO RAGGIUNGE IL MASSIMO DRAWDOWN IMPOSTATO


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Wolf Trades @lupo32 Participant
Summary

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

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