store_market_data: Store historical market data

Description Usage Arguments Details Examples

Description

Store historical market data

Usage

1
2
3
4
5
store_finam_data(from = NULL, to = format(Sys.Date()), verbose = TRUE)

store_iqfeed_data(from = NULL, to = format(Sys.Date()), verbose = TRUE)

store_moex_data(from = NULL, to = format(Sys.Date()), verbose = TRUE)

Arguments

from, to

text dates in format "YYYY-mm-dd"

verbose

show progress?

Details

See example below.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
## Finam data storage
settings = list(
  # set storage path, it is perfect to use Solid State Drive for data storage
  # it is no problem to move storage folder just don't forget to set new path in settings
  finam_storage = paste( path.expand('~') , 'Market Data', 'finam', sep = '/' ),
  # add some symbols
  finam_symbols = c( 'GAZP', 'SBER' ),
  # and set storage start date
  finam_storage_from = '2016-09-01'
)
QuantTools_settings( settings )
# now it is time to add some data into storage. You have three options here:

  # 1 update storage with data from last date available until today
  # it is very convenient to create a script with this function and
  # run it every time you need to update your storage
  store_finam_data()

  # 2 update storage with data from last date available until specified date
  store_finam_data( to = '2016-09-28' )

  # 3 update storage with data between from and to dates,
  # if data already present it will be overwritten
  store_finam_data( from = '2016-01-01', to = '2016-01-10' )

# set local = TRUE to load from just created local market data storage
get_finam_data( 'GAZP', '2016-09-01', '2016-09-28', 'tick', local = T )

## IQFeed data storage
settings = list(
  # set storage path, it is perfect to use Solid State Drive for data storage
  # it is no problem to move storage folder just don't forget to set new path in settings
  iqfeed_storage = paste( path.expand('~') , 'Market Data', 'iqfeed', sep = '/' ),
  # add some symbols
  iqfeed_symbols = c( 'AAPL', '@ES#' ),
  # and set storage start date
  iqfeed_storage_from = format( Sys.Date() - 3 )
)
QuantTools_settings( settings )
# now it is time to add some data into storage. You have three options here:

  # 1 update storage with data from last date available until today
  # it is very convenient to create a script with this function and
  # run it every time you need to update your storage
  store_iqfeed_data()

  # 2 update storage with data from last date available until specified date
  store_iqfeed_data( to = format( Sys.Date() ) )

  # 3 update storage with data between from and to dates,
  # if data already present it will be overwritten
  store_iqfeed_data( from = format( Sys.Date() - 3 ), to = format( Sys.Date() ) )

# set local = TRUE to load from just created local market data storage
get_iqfeed_data( 'AAPL', format( Sys.Date() - 3 ), format( Sys.Date() ), 'tick', local = T )

## MOEX data storage
settings = list(
  # set MOEX data url
  moex_data_url = 'url/to/moex/data',
  # set storage path, it is perfect to use Solid State Drive for data storage
  # it is no problem to move storage folder just don't forget to set new path in settings
  moex_storage = paste( path.expand('~') , 'Market Data', 'moex', sep = '/' ),
  # and set storage start date
  moex_storage_from = '2003-01-01'
)
QuantTools_settings( settings )
# now it is time to add some data into storage. You have three options here:

  # 1 update storage with data from last date available until today
  # it is very convenient to create a script with this function and
  # run it every time you need to update your storage
  store_moex_data()

  # 2 update storage with data from last date available until specified date
  store_moex_data( to = format( Sys.Date() ) )

  # 3 update storage with data between from and to dates,
  # if data already present it will be overwritten
  store_moex_data( from = format( Sys.Date() - 3 ), to = format( Sys.Date() ) )

# set local = TRUE to load from just created local market data storage
get_moex_futures_data( 'RIH9', '2009-01-01', '2009-02-01', 'tick', local = T )

QuantTools documentation built on Oct. 23, 2020, 7:54 p.m.