DPO: The instruction can not be used in automatic trading

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #71470 quote
    raphaelopilskiraphaelopilski
    Participant
    Senior

    Anyone of you guys has an idea how to solve the problem? I found the code in the spanish forum. the backtest is unreal I think.

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = false
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 220000
     
    // Impide al sistema operar en días precisos de la semana
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    x  = 4
    IF BarIndex - TradeIndex = x Then
    Sell at Market
    endif
    
    IF BarIndex - TradeIndex = x Then
    exitshort at Market
    endif
    
    // Condiciones para entrada de posiciones largas
    indicator1 = CCI[30]//30
    c1 = (indicator1 > 0)
    indicator2 = DPO[15](close)//15
    c2 = (indicator2 < 0)
     
    IF (c1 AND c2) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Condiciones de salida de posiciones largas
    indicator3 = CCI[30]//30
    c3 = (indicator3 CROSSES OVER 100)//100
     
    IF c3 THEN
    SELL AT MARKET
    ENDIF
     
    // Condiciones de entrada de posiciones cortas
    indicator4 = CCI[30]//30
    c4 = (indicator4 < 0)
    indicator5 = DPO[15](close)//15
    c5 = (indicator5 > 0)
     
    IF (c4 AND c5) AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
     
    // Condiciones de salida de posiciones cortas
    indicator6 = CCI[30]//30
    c6 = (indicator6 CROSSES UNDER 150)//180
     
    IF c6 THEN
    EXITSHORT AT MARKET
    ENDIF
     
    // Stops y objetivos
    SET STOP %LOSS 0.2
    SET TARGET %PROFIT 0.2
    
    #71473 quote
    NicolasNicolas
    Keymaster
    Legend

    DPO use future datas, which is of course impossible in real time, but possible in history. That’s why this indicator is not available in automatic trading and why you get amazin results in backtests.

    There are many topics around that deal with DPO of future and past datas (which is a code that use the same calculation but with current available data, not the future ones, and just like any other indicators!).

    immo_vienna thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

DPO: The instruction can not be used in automatic trading


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
8 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/28/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...