外软的最后一个特点就是可以在固定精度的画面内淋漓尽致地放大与缩多k线图(用鼠标滚轮实现zoom in/zoom out),用以展现波动与趋势的全貌,图形的精度很高赏心悦目,这点在国内飞狐与其他类似软件上几乎做不到,我在飞狐上总感觉放大缩小全图后很别扭。 发言完毕
我是金字塔的老用户了,也来说几句。 amibroker 从yahoo下载世界各国股票延时数据的功能非常实用,实现起来也不复杂,amibroker网站上都有相应的代码,建议增加。 例如,国内钢铁股的走势与力拓、必拓有一定的相关性,如果可以从yahoo或者google 下载世界各国股票延时数据,就很方便了。不仅可以下载行情数据,还可以下载基本的财务数据。 相比之下,TWS提供的历史数据太少。这也是为什么外软基本上有这个功能的原因。
yahoo下载数据这个功能很容易实现啊,我略懂编程,发现网络上都有现成的代码,可以直接加进去。目前国内几乎还没有软件实现了这个功能,这是一个很好的卖点啊! script to download Yahoo Finance data wes weston wweston at att.net Wed Jun 30 19:36:31 CEST 2004 • Previous message: script to download Yahoo Finance data • Next message: script to download Yahoo Finance data • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] dan roberts wrote: > Folks, > > This is my first Python project so please bear with me. I need to > download data from Yahoo Finance in CSV format. The symbols are > provided in a text file, and the project details are included below. > Does anyone have some sample code that I could adapt? > > Many thanks in advance, > dan > > /*---NEED TO DO------*/ > Considering IBM as an example, the steps are as follows. > > A. Part 1 - download 'Historical Prices' from > http://finance.yahoo.com/q?s=ibm > 1. Get the Start Date from the form at the top of this page, > http://finance.yahoo.com/q/hp?s=IBM > (I can provide the end date.) > 2. Click on Get Prices > 3. Then finally click on Download to Spreadsheet and save the file > with a name like IBM_StartDate_EndDate.csv. > (2) and (3) are equivalent to using this link directly, > http://ichart.yahoo.com/table.csv?s=IBM&a=00&b=2&c=1962&d=05&e=30&f=2004&g=d&ignore=.csv > Can you please post an example of a loop that would do the above for a > series of company symbols, saved in a text file? > > B. Part 2 - download 'Options' from http://finance.yahoo.com/q?s=ibm > This seems more difficult because the data is in html format (there's > no option to download CSV files). What's the easiest/best way to take > care of this? Dan, Note the parser funtion is not used here but, might come in handy. wes #-------------------------------------------------------------------------- import tkSimpleDialog import tkFileDialog import sys #-------------------------------------------------------------------------- def GetHistoricalDailyDataForOneSymbol( symbol, day1, day2): """ Download the yahoo historical data as a comma separated file. """ #day1 = "2001-01-01" # 0123456789 y1 = day1[:4] m1 = day1[5:7] d1 = day1[8:] y2 = day2[:4] m2 = day2[5:7] d2 = day2[8:] url_str = "http://chart.yahoo.com/table.csv?s=" + symbol + \ "&a=" + m1 + "&b=" + d1 + "&c=" + y1 + \ "&d=" + m2 + "&e=" + d2 + "&f=" + y2 + \ "&g=d&q=q&y=0" + "&z=" + symbol.lower() + "&x=.csv" f = urllib.urlopen(url_str) lines = f.readlines() f.close() return lines #-------------------------------------------------------------------- def GetStockHistFile(symbol,earlyDate,lateDate,fn): list = GetHistoricalDailyDataForOneSymbol( symbol, earlyDate, lateDate) if (not list) or (len(list) < 1): return 0 fp = open( fn,"w" ) for line in list[1:]: fp.write( line ) fp.close() return len(list) #-------------------------------------------------------------------- def ParseDailyDataLine(line): """ 25-Jan-99,80.8438,81.6562,79.5625,80.9375,25769100 22-Jan-99,77.8125,80.1172,77.625,78.125,20540000 21-Jan-99,80.875,81.6562,78.875,79.1562,20019300 20-Jan-99,83.4688,83.875,81.2422,81.3125,31370300 19-Jan-99,75.6875,79.1875,75.4375,77.8125,25685400 """ if line[0] == '<': return None list = string.split(line,",") pos = 0; for str in list: #skip header #print "str=",str,"pos=",pos if pos == 0: #"9-Jan-01" try: list1 = string.split( str, "-" ) day = int(list1[0]) month = list1[1] month = int(MonthStringToMonthInt( month )) year = int( list1[2] ) if year < 70: # oh well, it will work for 70 years or until yahoo changes year += 2000 # year is 101 here for a string input of 01 else: year += 1900 date = "%d-%02d-%02d" % (year, month, day) #mx.DateTime.DateTime( year, month, day ) #println( "date=" + Date.toString() ); // this "2001-01-05" except: print "error in ParseDailyDataLine" print "line=["+str+"]" elif pos == 1: Open = WES.MATH.MyMath.Round(float( str ),4) elif pos == 2: High = WES.MATH.MyMath.Round(float( str ),4) elif pos == 3: Low = WES.MATH.MyMath.Round(float( str ),4) elif pos == 4: Close = WES.MATH.MyMath.Round(float( str ),4) elif pos == 5: Volume = long ( str ) elif pos == 6: AdjClose = WES.MATH.MyMath.Round(float( str ),4) else: print "ret none 1" return None pos += 1 if pos == 7: return (date,Open,High,Low,Close,Volume) else: print "ret none 2" return None #-------------------------------------------------------------------- if __name__ == '__main__': str = tkSimpleDialog.askstring("","enter <symbol> <early date> <late date>") if not str: sys.exit(1) #return list = str.split() symbol = list[0] earlyDate = list[1] lateDate = list[2] fn = tkFileDialog.asksaveasfilename() if not fn: sys.exit(1) #return if GetStockHistFile(symbol,earlyDate,lateDate,fn): tkMessageBox.showinfo("Added",symbol ) else: tkMessageBox.showinfo("Error Adding",symbol ) Pasted from <http://mail.python.org/pipermail/python-list/2004-June/268781.html>
我是联合证券的策略分析师,我一直急需一个功能,大智慧据说搞出来了,就是在副图坐标增加对数坐标功能,期盼解决。 另外画线功能有重大缺陷:在长历史周期图表中,几乎完全只能使用对数坐标,但金字塔的回归通道等重要画线工具在对数坐标中完全变形,失去了使用价值,这一点比不过飞狐,需要改进。 还有,如果金字塔能识别上升平台结构,那就太好了。 但金字塔也实现了我多年的希望,即数据周期跨越1970年,这是国内股软的重大突破,如果在函数上完全兼容飞狐,她几乎是完美的,对投资人士而言,价格是次要的,我诚心期待着