Scraps Le Boursier's and gets the historical prices for the specified companies.

stock(x)

stocks(...)

Arguments

x, ...

Company name as returned by the get_today() function

Value

Returns a data.frame containing all the historical data for the specified stock.

  • date: the date of the given record.

  • open: the opening price of the stock on date.

  • high: the highest price.

  • low: the lowest price.

  • close: the closing price.

  • volume: Volume of stocks traded on date.

If the plural variant is used it'll add a symbol column that'll contain the name of the company.

Examples

head(stock("Wafa Assur"), 20)
#> date open high low close volume #> 1 2015-12-16 3298 3298 3298 3298 7 #> 2 2015-12-18 3250 3250 3250 3250 27 #> 3 2015-12-21 3056 3275 3056 3275 2084 #> 4 2015-12-23 3259 3259 3250 3258 1155 #> 5 2015-12-28 3100 3279 3100 3279 1170 #> 6 2015-12-29 3157 3249 3126 3126 1096 #> 7 2015-12-30 2980 3279 2980 3279 2018 #> 8 2015-12-31 3270 3270 3270 3270 600 #> 9 2016-01-05 3130 3130 3130 3130 931 #> 10 2016-01-06 3131 3131 3130 3130 110 #> 11 2016-01-07 3300 3300 3300 3300 8 #> 12 2016-01-08 3280 3280 3280 3280 1000 #> 13 2016-01-14 3250 3250 3250 3250 1000 #> 14 2016-01-15 3250 3250 3250 3250 300 #> 15 2016-01-19 3075 3075 3075 3075 1 #> 16 2016-01-20 3200 3200 3200 3200 2 #> 17 2016-01-22 3220 3220 3098 3098 1605 #> 18 2016-01-26 3101 3101 3085 3085 11 #> 19 2016-02-02 3085 3150 3085 3150 500 #> 20 2016-02-03 3150 3165 3150 3165 750
head(stock(), 20) # same as runing stock("MASI")
#> date open high low close volume #> 1 2015-12-16 8796.65 8870.44 8796.65 8864.75 NA #> 2 2015-12-17 8863.02 8870.07 8812.57 8846.45 NA #> 3 2015-12-18 8843.70 8860.92 8821.78 8860.92 NA #> 4 2015-12-21 8861.94 8864.25 8789.89 8864.25 NA #> 5 2015-12-22 8862.78 8878.53 8848.41 8863.38 NA #> 6 2015-12-23 8858.99 8893.10 8836.15 8893.10 NA #> 7 2015-12-28 8885.18 8905.83 8836.22 8856.06 NA #> 8 2015-12-29 8817.89 8873.96 8795.62 8873.96 NA #> 9 2015-12-30 8873.72 8873.72 8802.90 8868.85 NA #> 10 2015-12-31 8867.46 8925.71 8843.28 8925.71 NA #> 11 2016-01-04 8918.89 8931.24 8868.95 8888.04 NA #> 12 2016-01-05 8882.22 8889.92 8823.19 8837.81 NA #> 13 2016-01-06 8834.07 8847.21 8817.81 8842.12 NA #> 14 2016-01-07 8841.51 8856.69 8823.62 8856.09 NA #> 15 2016-01-08 8836.69 8843.64 8820.90 8836.93 NA #> 16 2016-01-12 8807.61 8837.97 8803.58 8828.91 NA #> 17 2016-01-13 8831.12 8844.80 8809.74 8844.80 NA #> 18 2016-01-14 8839.71 8868.09 8830.60 8852.28 NA #> 19 2016-01-15 8859.28 8873.72 8845.28 8853.56 NA #> 20 2016-01-18 8875.06 8884.85 8848.64 8868.67 NA
head(stock("MADEX"), 20)
#> date open high low close volume #> 1 2015-12-16 7157.31 7223.58 7157.31 7218.21 NA #> 2 2015-12-17 7216.68 7222.93 7168.74 7198.81 NA #> 3 2015-12-18 7196.37 7211.22 7178.34 7211.22 NA #> 4 2015-12-21 7212.14 7217.25 7151.24 7217.25 NA #> 5 2015-12-22 7216.69 7229.93 7202.33 7214.47 NA #> 6 2015-12-23 7210.58 7239.25 7190.30 7239.25 NA #> 7 2015-12-28 7232.22 7250.55 7188.78 7210.59 NA #> 8 2015-12-29 7176.72 7223.24 7160.20 7223.24 NA #> 9 2015-12-30 7223.02 7223.02 7161.35 7215.13 NA #> 10 2015-12-31 7213.88 7255.21 7195.10 7255.21 NA #> 11 2016-01-04 7249.15 7260.71 7210.29 7227.27 NA #> 12 2016-01-05 7222.10 7228.94 7173.80 7186.16 NA #> 13 2016-01-06 7182.84 7194.53 7169.95 7193.39 NA #> 14 2016-01-07 7192.86 7206.34 7177.56 7205.81 NA #> 15 2016-01-08 7189.22 7195.39 7177.98 7192.12 NA #> 16 2016-01-12 7166.07 7193.21 7161.14 7183.62 NA #> 17 2016-01-13 7185.59 7196.34 7166.47 7194.15 NA #> 18 2016-01-14 7189.62 7210.07 7181.53 7196.00 NA #> 19 2016-01-15 7202.08 7215.05 7193.83 7201.33 NA #> 20 2016-01-18 7220.43 7229.15 7207.72 7229.01 NA
head(stocks("Masi", "MADEX"), 20)
#> date open high low close volume symbol #> 1 2015-12-16 8796.65 8870.44 8796.65 8864.75 NA MASI #> 2 2015-12-17 8863.02 8870.07 8812.57 8846.45 NA MASI #> 3 2015-12-18 8843.70 8860.92 8821.78 8860.92 NA MASI #> 4 2015-12-21 8861.94 8864.25 8789.89 8864.25 NA MASI #> 5 2015-12-22 8862.78 8878.53 8848.41 8863.38 NA MASI #> 6 2015-12-23 8858.99 8893.10 8836.15 8893.10 NA MASI #> 7 2015-12-28 8885.18 8905.83 8836.22 8856.06 NA MASI #> 8 2015-12-29 8817.89 8873.96 8795.62 8873.96 NA MASI #> 9 2015-12-30 8873.72 8873.72 8802.90 8868.85 NA MASI #> 10 2015-12-31 8867.46 8925.71 8843.28 8925.71 NA MASI #> 11 2016-01-04 8918.89 8931.24 8868.95 8888.04 NA MASI #> 12 2016-01-05 8882.22 8889.92 8823.19 8837.81 NA MASI #> 13 2016-01-06 8834.07 8847.21 8817.81 8842.12 NA MASI #> 14 2016-01-07 8841.51 8856.69 8823.62 8856.09 NA MASI #> 15 2016-01-08 8836.69 8843.64 8820.90 8836.93 NA MASI #> 16 2016-01-12 8807.61 8837.97 8803.58 8828.91 NA MASI #> 17 2016-01-13 8831.12 8844.80 8809.74 8844.80 NA MASI #> 18 2016-01-14 8839.71 8868.09 8830.60 8852.28 NA MASI #> 19 2016-01-15 8859.28 8873.72 8845.28 8853.56 NA MASI #> 20 2016-01-18 8875.06 8884.85 8848.64 8868.67 NA MASI