TICK BY TICK – A SYSTEM TO TEST PLEASE

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #14159 quote
    GraHal
    Participant
    Master

    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!

    [attachment file=14160]
    [attachment file=”67 Bars Equity Curve.jpg”]

    Code to Produce Results A:

    (Note : OR POSITIONPERF < – 0.004 is ‘Commented Out of the Code’)

    DEFPARAM CUMULATEORDERS=FALSE
    
    Hi = HIGHEST[225](HIGH[1])
    Lo = LOWEST[180](LOW[1])
    
    //Go Long
    IF high>Hi and close>open and range>range[1] and open>((high+low)[1]/2)  THEN
    BUY 1 Contract AT MARKET
    endif
    
    //Go Short
    If Low<Lo and close<open and range>range[1] and open<((high+low)[1]/2)  THEN
    sellSHORT 1 Contract at market
    endif
    
    //Exit Long
    IF LONGONMARKET AND (BARINDEX - TRADEINDEX ) = 460 OR POSITIONPERF > 0.025  THEN
    sell AT MARKET
    ENDIF
    //OR POSITIONPERF < - 0.004
    
    //Exit Short
    IF SHORTONMARKET AND (BARINDEX - TRADEINDEX ) = 385 OR POSITIONPERF > 0.016  THEN
    EXITSHORT AT MARKET
    ENDIF
    //OR POSITIONPERF < - 0.004

     

    RESULTS B

    [attachment file=14162]
    [attachment file=14163]

    Code to Produce Results B:

    (Note : OR POSITIONPERF < – 0.004 is ‘Inserted In the Code’)

     DEFPARAM CUMULATEORDERS=FALSE

    Hi = HIGHEST[225](HIGH[1])
    Lo = LOWEST[180](LOW[1])
    
    //Go Long
    IF high>Hi and close>open and range>range[1] and open>((high+low)[1]/2)  THEN
    BUY 1 SHARE AT MARKET
    endif
    
    //Go Short
    If Low<Lo and close<open and range>range[1] and open<((high+low)[1]/2)  THEN
    sellSHORT 1 SHARE at market
    Endif
    
    //Exit Long
    IF LONGONMARKET AND (BARINDEX - TRADEINDEX ) = 460 OR POSITIONPERF > 0.025  OR POSITIONPERF < - 0.004 THEN
    sell AT MARKET
    ENDIF
    
    //Exit Short
    IF SHORTONMARKET AND (BARINDEX - TRADEINDEX ) = 385 OR POSITIONPERF > 0.016 OR POSITIONPERF < - 0.004 THEN
    EXITSHORT AT MARKET
    ENDIF
    


    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.

    67-Bars.jpg 67-Bars.jpg 67-Bars-Equity-Curve.jpg 67-Bars-Equity-Curve.jpg 0-Bars.jpg 0-Bars.jpg 0-Bars-Equity-Curve.jpg 0-Bars-Equity-Curve.jpg
    #14165 quote
    Nicolas
    Keymaster
    Master

    Because of the spread, your trade has a negative positionperf when it is launch on market. Try to remove the spread from your analysis and see if it is the same.

    #14168 quote
    GraHal
    Participant
    Master

    The only place I can reduce the spread is in the settings on the right of the BackTest Screen (see attached .jpg) … is that what you mean Nicolas?

    In any case, the System ran fine for several days from the 21 Sep up to the 29 Sep 16 @ 08.30.

    Cheers

    GraHal

    [attachment file=14169]

    Spread.jpg Spread.jpg
    #14171 quote
    GraHal
    Participant
    Master

    Reduced the Spread to 1 (from 2) – same results.

    Reduced the Spread to 0.6 (from 1) – same results.

    #14181 quote
    Nicolas
    Keymaster
    Master

    and by removing it completely? (for testing purpose only of your problem).

    #14190 quote
    GraHal
    Participant
    Master

    With spread at zero the Trade on 29 Sep @ 08.30 shows as 0 bars – see attached

    Spread-Zero-0.jpg Spread-Zero-0.jpg
    #14193 quote
    GraHal
    Participant
    Master

    With nil spread and POSITIONPERF < - 0.004 REM out then the 67 bars appears again - see attached

    Pos-Perf-REM-Out.jpg Pos-Perf-REM-Out.jpg
    #14216 quote
    Nicolas
    Keymaster
    Master

    I’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”).

    positionperf-met.png positionperf-met.png
    #14235 quote
    GraHal
    Participant
    Master

    Mmm 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?)

    //Exit Long
    IF LONGONMARKET AND (BARINDEX - TRADEINDEX ) = 460 OR POSITIONPERF > 0.025  OR POSITIONPERF < - 0.004 THEN
    sell AT MARKET
    ENDIF

    Many Thanks for your Valuable Time looking at this Nicolas

    GraHal

    #14237 quote
    Nicolas
    Keymaster
    Master

    Yes 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?

    #14605 quote
    GraHal
    Participant
    Master

    Thanks 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

    #14633 quote
    Nicolas
    Keymaster
    Master

    I get the same results with or without the tick/tick tests.

    tick-by-tick-backtesting-dax.png tick-by-tick-backtesting-dax.png
    #14684 quote
    GraHal
    Participant
    Master

    Ah 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

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

TICK BY TICK – A SYSTEM TO TEST PLEASE


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 12 replies,
has 2 voices, and was last updated by GraHal
9 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/03/2016
Status: Active
Attachments: No files
Logo Logo
Loading...