TICK BY TICK – A SYSTEM TO TEST PLEASE
Forums › ProRealTime English forum › ProOrder support › TICK BY TICK – A SYSTEM TO TEST PLEASE
- This topic has 12 replies, 2 voices, and was last updated 8 years ago by GraHal.
-
-
10/03/2016 at 7:37 PM #14159
Hi Guys
Has anybody got the new ‘Tick by Tick Backtester’ who might be able to help please?
I have a System that is giving weird results.
RESULTS A: The Trade highlighted is the issue Trade!
Code to Produce Results A:
(Note : OR POSITIONPERF < – 0.004 is ‘Commented Out of the Code’)
1234567891011121314151617181920212223242526DEFPARAM CUMULATEORDERS=FALSEHi = HIGHEST[225](HIGH[1])Lo = LOWEST[180](LOW[1])//Go LongIF high>Hi and close>open and range>range[1] and open>((high+low)[1]/2) THENBUY 1 Contract AT MARKETendif//Go ShortIf Low<Lo and close<open and range>range[1] and open<((high+low)[1]/2) THENsellSHORT 1 Contract at marketendif//Exit LongIF LONGONMARKET AND (BARINDEX - TRADEINDEX ) = 460 OR POSITIONPERF > 0.025 THENsell AT MARKETENDIF//OR POSITIONPERF < - 0.004//Exit ShortIF SHORTONMARKET AND (BARINDEX - TRADEINDEX ) = 385 OR POSITIONPERF > 0.016 THENEXITSHORT AT MARKETENDIF//OR POSITIONPERF < - 0.004RESULTS B
Code to Produce Results B:
(Note : OR POSITIONPERF < – 0.004 is ‘Inserted In the Code’)
DEFPARAM CUMULATEORDERS=FALSE
12345678910111213141516171819202122Hi = HIGHEST[225](HIGH[1])Lo = LOWEST[180](LOW[1])//Go LongIF high>Hi and close>open and range>range[1] and open>((high+low)[1]/2) THENBUY 1 SHARE AT MARKETendif//Go ShortIf Low<Lo and close<open and range>range[1] and open<((high+low)[1]/2) THENsellSHORT 1 SHARE at marketEndif//Exit LongIF LONGONMARKET AND (BARINDEX - TRADEINDEX ) = 460 OR POSITIONPERF > 0.025 OR POSITIONPERF < - 0.004 THENsell AT MARKETENDIF//Exit ShortIF SHORTONMARKET AND (BARINDEX - TRADEINDEX ) = 385 OR POSITIONPERF > 0.016 OR POSITIONPERF < - 0.004 THENEXITSHORT AT MARKETENDIF
My concern is …Results A … for the Trade on 29 Sep 16 @ 08.30 I can see 67 bars (with OR POSITIONPERF < – 0.004 commented out of the code).
BUT
Results B … the Trade on 29 Sep 16 @ 08.30 I can see 0 bars (with OR POSITIONPERF < – 0.004 inserted in the code).
Okay we all know about ‘0 bars Issue’ but not 67 / multiple bars becoming 0 bars??
You will note from the ‘GRAPH Variables’ that the Trade on 29 Sep 16 @ 08.16 also hit the POSITIONPERF < – 0.004 (see the GRAPH variable at the bottom of the Equity Curves .jpgs above) but this Trade @08.16 was NOT reduced to 0 bars (as was the Trade on 29 Sep 16 @ 08.30).
The above anomaly set my alarm bells ringing … does the PRT Platform have another ‘hidden weakness’ which the new ‘Tick by Tick’ engine may NOT rectify??
So … I put this System up for analysis, mainly using the new ‘Tick by Tick’ engine, but also – out of interest – to see if you get the same weird results with the Trade on 29 Sep 16 @ 08.30.
I am with IG and the above is a spreadbet on the DAX @ £1 per point UK Summer Time.
Hope above makese sense, if not just say.
GraHal
PS Have I attached files incorrectly? Is there any way to embed the .jpgs in the text? In my opinion (?) it breaks the reading flow having to scroll down, find the .jpg reference, open, view then scroll back up to where you left off reading the text.
10/03/2016 at 7:49 PM #1416510/03/2016 at 7:59 PM #1416810/03/2016 at 8:06 PM #1417110/04/2016 at 6:34 AM #1418110/04/2016 at 8:27 AM #1419010/04/2016 at 8:33 AM #1419310/04/2016 at 11:43 AM #14216I’m sorry, but I’m not sure I understand you correctly.
You mean that the POSITIONPERF<-0.004 close the trade in the same bar as its opened one? From my own test and conclusion, this is what happen:
The previous trade was closed because of a positionperf<-0.04 (seen screenshot attached). All conditions are met on the same candlestick to open a newest long trade, but the positionperf negative is still true, so your newest long trade only last 1 (or “0 bar”).
10/04/2016 at 1:07 PM #14235Mmm I can see your logic, so I just did another test.
With positionperf<-0.04 INACTIVE (REM Out) on the Exit Short command
AND at the same time
With positionperf<-0.04 ACTIVE on the Exit Long command
The Long Trade on 29 Sep 16 @ 08.30 appears as 0 bars.
The Long Trade on 29 Sep @ 08.30 doesn’t go to a loss of 0.4% on its opening bar (bar 1) … as we can see from my GRAPH Variables in the original post. The 0.4% loss on the Long Trade occurs on bar 67.
So you are saying that the positionperf<-0.04 ACTIVE on the Exit Long command has triggered due to positionperf<-0.04 on the previous short trade (With positionperf<-0.04 INACTIVE (REM Out) on the Exit Short command)??
If the answer is Yes … then is there any way to amend the Exit Long Command below so it is triggered by a loss on a Long Trade ONLY (to stop it triggering on the previous Short Trade … as you are sugesting?)
1234<span class="token comment" spellcheck="true">//Exit Long</span><span class="token keyword">IF</span> <span class="token keyword">LONGONMARKET</span> <span class="token keyword">AND</span> <span class="token punctuation">(</span><span class="token keyword">BARINDEX</span> <span class="token operator">-</span> <span class="token keyword">TRADEINDEX</span> <span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token number">460</span> <span class="token keyword">OR</span> <span class="token keyword">POSITIONPERF</span> <span class="token operator">></span> <span class="token number">0.025</span> <span class="token keyword">OR</span> <span class="token keyword">POSITIONPERF</span> <span class="token operator"><</span> <span class="token operator">-</span> <span class="token number">0.004</span> <span class="token keyword">THEN</span><span class="token keyword">sell</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span>Many Thanks for your Valuable Time looking at this Nicolas
GraHal
10/04/2016 at 2:07 PM #14237Yes I think this is what happened. Since the whole code is load once at the end of the bar, the trigger to close the previous short trade is still valid as long as there is no new bar between this old trade and a new one initiated. I came across the same problem but for other conditions testing recently..
For that specific case (and it is just a supposition), maybe you can resolve it by eliminating everything about positionperf tests and replace them with pending stop orders at a calculated percentage profit price or with just the simple TARGET PROFIT and STOP LOSS instructions, what do you think?
10/10/2016 at 8:37 PM #14605Thanks Nicolas, apologies for delay (I’ve been busy fixing my car) yes I replaced PositionPerf with %Gain / % Loss and it worked ‘technically fine’ … but at less profit … even with the same %gain / % loss figures 🙂 ha).
If you get chance, please might you (or anybody?) try the ‘Resukts B code’ (with the PositionPerf – 0.004 active) using the Tick by Tick Backtester? That was my main reason for putting the code up on here … to see if the PositionPerf works any different under Tick by Tick Backtest.
No big deal if you don’t get chance, I’ll try it and Report back on here … if we ever get Tick by Tick with IG! 🙁
Thank You
Grahal
10/11/2016 at 8:41 AM #1463310/11/2016 at 12:20 PM #14684Ah so the … Exit Long with PositionPerf – 0.004 can be triggered by an immediate previous Short Trade (with no bar in between short trade and long trade) … is a ‘peculiarity’ of the PositionPerf instruction.
Just wanted to ‘close the loop’ and make that statement for the benefit of others reading this thread.
Thank You again Nicolas
GraHal
-
AuthorPosts
Find exclusive trading pro-tools on