In [1]:
# 啟動互動式繪圖環境
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [6]:
import numpy as np
import pandas as pd
from numpy import random
import matplotlib.pyplot as plt
result = pd.read_csv('/Users/wy/Desktop/3008.txt')

In [7]:
result.head()


Out[7]:
Date Open High Low Close Volume Adj Close
0 2014-12-30 2420 2430 2375 2375 773916 2375.00
1 2014-12-29 2330 2410 2315 2395 1221254 2395.00
2 2014-12-27 2320 2325 2310 2310 147891 2310.00
3 2014-12-26 2285 2315 2275 2315 354324 2310.00
4 2014-12-25 2285 2290 2270 2275 251135 2275.00

In [7]:
result.to_csv('/Users/wy/Desktop/3008.csv')

In [7]:
result[result['Open'] ==1]


Out[7]:
Date Open High Low Close Volume Adj Close
488 2013-05-29 1 0 1 0 1026863 ��

In [9]:
import numpy as np
import pandas as pd
from numpy import random
import matplotlib.pyplot as plt
with open ('/Users/wy/Desktop/3008.txt','r') as f:
    line = f.readlines()
line[0].rstrip()
ll=[]
for a in line[1:]:
    l =[]
    a = a.rstrip()
    a = a.split(',')
    l.append(a[0])
    for a in a[1:]:
        try:
            l.append(float(a))
        except:
            l.append(0)
    ll.append(l)
rowname = ['Date','Open','High','Low','Close','Volume','Adj Close']
stock_df = pd.DataFrame(ll, columns=rowname)

In [10]:
stock_df.head(584)


Out[10]:
Date Open High Low Close Volume Adj Close
0 2014-12-30 2420 2430 2375 2375 773916 2375
1 2014-12-29 2330 2410 2315 2395 1221254 2395
2 2014-12-27 2320 2325 2310 2310 147891 2310
3 2014-12-26 2285 2315 2275 2315 354324 2310
4 2014-12-25 2285 2290 2270 2275 251135 2275
5 2014-12-24 2290 2295 2265 2275 621019 2275
6 2014-12-23 2330 2340 2280 2280 778228 2280
7 2014-12-22 2320 2330 2285 2325 467374 2325
8 2014-12-19 2320 2355 2270 2300 1486534 2295
9 2014-12-18 2300 2315 2265 2265 1163488 2265
10 2014-12-17 2255 2300 2230 2250 1235644 2250
11 2014-12-16 2320 2335 2250 2250 1004245 2250
12 2014-12-15 2310 2340 2300 2335 845344 2335
13 2014-12-12 2315 2345 2310 2325 1029619 2320
14 2014-12-11 2235 2310 2220 2300 1289930 2295
15 2014-12-10 2290 2320 2250 2255 825096 2255
16 2014-12-09 2265 2300 2235 2290 1137524 2290
17 2014-12-08 2375 2395 2275 2285 1389389 2285
18 2014-12-05 2400 2430 2340 2370 1059384 2360
19 2014-12-04 2405 2440 2395 2400 831362 2400
20 2014-12-03 2410 2440 2375 2380 1422947 2380
21 2014-12-02 2445 2445 2365 2375 1278528 2375
22 2014-12-01 2320 2465 2320 2465 1362046 2460
23 2014-11-28 2395 2410 2375 2385 743512 2385
24 2014-11-27 2440 2475 2370 2375 1411415 2375
25 2014-11-26 2385 2440 2365 2425 1772042 2420
26 2014-11-25 2320 2385 2295 2385 1086333 2380
27 2014-11-24 2355 2385 2305 2305 1030740 2305
28 2014-11-21 2360 2365 2295 2335 1342325 2335
29 2014-11-20 2215 2340 2215 2340 2483543 2335
... ... ... ... ... ... ... ...
554 2012-10-04 612 614 601 610 1044653 610
555 2012-10-03 611 615 608 612 1036121 611
556 2012-10-02 596 615 595 610 1899785 610
557 2012-10-01 600 604 580 593 2104028 592
558 2012-09-28 607 618 605 607 1366741 607
559 2012-09-27 590 608 590 607 1970750 607
560 2012-09-26 618 625 596 596 3299177 596
561 2012-09-25 654 654 632 636 1521975 636
562 2012-09-24 655 657 650 652 622410 652
563 2012-09-21 656 666 652 653 1215673 653
564 2012-09-20 656 658 653 654 596773 654
565 2012-09-19 659 664 656 656 1031782 655
566 2012-09-18 656 661 651 659 911281 658
567 2012-09-17 657 669 655 660 2214480 659
568 2012-09-14 664 666 650 652 3269666 652
569 2012-09-13 655 656 643 645 1343301 644
570 2012-09-12 647 659 645 651 1816815 651
571 2012-09-11 655 655 641 642 960640 642
572 2012-09-10 651 654 647 654 957356 652
573 2012-09-07 657 659 643 643 1540887 643
574 2012-09-06 650 659 642 642 2916863 642
575 2012-09-05 636 639 630 639 960852 638
576 2012-09-04 643 645 629 635 1688727 634
577 2012-09-03 624 644 618 643 1818053 643
578 2012-08-31 612 623 611 623 919990 622
579 2012-08-30 619 622 616 620 792807 620
580 2012-08-29 619 624 613 623 884487 622
581 2012-08-28 633 639 618 619 1915929 619
582 2012-08-27 624 646 622 637 3428535 637
583 2012-08-24 609 620 607 616 876842 615

