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?
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!
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?
I have never seen a RESET-TO-DEFAULT option/button
Sorry not to be able to help you further.
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
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
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.
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.
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