Back Tester and ROC

Optuma Forums Optuma Scripting Back Tester and ROC

This topic contains 3 replies, has 2 voices, and was last updated by Darren Darren 4 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47695

    John
    • Topics: 3
    • Replies: 4
    • Posts: 7

    Hi
    I have been playing around with Negative ROC as an exit in the Back Tester using this formula – ​ROC(Week(PERIODAMOUNT=1), BARS=1) < 0
    Using the Show View, the formula seems okay. But the results in the Back Tester are not what I would expect. I have attached an example but used a One Month period instead because it is easier to see my confusion. I would expect the exit day to be when the price is lower than one month ago. ​It’s like the exit trigger is coming from the future results, not results prior to the exit day. Can you please explain what is happening here?
    Thank you.

    Attachments:
    #47703
    Darren
    Darren
    • Topics: 29
    • Replies: 157
    • Posts: 186

    Hi John,

    I think it’s a timeframe issue. The exit in your example is because the day’s close is less than the month-end close of the day before. So when using ROC(Week(PERIODAMOUNT=1), BARS=1) it will use the weekly (Friday) close, regardless of when the test is run. Instead use the CHANGE function set to one week and it will be a rolling week rather than from the Friday.

    CHANGE(INT_TYPE=Week, INT_COUNT=1)

    See here for more info on ROC vs CHANGE:

    https://forum.optuma.com/topic/whats-the-difference-between-roc-and-change-functions/

    #47707

    John
    • Topics: 3
    • Replies: 4
    • Posts: 7

    Thanks Darren.  The ROC explanation makes sense but I am still having trouble rationalising the results on some tests.  Can you please clarify which period is the trigger date in the Back Tester.  I had assumed the Back Tester was showing the buy period and the trigger would be the period before (as I had enter next open day ticked).  The buy date on the example was 2 Oct 2017.

    #47711
    Darren
    Darren
    • Topics: 29
    • Replies: 157
    • Posts: 186

    Hi John,

    The timeframe for the signal criteria depends on the Data Timeframe setting in the test setup window. In this example the entry would be based on daily data and tested over the last 5 years (note that the timeframe isn’t included in the script formula so it will be based on daily MACD and MA values).

    Capture

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close