584 rows × 7 columns


In [11]:
stock_df.Open.describe()


Out[11]:
count     600.000000
mean     1317.821667
std       638.619097
min       587.000000
25%       787.500000
50%      1030.000000
75%      1995.000000
max      2630.000000
dtype: float64

In [25]:
fig = plt.figure()
ax = fig.add_subplot(1, 1,1)
ax.plot(stock_df['Open'])
ax.plot(stock_df['High'])
ax.plot(stock_df['Low'])
ax.plot(stock_df['Close'])
ax.plot(stock_df['Adj Close'])


Out[25]:
[<matplotlib.lines.Line2D at 0x10886af90>]

fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(stock_df['Volume'])


In [26]:
stock_df[stock_df['Volume'] > 5*10**7]


Out[26]:
Date Open High Low Close Volume Adj Close
68 2014-02-05 56.4 56.4 55.6 55.8 57559609 55.75

In [3]:
%reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y

In [401]:
result['Date'].size


Out[401]:
30

In [561]:
# Rise Ratio 漲幅比
def RR(data):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止 第一筆data沒有更舊的
        if item-1 >=0:
            # (今日收盤價 - 昨日收盤價)/昨日收盤價
            tmp = (data['Close'][item-1]-data['Close'][item])/data['Close'][item]*100
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  RR 欄位
    data['RR']=tmpSeries

