How to script the 2020 performance

Optuma Forums Optuma Scripting How to script the 2020 performance

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66797
    Regulo Alfonso
    • Topics: 1
    • Replies: 1
    • Posts: 2

    Hello I’m trying to script the 2020 performance using the following script:

    D1 = BARDATE()==STRDATE(DATE=2020-01-01);
    D2 = BARDATE()==STRDATE(DATE=2020-12-31);
    (VALUEWHEN(D2)/VALUEWHEN(D1))-1

    The result gives me -1
    I would appreciate it if you would help me to know where I am wrong.

    #66801
    Darren
    • Topics: 70
    • Replies: 871
    • Posts: 941

    Hi Alfonso,

    It’s because the market was closed on January 1st so the value for D1 cannot be found. If you change it to 2019-12-31 then the formula will be able to be calculated:

    Capture

    #66803
    Regulo Alfonso
    • Topics: 1
    • Replies: 1
    • Posts: 2

    Hi Alfonso,

    It’s because the market was closed on January 1st so the value for D1 cannot be found. If you change it to 2019-12-31 then the formula will be able to be calculated:

    Capture

    It keeps giving me -1.

    Is the script ok? Any other suggestions?

    Optuma Scritp

    #66808
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    The script looks ok, i’ve tested it here and it works ok.  One thing to note, when posting scripts please do not post a screen shot, rather copy and paste the script directly into the post, it makes it easier for us to test the code.

    First thing to check is when you open a chart you have historical data going back that far.  If you do not, run through Option 3 here.

    If the data is going back far enough for the script to work, try adjusting the Date Range property in the Watchlist to Everything.

    Ex4

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

Pin It on Pinterest