View Full Version : Xstocks - up on download page
hi all, there was a request a month or two ago for a stock browser and i put one up to the download page.
http://dwl.xboxmediacenter.de/index.php?subcat=6&start=1
features
-view a portfolio of stock information at once
-add and remove individual stocks on the fly
-saves portfolio preference between sessions
-view price graphs for a stock over several ranges of time
-looks pretty neat
from a technical standpoint there are some interesting things happening in there and it took me a while to decide the best way to do some of them. there are a lot of labels which can change color between green white and red. since you can't change label colors on the fly this is actually 3 labels of different colors with their visibilities toggled.
also what appears to be a large list control is a growable set of blank buttons each with a group of labels aligned on top. effectively making a pretty nice table with selectable rows.
i also save out preferences to a file. try it out :) i would love comments and suggestions for it, especially for the code since i am a python newb.
props go out to darkie (aqtbrowser), burriko (xbmcmail), and flash (ifilmbrowser, launchbrowser).
-ast
secondly i also would like help from europe / asia users on how to best localize the market data. yahoo finance supports a lot of exchanges http://finance.yahoo.com/exchanges and its not hard at all to change which market data should be used.
also the script is made with pal and widescreen in mind (using scalex and scaley) though im not sure how well it turns out. pal should be about the same i would assume but dont know about widescreen.
kinghowdy0
2004-12-15, 00:56
i've been waiting a long time for something like this and this works great! really good job on this script! i don't know what else to say.
well done!! i had to register to give you some kudos! i love this script!! when i saw it at work today i was dying to get home to hook it up.
a couple of things i noticed:
before i executed the script, i set the max number of symbols to 200. i then added about 70 symbols.
once i ran the script i was floored man! flawless and very fast (i guess so since it's not video or anything)
i do have a bunch of suggestions, and i would liike to help you out any way i can!!
#1:
we gotta get the scroll feature working.... i added too many symbols and they extended beyond the page but i couldn't see them.
i usually spend a good part of my day surfing yahoo!finace and i hope you don''t mind if i throw you some suggestions... hell, you've inspired me to try and figure some of this python stuff out myself.
awsome job, thanks !!!
wow i never thought about someone using that many stocks :) that value in the script is actually the max number of stocks that can be displayed on the screen but am glad it doesnt die when it gets pushed up that high :-)
i thought about scrolling early on but forgot about it once i got some of the other stuff working.... i should of expected people wanting that since it looks like a jazzed up listcontrol... i dont think it will be very hard to add at all though... should be just detecting when i am at the top and bottom and capturing the actions accordingly and reseting at an offset....
however im not sure though if yahoo has its own maximum number of stocks per page... if so i would have to break up the string and load the pages individually and append the results.... actually that wouldnt be very hard to do but may slow things down a bit...
i will also add being able to sort by columns.... i think that might be easy.
maybe way down the road i will allow being able to move things around manually (without having to edit the config file)... its hard to think of a good interface for that though... i guess i would use the xbmc way of using 3 and 6 on the remote...
anyway thx for the suggestion
-ast
yes, the maximum number of quotes you can get at once is 200.
the other thing that would be stellar would be like a real-time mode. this would pole the server in the background and get the latest price and quote [every 45 seconds?]
related info:
us market are only open from 9:30 to 4:00 monday - friday est (only if the script was running during this time would "real-time mode" be available and need to hit yahoo! servers
can you recomend me to some starting books or sites on python? (besides python.org)
thanks again man - this rocks!
i should also note ... while i can;t see my 50th symbol, if i count down to it and click on the chart button it pulls up the chart - for that symbol. so it is there ;)
asteron, what do you use to run and develop python scripts in windows (if you use windows that is ;)
edit: i figured it out - running the python shell and saying "hello world" right now.
:thumbsup:
i can;t pull in xbmc scriipts (like yours) and test them on the pc? how do you run/debug your scripts without putting them to the xbox all the time? - maby i should move my xbox closer to my pc?
my python reference i used was
python 2.3 quick reference (http://rgruet.free.fr/pqr2.3.html)
if you've already have programming experience and want to pick up another language it's pretty good. developing in windows is a good idea i bet but ive just been writing the thing in a text editor and ftping to the box. screwing up crashes the box though so i've been doing incremental updates. i think alex has a windows setup on his site (http://members.cox.net/alexpoet/downloads/) as well as xbmc tutorials (though i just looked at some scripts i had like aqtbrowser and xbmcemail.
thx for the 200 limit info. i use 3 of those for the market data though.
i added scrolling but it doesnt work because window.getfocus() doesnt seem to work http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/cry.gif
i cant seem to think of a good way of working around it without completely reimplementing the navigation code... i will have to think hard about how difficult that is going to be.
in the fullscreen mode i think the graph is too small and might move the buttons to the top to make it bigger.
-ast
well until window.getfocus() gets fixed (enabling me to do nice scrolling), i added pageup and pagedown buttons... you can grab the updated file here.
http://www.filespace.org/asteron/xstocks.py
-asteron
made it use the triggers (action_scroll_up) and action_page_up for scrolling so now supports some 200 stocks in the list... so if you wanted more than 12 stocks get it here.
http://www.filespace.org/asteron/xstocks.py
-ast
ReflexNPG
2005-01-04, 01:48
is there a plan to show all companies of an index - it would make it easier to get an overview of the market...
great script - thanks!
reflex
you mean like http://finance.yahoo.com/q/cp?s=^dji that kind of data? could be kinda neat...
maybe just be able to select the index data already there and click it to take you to another screen showing a stocktable from that data... seems somewhat doable...
maybe a better idea would be to have multiple portfolio's selectable ... do indices change their stocks very often? if not people could just add the index maybe as a new portfolio...
the stuff i plan on adding eventually:
better scrolling (identical to a normal listcontrol)
sorting by any column
maybe:
multiple portfolios (like one for techs.. another for meds)
index browsing
arrange stocks in the list up/down
support for > 200 stocks
compare 2 (+?) stocks against eachother
skinnable background instead of using skin background? (i kinda like it the way it is cause it will look more integrated with all skins)
i'm glad to know that there are people getting use out of this thing :d
this is great !!! i love this script.
if you are going to integrate portfolio's something to keep in mind.
yahoofinance limits you to a maximum of 200 quotes at any one time, or on any one portfolio.
the last think that i would really love would be if you could somehow integrate www.stockcharts.com charts instead of yahoo. (for the charts)
the url format for this would be:
http://stockcharts.com/gallery?msft
even better than the gallary view would be the ability to choose your chart pattern (check stockcharts.com to see what i mean)
keep up the great work man - this is my absolute favorite script!!!!!
great little script. i am using the version that is changed showing tsx on the front page instead of sp500.
i have been away from the xbox "scene" for a few months. i just had other stuff to take care of but now that i am back there is a lot of great new scripts, changes to xbmc,etc.
is there anyway for your script to automatically grab your existing portfolio from my.yahoo.com finance portfolio? i just literally installed it and haven't started entering any portfolio data yet but it is pretty neat from what i have seen so far.
hi to get quotes in other markets, use reuters code instead of ticker symbol. the ric codes are encoded like this:
{nnnn}.{market}
for example, 0005.hk will get you hsbc and 6758.f will give u sony listed at frankfurt.
hi everyone,
i've added complete scrolling behavior (had to emulate pageup/down, moveup/down, scrollup/down commands) and the ability to sort by the different columns.
before i release it officially though i am going to finish the portfolio work. there is framework in the code for portfolios right now but its not in the gui yet. i was wondering though if anyone wanted to volunteer to make some default portfolios of stocks for a few sectors. i made one for tech as
"technology" - msft,ibm,aapl,yhoo,goog,nvda,intc,amd,dell,hpq,sun w,csco,mmm,orcl,qcom
if someone could collect some portfolios in a few more sectors (or add alot more to the tech sector) that would be really helpful. i think sectors like "aviation" "biomed" "retail" etc will be nice... include any stocks you can get from finance.yahoo.com and try to keep it below to 100 or so per sector. just post it here in the above format (if its really long add linebreaks) and i will include it in the defaults for the script. thanks!
threezee - id like to finish this off before asking you to put it on scriptrunner :d
ThreeZee
2005-02-19, 00:03
10-4 good buddy.
i was able to find a decent enough web site and made some rough portfolios for some sectors (i just selected the companies i heard about though). if people tweek this thing out please post lists here though!
here is the grand 1.0 version... it took some 30 hours of work and makes use of 208 controls (grid layout is hardwork).
i really concentrated an heavily on the interface and hope you all like it :-)
http://www.filespace.org/asteron/xstocks.rar
edit: mirror = http://fast.filespace.org/asteron/xstocks.rar
again new in this version is scrolling, sorting and builtin multiple portfolios.
edit: added screenshot http://www.filespace.org/asteron/xstocks.png
http://fast.filespace.org/asteron/xstocks.png
also fixed a small bug.
-ast
tonguefu
2005-02-22, 08:02
hi there, with all of the great work you have done on this script i almost feel like an a$$ for asking this but, is there wa way to modify the script so that it brings up charts with indicators such as macd/stoch/volume and in a candle stick chart format. when you browes the finance.yahoo.com you can drill down in a stock and create better charts, and i notice that as you do that the url changes as it adds things such as macd. was thinking it would be great to have that built in.
cheers
anything to make it better... and there is still a lot of room on the graph screen for stuff. could you provide a url of an image with all that stuff turned on (and label the arguments too if you could)? at least the url of the web page that has the image would be useful as i dont know what a macd (is it a mcdonalds?) or a stoch is or how to turn them on :) i know how to get the volume and the candle though (&a=v and &q=c). i didnt see any option on yahoo for the other two but im sure its there.
honestly i'm more interested in programming and interface stuff than stocks so dont really know all the jargon. ohhh a widget that would look great for these options though would be a simple checkbox widget. making it out of a button should be pretty easy and i should be able to emulate the xbmc checkboxes pretty easily .. and make it in another module too.
earlier caddie mentioned i should use http://stockcharts.com/gallery?msft but i couldnt figure out how to get simple looking charts over a range of times (and interday) like yahoo.
morphman
2005-02-22, 20:01
tonguefu, excellent idea to add chart analysis to charts.
asteron, i must thank you for this script. i check my stocks every couple of hours for ones im trading, and its nice to be able to do that from my armchair, without having to go to bloomberg channel and use their interactive service which sux.
it would be nice to have all the features on the ta chart, but here are the most important ones to me:-
macd indicator
volume
moving average (all period options)
ema (exponential moving average - all period options)
fast stochastic
slow stochastic
fyi indicators are technical indicators about a particular chart and it allows you to make an informed decision abaou tthe future of the stock based on the chart.
a further request to really top this script off would be to add currency exchange rates. most notably
eur - us dollar (with daily change percentage indicator)
gbp - us dollar
us dollar - yen
that way, i know if my us stocks have gone down by 1%, but the us dollar/gbp has gone up by 2%, they have still made a profit :-)
many thanks for your hard work on this script. it has made me very happy.
i will post information about each indicator in a following message
morphman
2005-02-22, 20:28
ok, here is what i think about the generation of the indicator overlays on stock charts.
i am using eds as the stock of choice (my former employer lol)
so here is a quick overview, of what i think of how the url is constructed:-
http://ichart.finance.yahoo.com/z?s=eds....p=&a=fs (http://ichart.finance.yahoo.com/z?s=eds&t=1y&q=l&l=on&z=m&p=&a=fs)
s= - stock ticker eg eds
t= - chart period - values (1 - 1day,5 - 5days,3m - 3months,6m,1y,2y,5y,my - maxyear)
q= line chart - values (l - line, b - bar, c - candlestick)
l= - chart scale - values (on - linear, off - logorithmic)
z= - chart size - values (m - medium, l - large)
p= - adds overlays - values (m5,m10,m20,m50,m100,m200,e5, e10, e20, e50, e100, e200) there can be multiple overlays separated by commas (eg, m20,e20,m200,e200)
p= - can also add other overlays - values (b - bollinger bands, p - parabolic sar, s - splits, v - volume)
a= - adds an analysis chart - values (m26-12-9 - macd, f14 - mfi (14 day period hence number 14), p12 - roc, r14 - rsi (14 dat period hence number 14 - can be customised), ss - slow stochastic, fs - fast stochastic, v - volume, vm - volume and moving average, w14 - w%r (14 day period hence number 14)
c= - compare to another stock (another stock ticker eg ^ixic for nasdaq, or msft for microsoft)
you probably already know most of these, but i put them on to help me understand it as well as others. hope you find the analysis codes and overlay codes useful, and i hope you can find time to include the analysis options into the script :-)
morphman
2005-02-22, 20:30
note on the analysys charts, there can also me multiple analysis charts, and these parameters are also separated by commas
eg:-
a=ff,ss
to add both a fast stochastic and a slow stochastic.
you probably already know most of these, but i put them on to help me understand it as well as others. hope you find the analysis codes and overlay codes useful, and i hope you can find time to include the analysis options into the script :-)
wow nice analysis there. i knew of about half of those options but the other ones i couldnt even figure out how to show on the web site :)
alright so it looks like the chart screen is going to get a major redesign. fortunately that code is the easiest to change since no other screens depend on it. those analysis charts make the chart taller so i'd have to look out for that in the layout which could be tricky. comparing stocks is the other tricky thing as i would need an interface to present a stock list on the graph screen... (maybe should just boot to the main screen?), or i could just cop out and use the keyboard. the rest of the options seem pretty easy.
maybe with all these options i should have a preview window of the chart in a corner and a full screen maximize action for the chart as well? or i could put all the extra controls in a popup osd.... maybe i will get lucky and things will fit. hmm, i have some thinking to do on the interface/layout for this.
also i wonder if there can be a portfolio of currencies... if that makes sence.
-ast
morphman
2005-02-23, 11:31
yes, the currencies have stock tocker codes
pound - us dollar - gbpusd=x (you need the =x part)
euro - dollar - eurusd=x
japanese yen - us dollar - usdjpy=x
there are others you could consider also, if you included them into a portfolio. thats a better idea than a separate currency page.
im not able to get to my xbox till the weekend, so havnt seen the new script in action.
does the portfolio feature allow you to store your starting price, and starting volume information, so you can see how much you have made on each trade? if so, you could add a currency option to see if you have made/lost any money on the currency underlying ont hat trade as well?
does the portfolio feature allow you to store your starting price, and starting volume information, so you can see how much you have made on each trade? if so, you could add a currency option to see if you have made/lost any money on the currency underlying ont hat trade as well?
no the portfolios are only named groups of stocks.
specifying that seems doable eventually...
im making it so that everything can be done in the interface without editting text files though... so id need to think of a nice way to do it and maybe rework the main table too.
asteron - this script is mint !! and definately my favorite
thanks for you dev work on it.... i have pm'd you a stock that you will make money on if you are "in" the stock market.
if you're not - and this one does make money, i'll paypal you some for your work on this,
thanks !
HarshReality
2005-04-05, 22:47
by chance how would one remove the second texture refrence and drop the stock listings x & y quardinates (i am playing with pm 3 and need to shift some of it and as there is so much code i wouldn't want to bugger it up.
http://www.harshreality.org/screens/screenshot001.jpg
eeek that doesnt look too good there.
behind the stockrow's i had an empty button and pm3 is the first skin where that doesnt look alright (i think that is what you mean by the extra texture).
anyway i figured out how to change it to a list behind the row instead of a button and it looks pretty good now in pm3 (also tested in pm2 and pm1).
the header row is actually a bunch of labels in front of a bunch of empty buttons (looks like you moved just the label and not the empty buttons) both are in that buildheaderrow function.
here's the update for pm3
http://www.filespace.org/asteron/xstocks.rar
(i still plan on redoing the graph screen one of these days)..
the overhaul of the graph screen i've been planning on doing for a very long time is finally done! thanks go to morphman for researching what you can do with yahoo finance charts.
http://www.filespace.org.nyud.net:8090/asteron/xstocks2.jpg
checkout the other screens here
http://www.filespace.org.nyud.net:8090/asteron/xstocks1.jpg
http://www.filespace.org.nyud.net:8090/asteron/xstocks2.jpg
http://www.filespace.org.nyud.net:8090/asteron/xstocks3.jpg
http://www.filespace.org.nyud.net:8090/asteron/xstocks4.jpg
alot of small things were made better too. custom backgrounds are possible now (by adding background.png to the folder) and which portfolio you had selected is remembered too now.
the biggest change of course is the advanced options screen. i ended up adding almost every option that morphman found.
the radio-option-groups have enforced minimum and maximum number selected and the compare stocks can be moved between the selected list and the unselected list. there is also a little help label at the bottom that tells you what each option is.
i dont know what bollinger bands are exactly but the sure look neat! :-)
edit now hosted on xbmcscripts.com, requires cvs newer than 06/14.
http://www.xbmcscripts.com/index.p....%20v2.0 (http://www.xbmcscripts.com/index.php?option=com_docman&task=search_result&itemid=array&search_mode=phrase&search_phrase=xstocks%20v2.0)
-ast
where you ever able to support european markents? are you able to see IBEX with this plugin?
where you ever able to support european markents? are you able to see IBEX with this plugin?
I installed it last night, and it's a very nice plugin :)
Unfortunately, no IBEX or eu markets are available.
BladeNight18
2008-11-09, 07:36
Does it support the new Interactive Flash Streaming charts from Yahoo?
does anyone experience problems with this script? I can't get scrape data from the yahoo finance site, although my stock ticker in my gnome-panel still works wich also scrapes from yahoo finance...
I'm using the atlantis build on an xbox with the lateste xstocks script (wich worked fine till 2 weeks ago)/
Is there any solution for those in the UK to see there stocks on this or a alternative? Would really like to wake up and swithc on TV and browse my stocks?