Timezone problem..I think!

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #165875 quote
    bullbear
    Participant
    Senior

    Hello

    I changed the time zone from UTC +2 to UTC +1 for a few days.

    Now when I change back to UTC +2 I do not get the same result when I do backtest.

    Maybe it’s I changed another setting without knowing what is affecting the backtest result?

    Tick ​​by Tick is selected.

    Is it possible to start PRT with basic settings to find my way back?

    #165880 quote
    robertogozzi
    Moderator
    Master

    Because from the previous backtests with UTC+2 and now, several bars may have elapsed, so 10K bars on a 1-minute TF could be completely different after a few days!

    #165882 quote
    bullbear
    Participant
    Senior

    You’re right there Roberto.

    But when a friend of mine does a backtest with the same code, we get different results.

    I’ve done something but I do not know what.

    Do you know if I can get default settings on PRT?

    #165884 quote
    robertogozzi
    Moderator
    Master

    I have never seen a RESET-TO-DEFAULT option/button

    Sorry not to be able to help you further.

    #165888 quote
    bullbear
    Participant
    Senior

    Hera is a backtest

    The code from the forum.

    This is how it looks on my computer.

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = true // Kumulieren von Positionen deaktiviert
    DEFPARAM Preloadbars = 300
     
    //timeframe(15 minute, updateonclose)
    
    gridStep = 20  //20
    MAXSHARES = abs(COUNTOFPOSITION) <= 1   //1
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
    noEntryBeforeTime = 010000
    timeEnterBefore = time >= noEntryBeforeTime
     
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
    noEntryAfterTime = 233000
    timeEnterAfter = time < noEntryAfterTime
     
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
     
    // Long
    indicator1 = Average[25](close)//25
    indicator2 = Average[180](close)//180
    c1 = (indicator1 CROSSES UNDER indicator2)
    indicator3 = ADX[14]
    c2 = (indicator3 > 10)
    indicator4 = ADX[14]
    c3 = (indicator4 < 30) //30
     
    IF not longonmarket and (c1 AND c2 AND c3) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    //grid
    if longonmarket and tradeprice-close>=gridStep*pointsize and maxshares then
    buy 2 contract at market
    endif
     
    // Longexit
    indicator5 = Average[25](close)//25
    indicator6 = Average[180](close)//180
    c4 = (indicator5 CROSSES OVER indicator6)
     
    IF c4 THEN
    SELL AT MARKET
    ENDIF
     
    // Stops und Targets
    SET STOP pLOSS 75 //75
     
    //timeframe(default)    //5 minute
    //************************************************************************
    //trailing stop function
    trailingstart = 8            //8   trailing will start @trailinstart points profit
    trailingstep  = 1            //1   trailing step to move the "stoploss"
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-positionprice>=trailingstart*pipsize THEN
    newSL = positionprice+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND positionprice-close>=trailingstart*pipsize THEN
    newSL = positionprice-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    
    r.jpg r.jpg
    #166033 quote
    bullbear
    Participant
    Senior

    I may have found the error now.

    I get the same results on my back tests regardless of whether I use “Tick by Tick” or not.
    Have tested with different codes and in different markets but there is no difference with or without “Tick by Tick”

    How do i solve this -)

    Regards B

    #166095 quote
    robertogozzi
    Moderator
    Master

    Tick-by-Tick dioesn’t affect your above code, as it has no TP.

    When Tick-by-Tick mode detects that both TP & SL  have been hit on the same bar, doesn’t assume TP was hit first (as it was before that addition, some years ago), but it scans the bar tick by tick to spot what was hit first.

    In your case there’s no TP, so there’s no need to check.

    #166201 quote
    Nicolas
    Keymaster
    Master

    Indeed, if there is no need to check intra bar price, tick by tick setting will not affect in any manner the results of the backtest.

    #166212 quote
    bullbear
    Participant
    Senior

    Thank you for your answers.

    Thought I had found the error.

    But something is strange with my back test.

    My back tests are incorrect.

    If anyone wants, feel free to test the code above.

    I suspect that you will get a completely different result with the same code.

    I used Spread = 1

    Tick ​​by Tick = yes

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

Timezone problem..I think!


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
bullbear @bullbear Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/31/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...