This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sample Contract Value | |
vol=1000 | |
price=10 | |
volprice=vol*price | |
def commSCB(volprice): | |
"SCB commission is fixed 0.2%" | |
brokerage=volprice*0.2/100 | |
clearingfee=0.04/100*volprice | |
#no SGX trading fee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library('quantmod') | |
#loadSymbols of the stock codes you are interested in | |
loadSymbols(c('K17.SI','BN4.SI')) | |
#retrieves the values for a single date | |
BN4.SI['2013-01-25'] | |
#K17.SI['2013-03-04'] | |
#Convert the matrix retrieved as a data.frame for easier data usage |
NewerOlder