August 20, 2021 at 6:17 am #65631
I have a watchlist. I have 2 scripts. Both return numerical values properly in my watchlist columns.
The first is ASC_IntermediateTermRS
The second is ASC_LongTermRS1234567//Define the variablesV1 = ROC(BARS=30);V2 =ROC(BARS=40);V3 =ROC(BARS=65);//Sum the variables V1 + V2 + v3;1234567//Define the variablesV1 = ROC(BARS=130);V2 =ROC(BARS=195);V3 =ROC(BARS=260);//Sum the variables V1 + V2 + v3;
I now want to add the values returned by both scripts. In the watchlist my results are all 0%. I know the names of the scripts are correct since I did not type them by hand but chose them from the script function properties. Please help me to see my scripting mistake. Thank you.1234567//Define the variablesV1 = SCRIPT(SCRIPTNAME=ASC_IntermediateTermRS);V2 = SCRIPT(SCRIPTNAME=ASC_LongTermRS);//Sum the variables V1 + V2;
August 20, 2021 at 8:38 am #65638Matthew
- This topic was modified 4 weeks ago by Louis Spector.
- Topics: 5
- Replies: 421
- Posts: 426
I am not sure if it’s just a formatting issue with the post, but all 3 of the scripts you posted look to be missing the last line, where the actual addition takes place.
The last script, which combines the two should look like this:1234567//Set VariablesV1 = SCRIPT(SCRIPTNAME=ASC_IntermediateTermRS) ;V2 = SCRIPT(SCRIPTNAME=ASC_LongTermRS) ;//Sum TotalV1 + V2
The only difference I can see is that you’ve added a ; at the end of the last line, which is not required.
Testing the setup here I can see the results are being returned as expected on a Chart and on a Watchlist.August 20, 2021 at 9:05 am #65641
Sorry about the script formatting error above. I just needed to hit enter to show V1 + V2 + V3 on the next line which you figured out.
My script matches yours, but I still can’t get it to work. I tried a new watchlist, a new workbook, and also retyping the scripts. Perhaps the two screenshots attached will help you help me. It works as you have pictured in a Show View tool, but not on the watchlist? Thank you.
August 20, 2021 at 9:28 am #65655
- This reply was modified 4 weeks ago by Louis Spector.
- You must be logged in to reply to this topic.