Tick by tick – again
Forums › ProRealTime English forum › ProOrder support › Tick by tick – again
- This topic has 14 replies, 5 voices, and was last updated 7 years ago by
patrick356.
-
-
08/31/2017 at 6:57 PM #45078
Sorry, I know we’ve been over this a thousand times, but I couldn’t find an answer to this when searching.
Tick by tick is marked, and I’m going to optimizing some variables, but I get the same results in the Detailed Report as the Optimize Report. Normally, when clicking a row the tick by tick test is done – right? And this code has many inside candles.
So either way, something is weird with this back-test, or I found the perfect code!
Thanks!
T
08/31/2017 at 7:17 PM #4508008/31/2017 at 7:20 PM #4508108/31/2017 at 7:43 PM #4508309/02/2017 at 9:31 AM #45208If you click in a row, you have to make once again a backtest with the found variables, with no optimisation, in tick-by-tick mode. Otherwise, you’ll have get the “old” version of the backtest (without inside bars checking).
1 user thanked author for this post.
09/04/2017 at 8:22 AM #45329Exactly – but this time nothing happened when I clicked the rows. I got the same values in the Detailed Report as in the Optimize Report, as you can see in the picture. The tick-by-tick is done automatically when clicking the rows, right? I don’t have to do anything else?
09/04/2017 at 10:18 AM #4534409/04/2017 at 12:21 PM #45353I have tried that. Then I get completly different result, even though using the same values as the row in the Optimize Report. So it must be that it won’t use the tick-by-tick when optimizing, dispite marking the rows.
Ever heard of this issue before?
09/04/2017 at 4:36 PM #45397The optimizer don’t use tick-by-tick, even if the option is checked. That’s why there is a column named “Tick mode” that telling you how much bars are considered to be a ‘problem’ to the current backtest engine because of the famous “zero bar issue”.
So with the optimisation reports, pick the strategy you are feeling enough good and then launch new backtests, one by one, this time with no optimisation (with fixed values). Hope I’m clear now 🙂
1 user thanked author for this post.
09/04/2017 at 8:57 PM #45423Yes, that I know.
But let me try again. On other optimizations, the tick-by-tick backtest was performed for each combination of optimized values by clicking on the rows. Then I get another result in the Detailed Report than in the Optimize Report, using the same values due to the tick-by-tick backtest.
This time, the results of the backtest was the same in the Detailed Report as in the Optimize Report, even though clicking the rows. The backtest is not performed tick-by-tick by clicking the rows, like before. Which is also verified by using the same combination of values without optimizing (then is tick-by-tick performed).
So, to conclude – I was hoping to be able to perform the tick-by-tick backtest by clicking the rows – like always before – instead of exiting and changing manually. I have not seen this “problem” before and hope there might be a solution.
Sorry for repeating this – appreciate your help!
09/06/2017 at 4:37 PM #4564909/13/2017 at 8:24 AM #46079Sorry for late answer, been quite busy recently 🙁
I think that you are lead into error because of the 0 zero bar phenomena that might happen during optimisations. Some strategies have none, or some have a lot and that’s why clicking on a row might change a lot the results of the backtest:
If a strategy has no more than (for instance) 1 or 2% of its trade during only 1 bar: the result between no tick-by-tick or tick backtests would certainly be the same, or with such a small difference that you will not perceive it, so IMO that’s why you think the backtester has a different behavior now than before.
02/14/2018 at 10:26 AM #62692You seem to be completely correct in this. In my case there are no tick-by-tick test performed when clicking on a single row in the optimization window (even though tick-by-tick is selected). The only way to get a tick-by-tick test to be performed seem to be to transfer all the optimized values to fixed values.
For my current strategy this makes it just 1/4 as profitable as when just clicking on a single row in the optimization window. I find this quite disturbing as it makes the optimization quite much harder to perform. IT-finance should really put down some more efforts on documentation as I can’t find this behavior documented anywhere.
Anyone has some better idea of how to optimize tick-by-tick the easiest way?
02/14/2018 at 11:02 AM #62703It would be so much easier if you put your code on here then we can do same as you with your code but on our Platform and report back with our results / findings.
Only time I’ve got same result when clicking a row is if there were a zero / 1 or 2 in the tick mode column (as Nicolas said).
Cheers
GraHal02/15/2018 at 7:25 AM #62793OK, here comes the code. It’s basicly the short part of the ALE tradings system “Smoothed Bollinger”, https://www.prorealcode.com/prorealtime-trading-strategies/smoothed-bollinger-strategy-daily/, with some small modifications. The optimization values are those behind comment marks.
The optimization is done on USDJPY mini. Tested this morning with the same result – no tick by tick is performed until you set the values as constants.
The strange thing is that I tested an completely different system and optimized that one too. I that case it worked as it should – tick by tick were performed when clicking on the different optimization window rows.
Smoothed bollinger Short123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081DEFPARAM preloadbars = 400DEFPARAM CumulateOrders = FALSEONCE avgEnterEnabled = 1 //Moving Average Entry Filter - 0 OFF, 1 ONONCE trailingStopType = 1 // Trailing Stop - 0 OFF, 1 ON//ONCE takeprofit = 6 // Take Profit %//ONCE stoploss = 8 // Stop Loss %//ONCE trailingstopshort = 3 // Trailing Stop Atr Relative Distance//ONCE barshort = 2 // Exit Time Short//ONCE atrtrailingperiod = 200 // Atr parameter ValueONCE minstop = 2 // Minimum Trailing Stop Distance// MOVING AVERAGE - Parameter//ONCE avgDiffPeriod = 300//ONCE minDiffAvg = 0.003//ONCE avgLongPeriod = 120// Smoothed Bollinger %b indicator - Parameters//ONCE period = 14//ONCE TeAv = 6//ONCE SveEnterShortThreshold = 80// TRAILINGSTOP//----------------------------------------------//atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000 // för indexatrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize) // för forextrailingstartS = round(atrtrail*trailingstopshort)if trailingStopType = 1 THENTGS=trailingstartsif not onmarket thenMINPRICE = closePREZZOUSCITA = 0 // = utgångsprisENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenif tradeprice(1)-MINPRICE>=MINSTOP thenPREZZOUSCITA = MINPRICE+TGS*pointsizeELSEPREZZOUSCITA = MINPRICE + MINSTOP*pointsizeENDIFENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPENDIFENDIF//--------------------------------------------------------------------------------------------------// FILTER SETTINGS//--------------------------------------------------------------------------------------------------//MOVING AVERAGElongAvg = Average[avgLongPeriod] (close)diffAvg = Average[avgDiffPeriod] (close)//avgFilterEnterShort = (close<longAvg OR NOT avgEnterEnabled)avgFilterEnterShort = ((close<longAvg AND (diffAvg[1]-diffAvg)>minDiffAvg) OR NOT avgEnterEnabled)//Smoothed Bollinger %b indicatorhaOpen = ((Open[1]+High[1]+Low[1]+Close[1])/4 + (Open[2]+High[2]+Low[2]+Close[2]))/2haC = ((Open+High+Low+Close)/4 + haOpen + Max(high,haOpen) + Min(low,haOpen)) /4TMA1 = tema[TeAv](haC)TMA2 = tema[TeAv](TMA1)Diff = TMA1-TMA2ZlHA = TMA1+Diffpercb = (tema[TeAv](ZLHA)+2*STD[period](tema[TeAv](ZLHA))-weightedaverage[period](tema[TeAv](ZLHA))) / (4*STD[period](tema[TeAv](ZLHA)))*100SveFilterEnterShort = (percb > SveEnterShortThreshold )// STRATEGY//--------------------------------------------------------------------------------------------------IF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort THENSELLSHORT 1 CONTRACT AT MARKETENDIFIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIFSET STOP %LOSS stoplossSET TARGET %PROFIT Takeprofit -
AuthorPosts
Find exclusive trading pro-tools on