Optuma Forums › Optuma Scripting › How to script the 2020 performance › Reply To: How to script the 2020 performance
December 1, 2021 at 7:47 am
#66808
- Topics: 5
- Replies: 616
- Posts: 621
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.
1 2 3 4 5 |
D1 = BARDATE() == STRDATE(DATE=2019-12-31) ; D2 = BARDATE() == STRDATE(DATE=2020-12-31) ; (VALUEWHEN(D2) / VALUEWHEN(D1)) - 1 |
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.