發表文章

目前顯示的是 6月, 2024的文章

D11050113王泓崴 Flash crash

圖片
In modern finance, a flash crash is a very rapid, deep, and volatile fall in security prices occurring within a very short time period followed by a quick recovery.[1] Flash crashes are frequently blamed by media on trades executed by black-box trading, combined with high-frequency trading, whose speed and interconnectedness can result in the loss and recovery of billions of dollars in a matter of minutes and seconds, but in reality occur because almost all participants have pulled their liquidity and temporarily paused their trading in the face of a sudden increase in risk.[2] Occurrences Examples of flash crashes that have occurred: May 6, 2010, flash crash April 23, 2013, flash crash Frankenshock,[3] or Flash Crash Swiss Franc on January 15, 2015[4] Flash Crash of the British Pound on October 6, 2016[5] Flash Crash of Japanese Yen on January 2, 2019[6][7] Flash Crash of European Stock Markets on May 2, 2022.[8][9] 2010 flash crash Main article: 2010 flash crash This type of ...

D11050113王泓崴期末考

圖片
title = ["日期", "收盤", "決策","部位"] rows = [] rows.append(title) rows.append(["2024/6/17",15.1,0,0]) rows.append(["2024/6/18",15.8,0,0]) rows.append(["2024/6/19",18.1,1,1]) rows.append(["2024/6/20",19.2,0,1]) rows.append(["2024/6/21",20.1,0,1]) for i in range(len(rows)): print(rows[i]) for i in range(1, len(rows)): if rows[i][3]==1:#如果做多 gain = rows[i][1]-rows[i-1][1] rows[i].append(gain)#增加一個欄位今天損益 elif rows[i][3]==-1:#如果做空 gain = rows[i-1][1]-rows[i][1]#昨天扣除今天 rows[i].append(gain) else: rows[i].append(0.0) for i in range(1,len(rows)): print(rows[i])