李東霖EXCEL運算列表grid search獲得最佳參數 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 6月 02, 2023 李東霖 運算列表 A784放置目標函數 漲幅最大 =MATCH(GA784,B784:FY784,0) match index =INDEX($B$783:$FY$783,GB784) 最大 最大的位置match找到 11205.56 73 7.3% 下跌突破點 77 7.7% 上漲突破點 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 留言
李東霖python import openpyxl 處理EXCEL 5月 18, 2023 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() 閱讀完整內容
3月 09, 2023 開盤 最高 最低 收盤 五日平均 買賣決定 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 ... 閱讀完整內容
留言
張貼留言