ProBuilder DCLOSE ProBacktest DCLOSE

Forums ProRealTime English forum ProOrder support ProBuilder DCLOSE ProBacktest DCLOSE

  • This topic has 4 replies, 2 voices, and was last updated 3 hours ago by avatarWim.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #249550
    Wim

    Every now and then we see posts from indicator (ProBuilder) and strategy (Probacktest/ProOrder) developpers wondering why on earth their programmed indicator differs from the native on-chart indicator supplied by PRT itself (VWAP, Pivot Point, MACD, …). Most of the times this has to do with time zones or at which time exactly certain values are taken. Like the Close at closure of the exchange or at 22:00 GMT or …. I have seen cases where a programmed indicator normally was in sync with the native one, except for a month that had its first day on a monday.

    But this post is about the function DCLOSE that delivers a different result in ProBacktest than in ProBuilder, in the context of futures. This difference exists maybe also in the context of CFDs, but I have no means of verifying that.

    According to the documentation DCLOSE returns the “offical daily close”, determined by the Exchange following a certain protocol. In case of e.g. the DAX, the EUREX supplied Daily Close is normally close to the price at 17h30, but not exact. Now, suppose you are convinced having found a profitable, manual trading strategy, based on the Daily Pivot [(DHIGH+DLOW+DCLOSE)/3]. At first you want to build an indicator with ProBuilder, that supports you with trading signals on chart. You find that using DCLOSE in that Daily Pivot calculation gives you a programmed indicator exactly in sync with the native one that you used for developing your manual trading strategy. So far so good. Great help for your manual trading. Then you decide to take it a step further and integrate your beautiful indicator code in a robot with ProBacktest. You add order and position management coherent with your manual trading style and launch the backtest. Like your manual trading it is profitable, but . . . when looking closer at the trade entries, you notice that they do not correspond with the manual entries in that period. What???
    You add a bunch of GRAPHONPRICE statements, and that reveals that the ProBacktest Pivot levels are different from the ProBuilder Pivot levels. The last ones being identical to the native pivot levels. What the heck, same code, different calculation result. Zooming in a bit further, you find that the ProBacktest DCLOSE differs from the ProBuilder DCLOSE. Took me some time, but for the DAX it appeared that DCLOSE retrieves the 22h00 price when used in ProBacktest.
    So, very happy with the ProBuilder development team that decided to follow the documentation with the “official daily close”. But very unhappy with the ProBacktest development team that decided to take the 22h00 close (for DAX at least) instead of the official daily close.

    Huge dilemma now. Use DCLOSE for indicators to mimic exactly the native indicator. But use the 17h30 price (in case of DAX) for robots to approach as much as possible the native levels, because the 22h00 price, used by DCLOSE, is way off in general. OR … always use the 17h30 price, you will always be close to the native indicator but not spot on, but at least you have only one code version.
    The same story is valid for the Weekly and Monthly pivots of course, given that they build on DCLOSE also.

    Basically this invalidates ALL backtests done with calculations using directly DCLOSE or implying it indirectly, e.g. PRT supplied functions using DCLOSE under the hood.

    To illustrate my findings on differing DCLOSE and Daily Pivot levels, some screen captures are added. The chart shows you the DCLOSE(1) and the Daily Pivot from 3 sources: -1- Native indicators (white), -2- ProBuilder code (red, yellow), -3- ProBacktest code (green, cyan). Notice that ProBuilder mimics the native indicators perfectly, but not ProBacktest. The table gives you the numbers, where you can see that ProBacktest always takes the 22h00 price.
    I might produce another post on whether DCLOSE “repaints” in ProBuilder or not. My guess: it does.

    If you want to replay these tests with CFDs, find attached the ProBuilder and the ProBacktest code used for this item. Please report back your findings.

    #249684

    I tested this code in ProBackTest (both IG and PRT platforms), on a 1-hour TF:

    and this indicator, added to the same chart (in a separate panel below the price chart):

    the indicator reports exactly the same price as the Daily chart.

    ProBacktest, instead, is updated to the last closed bar.

     

     

     

    #249687
    Wim

    Thanks for responding @Roberto.

    DCLOSE(0) is not really an interesting call, because it is equivalent to CLOSE[0], in other words, it is just the close of the bar you are looking at, not at all the Daily Close of yesterday or earlier.
    I think DCLOSE is meant to be called with a value of 1 or higher, so DCLOSE(1), DCLOSE(2) etc. Then it refers to the Daily Close 1, 2 or more days back.
    Why don’t you put my 2 ITFs on a 30 Minute chart?  Why 30 Minutes, because you can check the 17h30 price also.
    Take the DAX index too, not an arbitrary action with totally different exchange closing times.

    Then you will see whether the values of the Previous Day close, and hence the Daily Pivot, are the same for ProBuilder and ProBacktest. Which is NOT the case for futures with IB. Will it be for CFDs with IG? Looking forward to your experiment.

    #249704

    Dclose(0) is the currernt DAILY price and is updated both by the indicator and the strategy, though the 30-minute chart is only updated when the 30-minute bar closes, in ProBackTest.

    Dclose(1)  is yesterday’s DAILY close on both the 30-minute and Daily chart.

    Dclose(2) is the day before yesterday’s DAILY close on both the 30-minute and Daily chart.

    Dclose(3) is the second day before yesterday’s DAILY close on both the 30-minute and Daily chart.

     

     

    #249707
    Wim

    I know DCLOSE and how to use it, thought you didn’t when you answered yesterday with dclose(0) related to my problem 🙂

    You need DCLOSE(1) for calculating todays Daily Pivot. But when ProBuilder and ProBacktest retrieve different DCLOSE(1)s, the Daily Pivots will differ also, as is the case with PRT/IB, Your ProBuilder Daily Pivot signals will not be equal to ProBacktest’s signals. I will ask a friend with PRT/IG, when he returns from holidays, to put my ITFs on a chart. That will show clearly whether this problem reproduces with PRT/IG.

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login