I am new to financial mathematics and trying to do a homework about backtest with R:
library(FinancialInstrument)
start.date <- '2017-01-01'
end.date <- '2019-12-30'
HSI <- getSymbols(Symbols="^HSI",src="yahoo",from=start.date,to=end.date,index.class="POSIXct",adjust=T, auto.assign = F)
HSI <- HSI %>% na.omit()
currency(primary_id='HKD')
stock(primary_id=HSI,currency='HKD',multiplier=500,tick_size=0.05)
But I receive the following Error: C stack usage 7971792 is too close to the limit
My R session:
Cstack_info()
size current direction eval_depth
7969177 13136 1 2
I saw there is similar post but no one answer: Error: C stack usage is too close to the limit in R
Is there anyone can advise about the Cstack error ?
Don't use auto.assign.
getSymbols(Symbols="2800.HK",src="yahoo", from=start.date,to=end.date,index.class="POSIXct",adjust=T)
`2800.HK` <- `2800.HK` %>% na.omit()
currency(primary_id='HKD')
stock(primary_id='2800.HK',currency='HKD',multiplier=500,tick_size=0.05)