Kodi Community Forum
Xstocks - up on download page - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Xstocks - up on download page (/showthread.php?tid=8220)

Pages: 1 2 3


- Asteron - 2004-12-14

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 Smile 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


- Asteron - 2004-12-14

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

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.


- caddie - 2004-12-15

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 !!!


- Asteron - 2004-12-15

wow i never thought about someone using that many stocks Smile 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


- caddie - 2004-12-15

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!


- caddie - 2004-12-15

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 Wink


- caddie - 2004-12-15

asteron, what do you use to run and develop python scripts in windows (if you use windows that is Wink

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?


- Asteron - 2004-12-15

my python reference i used was

python 2.3 quick reference

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 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.


- Asteron - 2004-12-17

i added scrolling but it doesnt work because window.getfocus() doesnt seem to work Image

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


- Asteron - 2004-12-21

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


- Asteron - 2004-12-30

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

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


- Asteron - 2005-01-04

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


- caddie - 2005-01-04

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 http://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!!!!!