Files
OpenBB/assets/js/7282f83b.d8d6f2d7.js
github-actions[bot] ebb5ede6f0 deploy: 34b5d5a91a
2022-12-06 16:15:31 +00:00

1 line
9.9 KiB
JavaScript

"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[28789],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>m});var n=a(67294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function l(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(a),m=r,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||o;return a?n.createElement(h,i(i({ref:t},c),{},{components:a})):n.createElement(h,i({ref:t},c))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,i=new Array(o);i[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var p=2;p<o;p++)i[p]=a[p];return n.createElement.apply(null,i)}return n.createElement.apply(null,a)}u.displayName="MDXCreateElement"},11741:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var n=a(87462),r=(a(67294),a(3905));const o={title:"Importing and Exporting Data",sidebar_position:3},i=void 0,l={unversionedId:"guides/advanced/data",id:"guides/advanced/data",title:"Importing and Exporting Data",description:"The OpenBBUserData Folder",source:"@site/content/terminal/guides/advanced/data.md",sourceDirName:"guides/advanced",slug:"/guides/advanced/data",permalink:"/terminal/guides/advanced/data",draft:!1,editUrl:"https://github.com/OpenBB-finance/OpenBBTerminal/edit/main/website/content/terminal/guides/advanced/data.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{title:"Importing and Exporting Data",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Changing Sources",permalink:"/terminal/guides/advanced/changing-sources"},next:{title:"Customizing the Terminal",permalink:"/terminal/guides/advanced/customizing-the-terminal"}},s={},p=[{value:"The OpenBBUserData Folder",id:"the-openbbuserdata-folder",level:2},{value:"Exporting Files",id:"exporting-files",level:2},{value:"Importing Data",id:"importing-data",level:2}],c={toc:p};function d(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"the-openbbuserdata-folder"},"The OpenBBUserData Folder"),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"OpenBBUserData")," folder's default location is the home of the system user account. By default this will be the following paths:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"macOS: ",(0,r.kt)("inlineCode",{parentName:"li"},"Macintosh HD/Users/<YOUR_USERNAME>/OpenBBUserData")),(0,r.kt)("li",{parentName:"ul"},"Windows: ",(0,r.kt)("inlineCode",{parentName:"li"},"C:/Users/<YOUR_USERNAME>/OpenBBUserData"))),(0,r.kt)("p",null,"Within the folder you can find files that you have exported as well as files that you wish to import directly into the OpenBB Terminal. For example, this could be an orderbook which you can store in ",(0,r.kt)("inlineCode",{parentName:"p"},"OpenBBUserData/portfolio/holdings"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/195742985-19f0e420-d8f7-4fea-a145-a0243b8f2ddc.png",alt:"OpenBBUserData Folder",title:"OpenBBUserData Folder"})),(0,r.kt)("p",null,"This folder contains all things user-created. For example:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Screener presets"),(0,r.kt)("li",{parentName:"ul"},"Portfolio files"),(0,r.kt)("li",{parentName:"ul"},"Exported files"),(0,r.kt)("li",{parentName:"ul"},"Files to be imported by various functions"),(0,r.kt)("li",{parentName:"ul"},"Styles and themes"),(0,r.kt)("li",{parentName:"ul"},"Preferred data sources")),(0,r.kt)("p",null,"The location of this folder can be set by the user from the ",(0,r.kt)("inlineCode",{parentName:"p"},"/settings")," menu. There should be no need to update paths in this menu unless the folders have been moved manually."),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/195736718-a1b821da-5977-437a-bd18-b44add2a29a2.png",alt:"The Settings Menu",title:"The Settings Menu"})),(0,r.kt)("h2",{id:"exporting-files"},"Exporting Files"),(0,r.kt)("p",null,"If the location of the OpenBBUserData folder must be changed, it is best to move the entire existing folder to the new path. The path is then changed under the settings menu with:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"userdata --folder /path_to/OpenBBUserData\n")),(0,r.kt)("p",null,"The types of files which can be exported from tables and raw data are:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"CSV"),(0,r.kt)("li",{parentName:"ul"},"JSON"),(0,r.kt)("li",{parentName:"ul"},"XLSX")),(0,r.kt)("p",null,"It is optional to name the file; the minimum requirement is the file type."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"/stocks/load CHWY -s 2019-06-01 --export chwy_ohlc.csv\n")),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/204919033-d6d5632a-c6ce-42cf-a038-b93d579e38d4.png",alt:"Screenshot 2022-11-30 at 2 10 22 PM"})),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"Saved file: /Users/{username}/OpenBBUserData/exports/chwy_ohlc.csv\n")),(0,r.kt)("p",null,"The types of image files charts can be exported as are:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"PNG"),(0,r.kt)("li",{parentName:"ul"},"JPG"),(0,r.kt)("li",{parentName:"ul"},"PDG"),(0,r.kt)("li",{parentName:"ul"},"SVG")),(0,r.kt)("p",null,"If no file name is specified, the file will be automatically named starting with the date and time generated."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"candle --ma 20,50,150 -t --export svg\n\nSaved file: /Users/{username}/OpenBBUserData/exports/20221130_141425_stocks_CHWY.svg\n")),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/204919882-3cf7ba23-7fba-4b9d-b278-25752efab0c6.png",alt:"Screenshot 2022-11-30 at 2 16 19 PM"})),(0,r.kt)("p",null,"Every function capable of exporting content will work in exactly the same manner. Print the ",(0,r.kt)("inlineCode",{parentName:"p"},"--help")," dialogue for any function to see the options available."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-console"},"(\ud83e\udd8b) /stocks/options/ $ chains --help\n\nusage: chains [-c] [-p] [-m MIN_SP] [-M MAX_SP] [-d TO_DISPLAY] [-h] [--export EXPORT] [--source {YahooFinance,Tradier,Nasdaq}]\n\nDisplay option chains\n\noptions:\n -c, --calls Flag to show calls only (default: False)\n -p, --puts Flag to show puts only (default: False)\n -m MIN_SP, --min MIN_SP\n minimum strike price to consider. (default: -1)\n -M MAX_SP, --max MAX_SP\n maximum strike price to consider. (default: -1)\n -d TO_DISPLAY, --display TO_DISPLAY\n (tradier only) Columns to look at. Columns can be: bid, ask, strike, bidsize, asksize, volume, open_interest, delta, gamma, theta, vega, ask_iv, bid_iv,\n mid_iv. E.g. 'bid,ask,strike' (default: ['mid_iv', 'vega', 'delta', 'gamma', 'theta', 'volume', 'open_interest', 'bid', 'ask'])\n -h, --help show this help message (default: False)\n --export EXPORT Export raw data into csv, json, xlsx (default: )\n --source {YahooFinance,Tradier,Nasdaq}\n Data source to select from (default: YahooFinance)\n\nFor more information and examples, use 'about chains' to access the related guide.\n\n(\ud83e\udd8b) /stocks/options/ $\n")),(0,r.kt)("h2",{id:"importing-data"},"Importing Data"),(0,r.kt)("p",null,"Menus, such as ",(0,r.kt)("a",{parentName:"p",href:"https://docs.openbb.co/terminal/guides/intros/econometrics"},"Econometrics")," or ",(0,r.kt)("a",{parentName:"p",href:"https://docs.openbb.co/terminal/guides/intros/portfolio"},"Portfolio"),", allow the user to import their own dataset. Files available to import will be included with the selections made available by auto-complete. In the Econometrics menu, this is activated after pressing the space bar, ",(0,r.kt)("inlineCode",{parentName:"p"},"load -f ")),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/204921760-38742f6c-ec78-4009-9c23-54dcb0504524.png",alt:"Importing Data",title:"Importing Data"})),(0,r.kt)("p",null,"As illustrated above, the exported file that was created in the previous example is ready to be loaded into the Econometrics menu. Use the arrow keys to scroll the files available to import."))}d.isMDXComponent=!0}}]);