Inconsistent calculation of values in incomplete periods

Optuma Forums Optuma Scripting Inconsistent calculation of values in incomplete periods

This topic contains 1 reply, has 2 voices, and was last updated by Avatar Chad 3 days, 2 hours ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53987
    Avatar
    Dean
    • Topics: 10
    • Replies: 18
    • Posts: 28

    This post is sort of related to this post but is slightly different.

    It is about the calculation of values in incomplete periods.

    For example, take closing price. What should the weekly timeframe closing price be showing on Monday, Tuesday, Wednesday or Thursday on a daily chart? Should it be static and show last week’s (last Friday’s) closing value on every day, or should it be dynamic and change with each day’s new closing price?

    It seems that Optuma does it both ways. Some observations:

    1. A weekly chart does not wait until the end of the week before it gives the week’s closing price. The most recent bar will show the most recent closing price, even thought the week is incomplete from Monday-Thursday. In other words, the last bar on a weekly chart will show Monday’s closing price on Monday, Tuesday’s closing price on Tuesday, and so on. It keeps changing until the week is complete. The same occurs with other indicators too (e.g. Bollinger Bands, etc.)
    2. If a weekly closing price formula is plotted on a daily chart, it follows the daily closing price on Monday-Thursday, then settles to a final closing value on the Friday. See the attached screenshot where the thick green line (weekly closing price) is the same as the closing price on a Monday. This is the same behaviour as a weekly chart (see first observation).
    3. If the weekly closing price formula is shown as a cursor custom label, it remains at last week’s closing price from Monday to Thursday (see screen shot again, look for the label WeeklyClose at 2990.4 in the cursor labels). It is not dynamic in the same way as the weekly closing price is in observations 1 & 2.
    4. Using the weekly closing price formula in scripts gives the same outcome as observation 3. It is not dynamic in the same way as the weekly closing price is in observations 1 & 2.

    It seems that Optuma handles timeframes in different ways depending on the context you are operating in. I would prefer that a consistent approach is applied in all contexts. I’m sure that most would prefer that too.

    My view is that observations 1 & 2 above should be the standard way values are calculated in incomplete periods, in all contexts. That is, values are dynamic until the period is finished, at which time they become fixed in history.

    Please reply with your own views or experiences on this matter. Perhaps I’m missing something and I’d really appreciate some good advice or insight. Otherwise, it would be great if the Optuma scripting community was able to gain some consensus and provide feedback to Optuma.

    Many thanks, Dean

    Attachments:
    #54079
    Avatar
    Chad
    • Topics: 2
    • Replies: 8
    • Posts: 10

    Believe I've run into similar issues in Backtesting

    Hey Dean, I believe I’ve run into similar issues as you when running a script with daily parameters with a “weekly” override.  I have spoken with Optuma and it seems this is a known warning as I have been pointed to the following post which may also help you.

    In my case, I only want to make trades on Friday’s close, but as you note, this can become an issue given the dynamicism of the weekly data.

    The Danger Of Weekly Scripting

     

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 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