Backtest wrong results in hourly

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #108984 quote
    GL48
    Participant
    New

    Hi,

    The backtests no longer correspond to Proorder results in time frame 1H , with all my trading systems.

    Thanks for your help

    #109032 quote
    jebus89
    Participant
    Master

    how does it not correspond? Whats going wrong? screenshots? Code?

    Report this in PRT platform to the correct people! 🙂

    #109038 quote
    GL48
    Participant
    New

    Of course, here are the precisions

    I have a problem with my system tradings which in backtesting gives very different results, these are programs that are also in pro order autotrading, and the operations are not the same anymore. To verify, I copied the version of paper trading to test it in backtesting and the results are different from those that this version has given in pro order for 8 months.

    By observing the backtest of the models with the graph function on the conditions, I realized that the conditions on the indicators are activated in a wrong way.
    On the other hand, the transactions recorded in pro order , are in perfect correspondence with the situation requested on these indicators.
    In the backtests, I encounter this problem of conditions that are activated or not activated incorrectly, on all models, with data 1 hour.

    I created indicators showing the signal conditions of a trading system. I have run different timeframes on this trading system, I found that there is not always correspondence between the conditions of signals internal trading system and external indicators, for timeframes in hours full 1h, 2h, 3h …, 60min, 120 min, 180 min …

    But, there is always perfect match for all other timeframes; tick, sec, (min off full time  15, 30, 90min … ), daily.

    That’s my problem, where can these errors come from, only for the backtests corresponding to the hours?

    Many thanks for your help

    #109046 quote
    GraHal
    Participant
    Master

    Hi GL48

    What maybe you are confused about is that this website is the not the provider of the PRT Platform … don’t worry a few get confused in a similar way.

    All you need to do is raise a Technical Report (press Ctrl+M) then refer to your post above (link as below) as you have provided all the details in the post above.

    Hope that makes sense, if not just say.

    https://www.prorealcode.com/topic/backtest-wrong-results-in-hourly/#post-109038

    GL48 thanked this post
    #109047 quote
    GraHal
    Participant
    Master

    Press Ctrl+M when you are looking at the PRT Platform on your screen and you will Technical Report as the bottom option on the menu … click Tech Report then follow the instuctions.

    #109052 quote
    GraHal
    Participant
    Master

    We / the Community on here may be able to help, but could you provide screenshots showing the Issue as this will make it easier to understand the Issue.

    #109054 quote
    GL48
    Participant
    New

    Ok, I thank you for your help.

    I’ll send this message to PRT, hoping it can solve this problem quickly,

    I will post screenshots, maybe the community could have a solution.

    Best regards

    #109078 quote
    GL48
    Participant
    New

    Here are the screenshoots,

    For simplicity, I created a simple trading system and the external indicator corresponding to the same signal condition.
    I compare with the internal signal condition in backtest by the graph function.

    There are several errors in hourly, and no errors in 30 minutes.
    As a control, I replaced in this trading system, the signal condition by its equivalent external indicator, and that does not change anything.

    Trading-system-and-signal-indicator.png Trading-system-and-signal-indicator.png GLE-1-hour-2019_10_02-11h50.png GLE-1-hour-2019_10_02-11h50.png GLE-30-minutes-2019_10_02-11h52.png GLE-30-minutes-2019_10_02-11h52.png
    #109082 quote
    GraHal
    Participant
    Master

    Are you referring to differences … one example as shown at the red arrowheads on attached?

    I feel we are the point where we need to see the code of the External Indicator (as you call it).

    Please post code using the blue Insert PRT button on the toolbar above each new message.

    If anybody can see / understand the Issue better than me then by all means step in and help out!? 🙂

    GLG.jpg GLG.jpg
    #109085 quote
    Nicolas
    Keymaster
    Master

    Did you try to graph the average on the price in the backtest, to see if they match with the indicator’s ones?

    graphonprice indicator101
    graphonprice indicator111

    If they don’t match, try to add this at the beginning of the code, to see if that makes a difference or not:

    defparam preloadbars=0
    GL48 thanked this post
    #109094 quote
    GL48
    Participant
    New

    Hi Graham,

    Yes these are the differences, which should not exist because the external indicator is the exact replication of the internal indicators in the trading system. In the trading system, there is a crossover of moving averages, and in the external indicator, the same crossover of moving averages.

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    // Conditions to enter long positions
    indicator101=average[25,1]
    indicator111=average[50,0]
    c101=indicator101 >= indicator111
    IF c101 THEN
    buy 10000 CASH AT MARKET
    ENDIF
    graph(c101)
    // Conditions to exit long positions
    IF not c101  THEN
    sell AT MARKET
    ENDIF
    indicator101=average[25,1]
    indicator111=average[50,0]
    signal=indicator101 >= indicator111
    
    if signal=1 then
    value=1
    else
    value=0
    endif
    return value as "value"
    GraHal thanked this post
    #109108 quote
    GL48
    Participant
    New

    Hi Nicolas,

    Thank you for your help,

    graphonprice indicator101 and graphonprice indicator111 shows that the values ​​of moving averages calculated in 1H backtest are not equal to their values ​​on the graph, (MA on graph and external indicator are similar).
    Hence the 1 H backtest signals that did not match.

    On the other hand, the values ​​of the moving averages calculated in the 30-minute backtest are equal to their values ​​on the graph, (MA on graph and external indicator are similar).
    Hence, backtest signals that match.

    I added the daily to be sure, with the same result, it is correct.

    I tried to include at the beginning of the trading system, defparam preloadbars = 0, it had no effect.

    The result is very surprising for the 1 H backtest,

     

    Graph-on-price-1-hour-2019_10_02-15h19.png Graph-on-price-1-hour-2019_10_02-15h19.png Graph-on-price-30-minutes-2019_10_02-15h20.png Graph-on-price-30-minutes-2019_10_02-15h20.png Graph-on-price-Daily-2019_10_02-15h27.png Graph-on-price-Daily-2019_10_02-15h27.png
    #109117 quote
    GraHal
    Participant
    Master

    Indicator and System are aligned exactly.

    Try yours again using Buy 1 Contract instead of 10000 Cash. I know it doesn’t sound logical but you have to try anything / something and I had to anyway as attached is on my SB Account.

    What Market are you using … I’ll go and check your attachments and try on same market as you.

    GLG-2.jpg GLG-2.jpg
    #109119 quote
    GraHal
    Participant
    Master

    Ah now we are getting somewhere … on same market I can see a difference. but not on every trigger … weirde and weirder!? 🙂

    GLG-3.jpg GLG-3.jpg
    #109121 quote
    GraHal
    Participant
    Master

    Seems the Indicator is correct when the MA(25,1) crosses under the MA(50,0)  but the signal in the code does not trigger for another 6 bars / 6 Hours!!!!

    Well Weird!??

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

Backtest wrong results in hourly


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
GL48 @gl48 Participant
Summary

This topic contains 23 replies,
has 4 voices, and was last updated by GL48
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/01/2019
Status: Active
Attachments: 14 files
Logo Logo
Loading...