Riaprire argomento su strategia proposta 3 anni fa

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #207995 quote
    StankoStanko
    Participant
    Senior

    Buongiorno doctrading e buongiorno a tutti.
    Vorrei riportare all’attenzione della community il sistema “FINE GIORNATA” postato tre anni fa da doctrading perchè le performance sono ancora interessanti.
    Con USD/JPY i backtest sono ottimi negli ultimi 4 mesi, in particolare con timeframe  1 minuto.
    Se qualche membro della community ha la possibilità e la pazienza di effettuare backtest più lunghi potrebbe essere utile per capire se questo sistema è veramente ottimo anche nel lungo periodo.
    Di seguito propongo una mia versione aggiornata in cui ho inserito la gestione della posizione tramite il sistema KAMA & SMA proposto da Roberto tempo fa, con uno stop fisso a 30.

    Defparam cumulateorders = false
     
    // TAILLE DES POSITIONS
    n = 1
     
    // PARAMETRES
    // high ratio = few positions
    // AUD/JPY : ratio = 0.5 / SL = 0.8 / TP = 1.2 / Period = 12
    // EUR/JPY : ratio = 0.6 / SL = 1 / TP = 0.8 / Period = 8
    // GBP/JPY : ratio = 0.5 / SL = 0.6 / TP = 1 / Period = 8
    // USD/JPY : ratio = 0.5 / SL = 1 / TP = 0.8 / Period = 12
     
    ratio = 0.6
    period = 8
     
    // HORAIRES
    startTime = 210000
    endTime = 231500
    exitLongTime = 210000
    exitShortTime = 80000
     
     
    // BOUGIE REFERENCE à StartTime
    if time = startTime THEN
    amplitude = highest[Period](high) - lowest[Period](low)
    ouverture = close
    endif
     
    // LONGS & SHORTS : every day except Fridays
    // entre StartTime et EndTime
    if time >= startTime and time <= endTime and dayOfWeek <> 5 then
    buy n shares at ouverture - amplitude*ratio limit
    sellshort n shares at ouverture + amplitude*ratio limit
    endif
     
    // Stop Loss & Take Profit
    // Stop e target
    //SET STOP PLOSS 25
    //SET TARGET PPROFIT 13 //395
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    //                                Trailing Stop
    //------------------------------------------------------------------------------------
    IF Not OnMarket THEN
    TrailStart    = 10          //10     Start trailing profits from this point
    BasePerCent   = 0.100       //10.0%  Profit to keep
    StepSize      = 6           //6      Pips chunks to increase Percentage
    PerCentInc    = 0.100       //10.0%  PerCent increment after each StepSize chunk
    RoundTO       = -0.5        //-0.5   rounds to Lower integer,  +0.4 rounds to Higher integer
    PriceDistance = 7 * pipsize//8.9    minimun distance from current price
    y1            = 0
    y2            = 0
    ProfitPerCent = BasePerCent
    ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONG
    x1 = (close - tradeprice) / pipsize                            //convert price to pips
    IF x1 >= TrailStart THEN                                       //go ahead only if N+ pips
    Diff1         = abs(TrailStart - x1)
    Chunks1       = max(0,round((Diff1 / StepSize) + RoundTO))
    ProfitPerCent = BasePerCent + (BasePerCent * (Chunks1 * PerCentInc))
    ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))
    y1 = max(x1 * ProfitPerCent, y1)                            //y = % of max profit
    ENDIF
    ELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN//SHORT
    x2 = (tradeprice - close) / pipsize                            //convert price to pips
    IF x2 >= TrailStart THEN                                       //go ahead only if N+ pips
    Diff2         = abs(TrailStart - x2)
    Chunks2       = max(0,round((Diff2 / StepSize) + RoundTO))
    ProfitPerCent = BasePerCent + (BasePerCent * (Chunks2 * PerCentInc))
    ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))
    y2 = max(x2 * ProfitPerCent, y2)                           //y = % of max profit
    ENDIF
    ENDIF
    IF y1 THEN                                        //Place pending STOP order when y>0
    SellPrice = Tradeprice + (y1 * pipsize)        //convert pips to price
    IF abs(close - SellPrice) > PriceDistance THEN
    IF close >= SellPrice THEN
    SELL AT SellPrice STOP
    ELSE
    SELL AT SellPrice LIMIT
    ENDIF
    ELSE
    SELL AT Market
    ENDIF
    ENDIF
    IF y2 THEN                                        //Place pending STOP order when y>0
    ExitPrice = Tradeprice - (y2 * pipsize)        //convert pips to price
    IF abs(close - ExitPrice) > PriceDistance THEN
    IF close <= ExitPrice THEN
    EXITSHORT AT ExitPrice STOP
    ELSE
    EXITSHORT AT ExitPrice LIMIT
    ENDIF
    ELSE
    EXITSHORT AT Market
    ENDIF
    ENDIF
    
    set stop ploss 30
    
    #208023 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Puoi postare un linkal vecchio post?

    #208041 quote
    StankoStanko
    Participant
    Senior

    Questo è il link relativo alla strategia di doctrading:

    https://www.prorealcode.com/prorealtime-trading-strategies/end-of-day-yen-m15/

    #208088 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ti allego due foto dei backtest fatti con 1M, cioè 1 milione, di barre.

    Una è SENZA l’opzione tick-per-tick (ed il periodo di backtest è maggiore), l’altra è CON l’opzione tick-per-tick (ed il backtest parte dall’1/8/2010, prima non era disponibilie).

    Stanko thanked this post
    Test1M-senza-tick-per-tick.jpg Test1M-senza-tick-per-tick.jpg Test1M-tick-per-tick.jpg Test1M-tick-per-tick.jpg
    #208102 quote
    StankoStanko
    Participant
    Senior

    Molte grazie Roberto.

    Non mi sembra ci siano conferme sulla tenuta delle performances…

    Buona giornata.

    robertogozzi thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Riaprire argomento su strategia proposta 3 anni fa


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Stanko @stanko Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by StankoStanko
3 years, 8 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 01/23/2023
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...