mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-07 09:52:13 +00:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[13026],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>d});var n=a(67294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function s(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 r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function o(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)a=s[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)a=s[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var l=n.createContext({}),c=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},p=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,s=e.originalType,l=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=c(a),d=i,h=m["".concat(l,".").concat(d)]||m[d]||u[d]||s;return a?n.createElement(h,r(r({ref:t},p),{},{components:a})):n.createElement(h,r({ref:t},p))}));function d(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var s=a.length,r=new Array(s);r[0]=m;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:i,r[1]=o;for(var c=2;c<s;c++)r[c]=a[c];return n.createElement.apply(null,r)}return n.createElement.apply(null,a)}m.displayName="MDXCreateElement"},96584:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>s,metadata:()=>o,toc:()=>c});var n=a(87462),i=(a(67294),a(3905));const s={title:"Quantitative Analysis",keywords:["quantitative","analysis","qa","q/a","daily","indicators","signals","average","summary","normality","line","hist","cdf","bw","acf","qqplot","rolling","spread","quantile","skew","kurtosis","var","es","sh","so","om","raw","decompose","cusum","capm","beta","histogram","auto-correlation","value","median","crypto","forex","fx","cryptocurrency","stocks"],date:"2022-08-08",type:"guides",status:"publish",excerpt:"This guide introduces the Quantitative Analysis menu, which is common across many sections of the OpenBB Terminal, briefly describes the features, and provides examples in context."},r=void 0,o={unversionedId:"guides/intros/common/qa",id:"guides/intros/common/qa",title:"Quantitative Analysis",description:"Quantitative analysis (QA) in finance is an approach that emphasizes mathematical and statistical analysis to help determine the value of a financial asset, such as a stock or option. The ultimate goal of financial quantitative analysis is to use quantifiable statistics and metrics to assist investors in making profitable investment decisions. Quantitative analysis is different from qualitative analysis, which looks at factors such as how companies are structured, the makeup of their management teams, and what their strengths and weaknesses are.",source:"@site/content/terminal/guides/intros/common/qa.md",sourceDirName:"guides/intros/common",slug:"/guides/intros/common/qa",permalink:"/terminal/guides/intros/common/qa",draft:!1,editUrl:"https://github.com/OpenBB-finance/OpenBBTerminal/edit/main/website/content/terminal/guides/intros/common/qa.md",tags:[],version:"current",frontMatter:{title:"Quantitative Analysis",keywords:["quantitative","analysis","qa","q/a","daily","indicators","signals","average","summary","normality","line","hist","cdf","bw","acf","qqplot","rolling","spread","quantile","skew","kurtosis","var","es","sh","so","om","raw","decompose","cusum","capm","beta","histogram","auto-correlation","value","median","crypto","forex","fx","cryptocurrency","stocks"],date:"2022-08-08",type:"guides",status:"publish",excerpt:"This guide introduces the Quantitative Analysis menu, which is common across many sections of the OpenBB Terminal, briefly describes the features, and provides examples in context."},sidebar:"tutorialSidebar",previous:{title:"Behavioural Analysis",permalink:"/terminal/guides/intros/common/ba"},next:{title:"Technical Analysis",permalink:"/terminal/guides/intros/common/ta"}},l={},c=[{value:"How to use",id:"how-to-use",level:3},{value:"Examples",id:"examples",level:3}],p={toc:c};function u(e){let{components:t,...a}=e;return(0,i.kt)("wrapper",(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("a",{href:"https://www.investopedia.com/terms/q/quantitativeanalysis.asp",target:"_blank",rel:"noreferrer noopener"},"Quantitative analysis (QA)")," in finance is an approach that emphasizes mathematical and statistical analysis to help determine the value of a financial asset, such as a stock or option. The ultimate goal of financial quantitative analysis is to use quantifiable statistics and metrics to assist investors in making profitable investment decisions. Quantitative analysis is different from qualitative analysis, which looks at factors such as how companies are structured, the makeup of their management teams, and what their strengths and weaknesses are.",(0,i.kt)("p",null,"The Quantitative Analysis menu is a common menu to three asset classes:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{href:"/terminal/guides/intros/crypto/",target:"_blank",rel:"noreferrer noopener"},"Crypto")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{href:"/terminal/guides/intros/forex/",target:"_blank",rel:"noreferrer noopener"},"Forex")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{href:"/terminal/guides/intros/stocks/",target:"_blank",rel:"noreferrer noopener"},"Stocks"))),(0,i.kt)("img",{width:"1110",alt:"The Quantitative Analysis menu",src:"https://user-images.githubusercontent.com/85772166/183483507-a4bef3e8-6603-46fb-a022-424f18af32d6.png"}),(0,i.kt)("h3",{id:"how-to-use"},"How to use"),(0,i.kt)("p",null,"Enter the menu, through one of the asset classes listed above, by entering ",(0,i.kt)("inlineCode",{parentName:"p"},"qa")," in the Terminal. The ticker that is loaded before entering the menu will determine the timeframe for the analysis. To alter it, use the ",(0,i.kt)("inlineCode",{parentName:"p"},"load")," function and pick a new ",(0,i.kt)("inlineCode",{parentName:"p"},"--start")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"--end")," for the observation window. The QA functions target a specified column of the data. By default, this is returns. Use the ",(0,i.kt)("inlineCode",{parentName:"p"},"pick")," command to chose a new target column."),(0,i.kt)("img",{width:"358",alt:"Picking a new target column",src:"https://user-images.githubusercontent.com/85772166/183483572-6127eaff-69d2-4d67-8e60-8d7756a043b0.png"}),(0,i.kt)("p",null,"The menu is divided into five categories of functions:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Statistics"),(0,i.kt)("li",{parentName:"ul"},"Plots"),(0,i.kt)("li",{parentName:"ul"},"Rolling Metrics"),(0,i.kt)("li",{parentName:"ul"},"Risk"),(0,i.kt)("li",{parentName:"ul"},"Other")),(0,i.kt)("p",null,"A summary of exportable statistics is displayed with the command, ",(0,i.kt)("inlineCode",{parentName:"p"},"summary"),". The example here shows $APPL."),(0,i.kt)("img",{width:"1109",alt:"QA summary for Apple",src:"https://user-images.githubusercontent.com/85772166/183483647-3414adae-c4de-4b1e-81a5-04a4d8a51e19.png"}),(0,i.kt)("p",null,"A simple line chart for the target column as a time-series is called with the ",(0,i.kt)("inlineCode",{parentName:"p"},"line")," command."),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183483733-043f9c21-c408-4526-8c39-16937a05d46a.png",alt:"Line chart of Apple highs over time"})),(0,i.kt)("p",null,"Optional arguments to this command allows the user to draw and annotate on the chart."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"2022 Aug 08, 12:14 /stocks/qa/ $ line -h usage: line [--log] [-d] [--ml ML]\n[--ms MS] [-h] [--export EXPORT]\n\nShow line plot of selected data or highlight specific datetimes.\n\noptions: --log Plot with y on log scale (default: False) --ml ML Draw vertical\nline markers to highlight certain events (default: ) --ms MS Draw scatter\nmarkers to highlight certain events (default: ) -h, --help show this help\nmessage (default: False) --export EXPORT Export figure into png, jpg, pdf, svg\n(default: )\n\nFor more information and examples, use 'about line' to access the related guide.\n\n2022 Aug 08, 12:20 /stocks/qa/ $ pick high\n\nCompare the beta between the loaded asset and another, using the `-r` flag to\ndeviate from the defaulted comparison, $SPY.\n\n2022 Aug 08, 12:34 /stocks/qa/ $ beta -r MSFT\n\nLoading Daily MSFT stock with starting period 2019-08-05 for analysis.\n")),(0,i.kt)("img",{width:"762",alt:"Beta of $AAPL relative to $MSFT",src:"https://user-images.githubusercontent.com/85772166/183483898-dac417a8-0afe-46d2-b8e9-e855e8752fc8.png"}),(0,i.kt)("p",null,"Most outputs are equipped with an ",(0,i.kt)("inlineCode",{parentName:"p"},"--export")," flag, allowing the user to save the tables as a CSV, JSON, or XLSX file. The exports can then be imported into other menus like ",(0,i.kt)("a",{href:"/terminal/guides/intros/econometrics/",target:"_blank",rel:"noreferrer noopener"}," Econometrics"),". Additional information on each specific command is displayed by attaching ",(0,i.kt)("inlineCode",{parentName:"p"},"-h")," to it."),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Box and Whisker plots for monthly and yearly scales:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"2022 Aug 08, 12:47 /stocks/qa/ $ bw\n")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183483965-a6c2d076-4896-47ec-a314-fc6a574ad8de.png",alt:"Monthly box and whisker plot for Apple"})),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"2022 Aug 08, 12:47 /stocks/qa/ $ bw -y\n")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484096-73eadd0c-1618-4e95-a27b-79e81cd6afad.png",alt:"Yearly box and whisker plot for Apple"})),(0,i.kt)("p",null,"Pick ",(0,i.kt)("inlineCode",{parentName:"p"},"logret")," for rate of change to the returns of the asset:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"2022 Aug 08, 12:47 /stocks/qa/ $ pick logret\n\n2022 Aug 08, 12:51 /stocks/qa/ $ bw -y\n")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484172-5c001e9d-911c-44cd-848c-9ae5ec13dbc2.png",alt:"Yearly rate of change on returns from Apple"})),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"decompose")," shows a visual representation of trend and seasonality."),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484221-8e65e855-8a18-4bfd-8d49-b44ad50691b1.png",alt:"Additive Decompose of daily $AAPL data"})),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"skew")," shows the asymmetric distribution over a specified window (default of 14)."),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484305-0ca714c4-a138-4c69-aee4-16fcc3aa3ac4.png",alt:"Apple skewness indicator"})),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"skew -w 5")," Changing the window to five takes out some of the smoothness:"),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484465-5c121ebc-d2d9-4f1d-a51f-10366aa4456a.png",alt:"Apple skewness indicator with a window of 5 days"})),(0,i.kt)("p",null,"Sharpe Ratio over time, ",(0,i.kt)("inlineCode",{parentName:"p"},"sh"),":"),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484549-6bc723e3-42cc-4c2a-96d6-72ab96402833.png",alt:"Sharpe Ratio for Apple over time"})),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"cdf")," calls the cumulative distribution function. Apple over the long term\nexhibits a steep curve."),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484623-00e6ce46-4378-4391-94e3-9ea2045d2fb4.png",alt:"Cumulative Distribution Function of Apple"})),(0,i.kt)("p",null,"Compared with Apple, Amazon is a more gently sloping s-curve."),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/85772166/183484706-86874eb7-d454-4d38-aa78-d521fa56b1bd.png",alt:"Cumulative Distribution Function of AMZN"})),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"capm")," shows the stock's risk against the market's. $AAPL carries the risk of\nwhatever happens to the markets, happens to the stock."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"2022 Aug 08, 13:51 /stocks/qa/ $ capm Beta: 1.15 Systematic Risk: 46.40%\nUnsystematic Risk: 53.60%\n")))}u.isMDXComponent=!0}}]); |