Saturday, 5 September 2009

iPredict My Portfolio customization

Following on from something I thought of yesterday and posted on the iPredict forums, I decided to have a go at customizing iPredict's My Portfolio page. I wanted to make it easier to see the information I'm interested in when placing limit orders to trade on stock movements.

To do this I've written a Greasemonkey script, which uses javascript to read some values from the tables on the page, and adds extra columns correlating the current stock holdings with the active orders and watchlist.

It works purely on the information already on the HTML page and visible in the page source - it doesn't make any requests to the server, so I think it should fall within iPredict's terms and conditions.

To get it, download the current ipredict-portfolio.js from my repository on github here.

To use it, see the comments at the top of the file. Basically:
  • Use Firefox (tested on 3.0.13, will probably work on 3.5 if Greasemonkey does)
  • Install the Greasemonkey firefox addon
  • Install ipredict-portfolio.js as a userscript in Greasemonkey, for URLs matching the pattern https://www.ipredict.co.nz/Main.php?do=portfolio* (the iPredict My Portfolio page).
  • The script will apply its changes whenever you view that page in iPredict.

This will probably break whenever iPredict change their site layout; I may provide an updated version at the above page if I am still using it myself.

No comments:

Post a Comment