開盤 最高 最低 收盤 五日平均 買賣決定 15059.92 15152.38 14998.03 15012.8 14933.2 15021.73 14921.06 14970.68 14972.17 15088.06 14969.97 14980.74 加'單引號註解 14955.29 14957.82 14728.88 14728.88 =AVERAGE(E2:E6) 14708.08 14823.15 14630.01 14630.01 14864.622 Sell =IF(E6 >F6,"Buy",IF(E6<F6,"Sell","")) 14631.21 14634.16 14464.2 14553.04 14772.67 Sell 14620.27 14742.79 14620.27 14705.43 14719.62 Sell 14658.46 14658.46 14538.66 14612.59 14645.99 Sell 14617.86 14658.7 14515.74 14522.96 14604.806 Sell 14557.56 14739.36 14557.56 14739.36 14626.676 Buy 共獲利 109.35 14692.92 14756.38 14649.54 14734.13 14662.894 Buy 下次使用一年資料 14554.21 14568.31 14447.77 14528.55 14627.518 Sell 回朔測試 14478.45 14493.72 14411.81 14433.32 14591.664 Sell 2010年的結果找出最佳參數 14410.75 14451.91 14157.99 14170.03 14521.078 Sell 利用這個參數測試2011年的績效 14205.06 14291.98 14197.86 14234.4 14420.086 Sell 回溯測試 14323.04 14442.94 14323.04 14442.94 14361.848 Buy 14318.12 14318.12 14192.98 14271.63 14310.464 Sell 14271.2 14301.11 14253.2 14285.13 14280.826 Buy 14310.19 14410.24 14310.19 14328.43 14312.506 Buy 14249.83 14249.83 14119.3 14173.1 14300.246 Sell 14097.51 14120.57 13981.63 14085.02 14228.662 Sell 14183.52 14248.9 14137.69 14137.69 14201.874 Sell
李東霖python import openpyxl 處理EXCEL
import openpyxl #劉任昌輸入import openpyxl處理EXCEL的函式庫 book = openpyxl.load_workbook(r'wb.xlsx') #開啟EXCEL工作簿wb.xlsx print("1. 列出所有工作表名稱") sheetNames=book.sheetnames #所有工作表的集合 for name in sheetNames: print(name) print("2. 針對特定工作表, 列出前面數列") #sheet = book["python"] #for row in sheet.iter_rows(min_row=1, max_row=3, min_col=1, max_col=5, values_only=True): # print(row) print("3. 列出工作表所有內容") #sheet["F1"], sheet["G1"], sheet["H1"], sheet["I1"]="波段H","波段L","部位","損益" #sheet["F2"], sheet["G2"], sheet["H2"], sheet["I2"]=sheet["C2"].value, sheet["D2"].value, 0, 0 #for row in sheet.iter_rows(min_row=1, max_row=3, min_col=1, max_col=9, values_only=True): # print(row) #book.save()
310.股票圖
回覆刪除