Strange Syntax when using DONCH()

Optuma Forums Optuma Scripting Strange Syntax when using DONCH()

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #62839
    AvatarLester
    • Topics: 22
    • Replies: 35
    • Posts: 57

    Could someone please explain the following.

    I wrote the following script some time back and I suspect was given help by the Optuma team.  Unfortunately, I cannot remember the details of how the syntax works.

    This script is used in a weekly Time Frame.

    I would like to know if the script is correct in regards to the use of the square brackets [] and also the use of ‘WEEK’ which precedes DONCH() in VAR1.

    Removal of either ‘WEEK’ or the square brackets alters the way the script works (it makes it worse).

    I would like to know what is happening.  Use of Show Bars shows only a slight difference.  All versions of script are stable when viewed as Show Bars and using Training Mode bar by bar.

    Incidentally I am aware that the use of WEEK() in VAR2 denotes the closing price of a WEEK.

    Any help would be greatly appreciated.

    Cheers, Lester

    #62866
    MatthewMatthew
    • Topics: 5
    • Replies: 346
    • Posts: 351

    Hi,

    VAR1 is finding a Weekly value for the Donchian Channel.
    VAR2 is finding the Weekly Close value.

    The 3rd line is looking for instances where the previous weekly close crosses above the previous weeks Donchian Channel.

    When time frame overrides like WEEK() are being used, it is usually because the script is being applied to a chart with a different time frame (like Daily).

    #62871
    AvatarLester
    • Topics: 22
    • Replies: 35
    • Posts: 57

    Hi Matthew,
    Thank you for your explanation.

    Could you also please explain the difference between  “VAR2” verses “VAR2[1]”?

    Cheers, Lester

    #62872
    MatthewMatthew
    • Topics: 5
    • Replies: 346
    • Posts: 351

    Hi,

    VAR2 references the current value, where as VAR2[1] is the previous value.  The [1] is an offset.

    https://help.optuma.com/kb/faq.php?id=1070

    #62875
    AvatarLester
    • Topics: 22
    • Replies: 35
    • Posts: 57

    Hi Matthew,
    Thank you.
    Cheers, Lester

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