|
| 1 | +# Import historical data |
| 2 | + |
| 3 | +::: warning |
| 4 | +Available in 5.0.4 release. |
| 5 | +::: |
| 6 | + |
| 7 | +## Overview |
| 8 | +This feature allows you to import historical data (tickers you selected) in Cassandre database, so you can initialise your strategy. |
| 9 | + |
| 10 | +## Data file & format |
| 11 | +At startup, Cassandre will search for all files starting with `tickers-to-import` and ending with `csv`. |
| 12 | + |
| 13 | +This is how the file must be formatted: |
| 14 | +``` |
| 15 | +CURRENCY_PAIR,OPEN,LAST,BID,ASK,HIGH,LOW,VWAP,VOLUME,QUOTE_VOLUME,BID_SIZE,ASK_SIZE,TIMESTAMP |
| 16 | +"BTC/USDT","0.00000001","0.00000002","0.00000003","0.00000004","0.00000005","0.00000006","0.00000007","0.00000008","0.00000009","0.00000010","0.00000011",1508546000 |
| 17 | +"BTC/USDT","1.00000001","1.00000002","1.00000003","1.00000004","1.00000005","1.00000006","1.00000007","1.00000008","1.00000009","1.00000010","1.00000011",1508446000 |
| 18 | +"ETH/USDT","2.00000001","2.00000002","2.00000003","2.00000004","2.00000005","2.00000006","2.00000007","2.00000008","2.00000009","2.00000010","2.00000011",1508346000 |
| 19 | +``` |
| 20 | + |
| 21 | +## When to initialize data? |
| 22 | +In you strategy, you should implement the `initialize()` method. This method is executed by Cassandre before any other data (tickers, orders, trades...) is pushed to the strategy. |
| 23 | + |
| 24 | +## Access your data in your strategy |
| 25 | +In your strategy, you can access the data with two methods: |
| 26 | + * `List<TickerDTO> getImportedTickers()`. |
| 27 | + * `List<TickerDTO> getImportedTickers(CurrencyPairDTO currencyPairDTO)`. |
0 commit comments