Optuma Forums › Optuma Scripting › Create The Arms Index Calculation › Reply To: Create The Arms Index Calculation
June 28, 2021 at 9:16 am
#65106
- Topics: 5
- Replies: 625
- Posts: 630
Hi Louis,
Thank you for your post.
From what I can see there are two small issues with the scripts syntax.
The first is on the D variable, you have an open bracket before the first GETDATA function, but no close bracket. You can delete this open bracket, it is not needed.
Secondly, you create a variable called plot, but don’t set it as the output. Unless you plan to show multiple plots on the script you can reduce the last line display as N / D.
1 2 3 4 5 6 7 8 9 10 |
//The Arms Index (TRIN, MKDS) //The formula: (Advances/Declines) / (Up Volume/Down Volume) //Calculate Numerator N = GETDATA(CODE=ADVSP1500:BM, TIMEFRAME=1 Week) / GETDATA(CODE=DECSP1500:BM, TIMEFRAME=1 Week) ; //Calculate Denominator D = GETDATA(CODE=AVVSP1500:BM, TIMEFRAME=1 Week) / GETDATA(CODE=DVCSP1500:BM, TIMEFRAME=1 Week) ; //Perform The Division N / D |
After making these adjustments the script appears to work as expected.