Stocks widget will not let me add new stock I'm trying to add new stocks to my stock widget but it won't let me do so. It validates the symbol and then does nothing. I have to remove a current stock and then only will it let me add a new one.

Is there a max number of stocks I can watch on the list? I only have 20ish stocks right now.

I tried to add/remove the widget and that did not work.
You can find the default Dashboard widgets in /Library/Widgets. They are written using JavaScript, so it's pretty easy to access the code. For example if you right-click on the Stocks widget and choose "Show Package Contents" you will find a file called "Stocks.js" inside the bundle that contains the logic behind the widget.

On line 1319 of that file there is a function called "addOrSelectItem".

Aside from defining variables, the first thing that function does is check to see whether you are trying to add an existing stock (line 1321), if you are then it just selects the existing stock in the UI. However if you are adding a new stock the next thing it does is check if there are less than 20 stocks (line 1323), if there are less than 20 then it adds the new one. If there are already 20 stocks then it does nothing.

Simplified code below. The comments are Apple's comments. Clearly having more than 20 stocks is not "correct". :)

function addOrSelectItem () {
    var index = symbolAlreadyInSet(lastValidEntry.symbol);
    if (index &lt; 0) {
        // make sure we have the correct number of items
        if (allTheData.length &lt; 20) {
            ...
        }
    } else {
        // select the item that is already there.
        ...
    }
}


In theory someone could make a copy of that Stocks.wdgt file, open it up, change that single line in a text editor to allow more than 20 stocks and save it. Obviously distributing that modified version would be a bad thing, but modifying a copy for your own personal use shouldn't be a problem.

If you do create your own version you might need to kill the Dashboard process for it to notice the changes. Just select it in Activity Monitor and Quit it, it'll automatically relaunch.