- Topics: 5
- Replies: 377
- Posts: 382
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.
//The Arms Index (TRIN, MKDS)
//The formula: (Advances/Declines) / (Up Volume/Down Volume)
N = GETDATA(CODE=ADVSP1500:BM, TIMEFRAME=1 Week) / GETDATA(CODE=DECSP1500:BM, TIMEFRAME=1 Week) ;
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.