In [439]:
# 威廉指標(WMS%R或%R)
def WMS(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day+1 >= 0:
            # 9日WMS%R =(9日內最高價-第9日收盤價) / (9日內最高價-9日內最低價)*100
            # [item-day+1:item+1] 今日區間 [item-day+1] 第N日 583-9=574+1=575
            tmp = (data['High'][item-day+1:item+1].max()-data['Close'][item-day+1])/(data['High'][item-day+1:item+1].max()-data['Low'][item-day+1:item+1].min())*100
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  WMS 欄位
    data['WMS']=tmpSeries

In [345]:
# 買賣意願指標 day 建議26
def BR(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day >= 0:
            # 26日BR = (今日最高價 - 昨日收盤價)26天累計總數 / (昨日收盤價 - 今日最低價)26天累計總數
            # [(item-day+1)-1:(item+1)-1] 有-1 今日區間 [(item-day+1):(item+1)] 昨日區間
            tmp = (data['High'][(item-day+1)-1:(item+1)-1].sum()-data['Close'][item-day+1:item+1].sum())/(data['Close'][item-day+1:item+1].sum()-data['Low'][(item-day+1)-1:(item+1)-1].sum())
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  BR 欄位
    data['BR']=tmpSeries

In [446]:
# 買賣氣勢指標 day建議26
def AR(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day+1 >= 0:
            # 26日AR = (最高價 - 開盤價)26天累計總數 / (開盤價 - 最低價)26天累計總數
            # [item-day+1:item+1] 今日區間
            tmp = (data['High'][item-day+1:item+1].sum()-data['Open'][item-day+1:item+1].sum())/(data['Open'][item-day+1:item+1].sum()-data['Low'][item-day+1:item+1].sum())
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  AR 欄位
    data['AR']=tmpSeries

In [454]:
# 平均成交量 mean volumn day建議12
def MV(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day+1 >= 0:
            # N日平均量 = N日內的成交量總和 / N
            # [item-day+1:item+1] 今日區間
            tmp = data['Volume'][item-day+1:item+1].mean()
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  MV 欄位
    data['MV']=tmpSeries

In [8]:
# 移動平均線(MA,Moving Average) 建議12
def MA(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day+1 >= 0:
            # 移動平均數 = 採樣天數的股價合計 / 採樣天數
            # [item-day+1:item+1] 今日區間
            tmp = data['Close'][item-day+1:item+1].mean()
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  MA 欄位
    data['MA'+str(day)]=tmpSeries

In [475]:
# 心理線(PSY) 建議13
def PSY(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day >= 0:
            # 13日PSY值 = ( 13日內之上漲天數 / 13 ) * 100
            # [item-day+1-1:item+1-1] 跳一天 最早的天沒有RR值
            count = 0
            for a in data['RR'][item-day+1-1:item+1-1]:
                if a > 0:
                    count+=1
            tmp = float(count)/float(13)*100
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  PSY 欄位
    data['PSY']=tmpSeries

In [519]:
# 能量潮(OBV) 建議12
def OBV(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day >= 0:
            # 今日OBV值 = 最近12天股價上漲日成交量總和 - 最近12天股價下跌日成交量總和
            # 先由 ['RR'] 求出boolean值 > 0 True 套入['Volume']符合True全加起來
            bolRise = data['RR'][item-day+1-1:item+1-1]>0
            sumVolRise = data['Volume'][item-day+1-1:item+1-1][bolRise].sum() 
            bolDesc = data['RR'][item-day+1-1:item+1-1]<0
            sumVolDesc = data['Volume'][item-day+1-1:item+1-1][bolDesc].sum()   
            
            tmp = sumVolRise-sumVolDesc
#             可切換 OBV累積12日移動平均值 = (最近12天股價上漲日成交量總和 - 最近12天股價下跌日成交量總和) / 12
#             tmp = (sumVolRise-sumVolDesc)/12
            tmpList.append(tmp)
            
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  OBV 欄位
    data['OBV']=tmpSeries

In [545]:
# 數量指標(VR) 建議12
def VR(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day >= 0:
            # VR = ( N日內上漲日成交值總和 + 1/2*N日內平盤日成交值總和) / ( N日內下跌日成交值總和 + 1/2*N日內平盤日成交值總和)* 100%
            # 先由 ['RR'] 求出boolean值 > 0 True 套入['Volume']符合True全加起來
            bolRise = data['RR'][item-day+1-1:item+1-1]>0
            sumVolRise = data['Volume'][item-day+1-1:item+1-1][bolRise].sum()
            
            bolNorm = data['RR'][item-day+1-1:item+1-1] == 0
            sumVolNorm = data['Volume'][item-day+1-1:item+1-1][bolNorm].sum()
            
            bolDesc = data['RR'][item-day+1-1:item+1-1]<0
            sumVolDesc = data['Volume'][item-day+1-1:item+1-1][bolDesc].sum()   
            
            tmp = (sumVolRise+0.5*sumVolNorm)/(sumVolDesc+0.5*sumVolNorm)*100
            tmpList.append(tmp)
            
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  VR 欄位
    data['VR']=tmpSeries

In [569]:
# 相對強弱指標(RSI) 建議6
def RSI(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day >= 0:
            # 6日RSI=100*6日內收盤上漲總幅度平均值 / (6日內收盤上漲總幅度平均值 - 6日內收盤下跌總幅度平均值)
            # 先由 ['RR'] 求出boolean值 > 0 True 套入['Volume']符合True全加起來
            bolRise = data['RR'][item-day+1-1:item+1-1]>0
            meanRise = data['RR'][item-day+1-1:item+1-1][bolRise].mean() 
            bolDesc = data['RR'][item-day+1-1:item+1-1]<0
            meanDesc = data['RR'][item-day+1-1:item+1-1][bolDesc].mean()   
            
            tmp = 100*meanRise/(meanRise-meanDesc)
            tmpList.append(tmp)
            
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  RSI 欄位
    data['RSI']=tmpSeries

In [583]:
# 乖離率(BIAS)
def BIAS(data,day):
    # 由於 data 新到舊 0~xxx,遞增,因此需反轉陣列
    dataList = range(data['Date'].size)
    dataList.reverse()
    tmpList = []
    
    for item in dataList:
        # 防止前day沒有data
        if item-day+1 >= 0:
            # N日乖離率 = (當日股價 - N日股價移動平均數) / N日平均股價
            tmp = (data['Close'][item-day+1]-data['MA'][item-day+1])/data['MA'][item-day+1]*100
            tmpList.append(tmp)
        
    # 前day 沒data會出現NA
    tmpList.reverse()
    tmpSeries = pd.Series(tmpList)
    
    # create  BIAS 欄位
    data['BIAS']=tmpSeries

In [584]:
BIAS(result,12)

In [573]:
MA(result,12)

In [570]:
RSI(result,6)

In [580]:
item = 583
data = result
day = 12

tmp = (data['Close'][item-day+1]-data['MA'][item-day+1])/data['MA'][item-day+1]*100
print(tmp)


1.04052573932

In [585]:
result.tail(15)


Out[585]:
Date Open High Low Close Volume Adj Close RR RSI MA BIAS
569 2012-08-22 613 615 604 614 1058895 612.00 -0.162602 75.207211 609.416667 0.752085
570 2012-08-21 615 620 615 615 843149 615.00 0.000000 62.140943 607.583333 1.220683
571 2012-08-20 615 622 612 615 755974 614.00 0.000000 65.052146 608.000000 1.151316
572 2012-08-17 616 622 612 615 1496355 615.00 -0.324149 58.150206 608.666667 1.040526
573 2012-08-16 614 617 609 617 959943 616.00 1.480263 54.432362 NaN NaN
574 2012-08-15 620 620 607 608 1009738 608.00 -0.977199 47.589506 NaN NaN
575 2012-08-14 615 627 613 614 1836014 614.00 0.655738 43.245720 NaN NaN
576 2012-08-13 607 611 601 610 1154043 607.00 1.497504 27.167099 NaN NaN
577 2012-08-10 599 610 599 601 2248933 601.00 -1.313629 31.120882 NaN NaN
578 2012-08-09 589 615 588 609 3925370 609.00 1.839465 NaN NaN NaN
579 2012-08-08 592 602 592 598 1619278 597.00 0.167504 NaN NaN NaN
580 2012-08-07 593 602 593 597 820020 596.00 0.844595 NaN NaN NaN
581 2012-08-06 628 628 590 592 1584721 592.00 -4.516129 NaN NaN NaN
582 2012-08-03 627 627 608 620 2260176 619.00 -0.481541 NaN NaN NaN
583 2012-08-01 614 630 611 623 2429469 622.00 NaN NaN NaN NaN

In [435]:
data = result
item = 583
day=9
print(data['High'][item-day+1:item+1])
print(data['Close'][item-day+1])
print(data['Low'][item-day+1:item+1])
s = (data['High'][item-day+1:item+1].max()-data['Close'][item-day+1])/(data['High'][item-day+1:item+1].max()-data['Low'][item-day+1:item+1].min())*100
print(s)


575    627
576    611
577    610
578    615
579    602
580    602
581    628
582    627
583    630
Name: High, dtype: float64
614.0
575    613
576    601
577    599
578    588
579    592
580    593
581    590
582    608
583    611
Name: Low, dtype: float64
38.0952380952

In [422]:



Out[422]:
20.0

In [441]:
result.tail(10)


Out[441]:
Date Open High Low Close Volume Adj Close RR WMS
574 2012-08-15 620 620 607 608 1009738 608.00 -0.977199 50.000000
575 2012-08-14 615 627 613 614 1836014 614.00 0.655738 38.095238
576 2012-08-13 607 611 601 610 1154043 607.00 1.497504 NaN
577 2012-08-10 599 610 599 601 2248933 601.00 -1.313629 NaN
578 2012-08-09 589 615 588 609 3925370 609.00 1.839465 NaN
579 2012-08-08 592 602 592 598 1619278 597.00 0.167504 NaN
580 2012-08-07 593 602 593 597 820020 596.00 0.844595 NaN
581 2012-08-06 628 628 590 592 1584721 592.00 -4.516129 NaN
582 2012-08-03 627 627 608 620 2260176 619.00 -0.481541 NaN
583 2012-08-01 614 630 611 623 2429469 622.00 NaN NaN

In [ ]:


In [ ]:


In [379]:
item = 583
day = 9
data = result
# (data['High'][item-day+1:item+1].max()-data['Close'][item])/(data['High'][item-day+1:item+1].max()-data['Low'][item-day+1:item+1].min())*100
data['High'][0:9]


Out[379]:
0    2300
1    2395
2    2430
3    2440
4    2440
5    2445
6    2465
7    2410
8    2475
Name: High, dtype: float64

In [392]:
result.tail(15)


Out[392]:
Date Open High Low Close Volume Adj Close WMS
569 2012-08-22 613 615 604 614 1058895 612.00 92.857143
570 2012-08-21 615 620 615 615 843149 615.00 46.153846
571 2012-08-20 615 622 612 615 755974 614.00 74.358974
572 2012-08-17 616 622 612 615 1496355 615.00 76.923077
573 2012-08-16 614 617 609 617 959943 616.00 90.000000
574 2012-08-15 620 620 607 608 1009738 608.00 20.000000
575 2012-08-14 615 627 613 614 1836014 614.00 NaN
576 2012-08-13 607 611 601 610 1154043 607.00 NaN
577 2012-08-10 599 610 599 601 2248933 601.00 NaN
578 2012-08-09 589 615 588 609 3925370 609.00 NaN
579 2012-08-08 592 602 592 598 1619278 597.00 NaN
580 2012-08-07 593 602 593 597 820020 596.00 NaN
581 2012-08-06 628 628 590 592 1584721 592.00 NaN
582 2012-08-03 627 627 608 620 2260176 619.00 NaN
583 2012-08-01 614 630 611 623 2429469 622.00 NaN

In [104]:


In [99]:
# 平均成交量 mean volumn day建議12
def MV(data,day):
    l=[]
    
    for a in range(0,data['Volume'].size-day+1):
        # N日平均量 = N日內的成交量總和 / N
        b = data['Volume'][0+a:day+a].mean()
        l.append(b)
        
    # 前day補上0
    for a in range(day-1):
        l.insert(a,0)
    sl = pd.Series(l)
    
    # create  MV 欄位
    data['MV']=sl

In [86]:
# 移動平均線(MA,Moving Average) day建議短期6 中期24,72
def MA(data,day):
    l=[]
    
    for a in range(0,data['Volume'].size-day+1):
        # 移動平均數 = 採樣天數的股價合計 / 採樣天數
        b = data['Volume'][0+a:day+a].mean()
        l.append(b)
        
    # 前day補上0
    for a in range(day-1):
        l.insert(a,0)
    sl = pd.Series(l)
    
    # create  MA 欄位
    data['MA']=sl

In [94]:
MA(result,12)

In [100]:
VM(result,6)

In [105]:
AR(result,26)

In [108]:
BR(result,26)

In [115]:
WMS(result,9)

In [128]:
RR(result)

In [129]:
result


Out[129]:
Date Open High Low Close Volume Adj Close AR BR WMS RR
0 2014-12-09 2265 2300 2235 2290 1137524 2290.00 0.000000 0.000000 0.000000 0.000000
1 2014-12-08 2375 2395 2275 2285 1389389 2285.00 0.000000 0.000000 0.000000 -0.218341
2 2014-12-05 2400 2430 2340 2370 1059384 2360.00 0.000000 0.000000 0.000000 3.719912
3 2014-12-04 2405 2440 2395 2400 831362 2400.00 0.000000 0.000000 0.000000 1.265823
4 2014-12-03 2410 2440 2375 2380 1422947 2380.00 0.000000 0.000000 0.000000 -0.833333
5 2014-12-02 2445 2445 2365 2375 1278528 2375.00 0.000000 0.000000 0.000000 -0.210084
6 2014-12-01 2320 2465 2320 2465 1362046 2460.00 0.000000 0.000000 0.000000 3.789474
7 2014-11-28 2395 2410 2375 2385 743512 2385.00 0.000000 0.000000 0.000000 -3.245436
8 2014-11-27 2440 2475 2370 2375 1411415 2375.00 0.000000 0.000000 20.000000 -0.419287
9 2014-11-26 2385 2440 2365 2425 1772042 2420.00 0.000000 0.000000 112.500000 2.105263
10 2014-11-25 2320 2385 2295 2385 1086333 2380.00 0.000000 0.000000 172.222222 -1.649485
11 2014-11-24 2355 2385 2305 2305 1030740 2305.00 0.000000 0.000000 133.333333 -3.354298
12 2014-11-21 2360 2365 2295 2335 1342325 2335.00 0.000000 0.000000 104.545455 1.301518
13 2014-11-20 2215 2340 2215 2340 2483543 2335.00 0.000000 0.000000 192.592593 0.214133
14 2014-11-19 2150 2220 2125 2190 1731021 2190.00 0.000000 0.000000 127.450980 -6.410256
15 2014-11-18 2130 2140 2110 2130 564529 2130.00 0.000000 0.000000 102.985075 -2.739726
16 2014-11-17 2160 2160 2105 2115 605875 2115.00 0.000000 0.000000 94.029851 -0.704225
17 2014-11-14 2145 2160 2110 2125 978747 2125.00 0.000000 0.000000 98.333333 0.472813
18 2014-11-13 2085 2145 2085 2120 1539336 2120.00 0.000000 0.000000 122.448980 -0.235294
19 2014-11-12 2115 2130 2035 2080 1465876 2075.00 0.000000 0.000000 105.882353 -1.886792
20 2014-11-11 2140 2170 2100 2120 1188368 2120.00 0.000000 0.000000 95.744681 1.923077
21 2014-11-10 2155 2220 2110 2115 1507000 2115.00 0.000000 0.000000 88.095238 -0.235849
22 2014-11-07 2015 2150 2015 2145 1652281 2140.00 0.000000 0.000000 227.777778 1.418440
23 2014-11-06 2125 2140 2005 2010 1808961 2010.00 0.000000 0.000000 105.555556 -6.293706
24 2014-11-05 2190 2190 2080 2085 1157284 2080.00 0.000000 0.000000 33.333333 3.731343
25 2014-11-04 2210 2230 2160 2160 1535266 2160.00 0.925764 0.000000 20.000000 3.597122
26 2014-11-03 2155 2230 2140 2210 1285140 2195.00 0.973451 -1.038439 75.000000 2.314815
27 2014-10-31 2115 2145 2115 2135 847823 2135.00 1.077670 0.991189 115.000000 -3.393665
28 2014-10-30 2120 2125 2085 2095 939806 2095.00 1.079602 0.863248 104.761905 -1.873536
29 2014-10-29 2100 2160 2085 2120 1683913 2115.00 1.099010 0.753036 123.809524 1.193317
... ... ... ... ... ... ... ... ... ... ... ...
554 2013-02-21 828 836 806 809 2115457 808.00 0.770370 2.450704 25.806452 0.247831
555 2013-02-20 840 845 828 828 1559194 828.00 0.759124 2.960000 12.500000 2.348578
556 2013-02-19 810 836 808 835 2406639 832.00 0.793358 2.750000 87.500000 0.845411
557 2013-02-18 815 817 803 804 1356116 804.00 0.674912 2.267974 75.000000 -3.712575
558 2013-02-06 809 817 805 805 2441678 805.00 0.713768 3.050000 90.000000 0.124378
559 2013-02-05 791 820 785 814 2869475 814.00 0.787004 3.379310 186.206897 1.118012
560 2013-02-04 801 804 791 796 2011288 796.00 0.756184 2.577465 107.317073 -2.211302
561 2013-02-01 773 800 760 797 4527027 796.00 0.798635 2.000000 160.000000 0.125628
562 2013-01-31 785 793 768 773 2221735 773.00 0.831615 1.773869 115.384615 -3.011292
563 2013-01-30 800 805 782 782 2697936 782.00 0.827703 2.106145 86.538462 1.164295
564 2013-01-29 753 797 750 797 4585859 797.00 0.868687 1.684932 193.023256 1.918159
565 2013-01-28 743 751 740 745 2229790 745.00 0.896907 1.104089 111.594203 -6.524467
566 2013-01-25 741 749 733 742 2056180 741.00 0.933566 1.386555 111.267606 -0.402685
567 2013-01-24 715 750 705 750 5168070 749.00 1.072464 1.223048 147.887324 1.078167
568 2013-01-23 734 737 716 735 2591542 734.00 1.017422 0.944262 104.411765 -2.000000
569 2013-01-22 745 745 731 734 1611623 734.00 0.935593 0.807927 88.235294 -0.136054
570 2013-01-21 726 745 726 734 2050383 734.00 1.032374 0.745562 116.176471 0.000000
571 2013-01-18 729 731 717 725 1689409 725.00 1.101167 0.673410 102.702703 -1.226158
572 2013-01-17 742 748 719 719 2489881 719.00 1.086792 0.589385 83.333333 -0.827586
573 2013-01-16 725 742 717 734 2054534 734.00 1.152091 0.485861 130.000000 2.086231
574 2013-01-15 717 740 715 725 2781249 725.00 1.167300 0.473815 173.684211 -1.226158
575 2013-01-14 731 740 715 723 2512023 723.00 1.172285 0.465517 100.000000 -0.275862
576 2013-01-11 742 752 737 748 1512115 747.00 1.188679 0.616848 47.619048 3.457815
577 2013-01-10 750 751 730 730 1517566 730.00 1.159259 0.598404 9.523810 -2.406417
578 2013-01-09 738 757 738 742 2072930 741.00 1.254753 0.653846 73.076923 1.643836
579 2013-01-08 740 744 723 738 3475195 738.00 1.196364 0.578406 65.384615 -0.539084
580 2013-01-07 802 802 746 746 3777648 -- 1.038835 0.750663 0.000000 1.084011
581 2013-01-04 824 825 791 802 1908685 802.00 0.960606 1.006042 1.176471 7.506702
582 2013-01-03 836 844 824 824 2278777 824.00 0.879412 1.033537 7.692308 2.743142
583 2013-01-02 790 832 785 832 2896765 832.00 1.018018 0.976945 51.923077 0.970874

584 rows × 11 columns


In [85]:
result['Close'].size


Out[85]:
584

In [31]:
result['Close'][0]


Out[31]:
2290.0

In [34]:
result['Close'][0:12].size


Out[34]:
12

In [38]:
range(0,2)


Out[38]:
[0, 1]

In [ ]: