-
-
Notifications
You must be signed in to change notification settings - Fork 166
Data Feeds
Michael Chu edited this page Oct 4, 2020
·
6 revisions
Optopsy currently supports importing data directly from CSV files.
csv_data(file_path, underlying_symbol=0, underlying_price=1, option_type=2, expiration=3, quote_date=4, strike=5 bid=6, ask=7
This is a convenience function to map your CSV file to the expected internal columns for Optopsy. All integer parameters are 0-indexed, meaning '0' maps to the first column of your CSV file.
Parameters
- file_path (str, required): A string representing the relative filepath to search for the data file
- underlying_symbol (_int, optional): An integer to map the column number of the CSV file to use for the option's symbol.
- underlying_price (int, optional): Same as above, for underlying stock price.
- option_type (int, optional): Same as above, for underlying option type.
- expiration (int, optional): Same as above, for option's expiration date.
- quote_date (int, optional): Same as above, for option's quote date.
- strike (int, optional): Same as above, for option's strike price.
- bid (int, optional): Same as above, for option's bid price.
- ask (int, optional): Same as above, for options' ask price.
Under the hood it uses pandas read_csv
function to perform the import. If you encounter any issues using this function, it is advised to just use pandas import functions to manually create the formatted DataFrames.
Copyright © 2020, Michael Chu