I am trying to use the Show View tool to display a custom script, calculating the Arms Index for the S&P1500. I cannot get Optuma to recognize this as a valid script. Please let me know what I am doing incorrectly. Many thanks!
//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
plot = N / D ;
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)
//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.