{"id":832,"date":"2022-10-27T17:00:30","date_gmt":"2022-10-27T17:00:30","guid":{"rendered":"https:\/\/eodhd.com\/financial-academy\/?p=832"},"modified":"2025-02-05T13:49:32","modified_gmt":"2025-02-05T13:49:32","slug":"fibonacci-sequence-in-trading-with-python","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python","title":{"rendered":"Fibonacci Sequence in Trading with Python"},"content":{"rendered":"\n<p>Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs) data API<br>The Fibonacci sequence is fascinating and a very popular topic for writers, mathematicians, and the lik<\/p>\n\n\n\n<p class=\"bordered_paragraph\">If you want to learn how to install the <a href=\"https:\/\/github.com\/EodHistoricalData\/EODHD-APIs-Python-Financial-Library\">EODHD APIs Python Financial Official Library<\/a> and activate your API key, we recommend to start with exploring of our <a href=\"https:\/\/eodhistoricaldata.com\/financial-apis\/python-financial-libraries-and-code-samples\/#EODHD_APIs_Python_Financial_Library_by_Michael_Whittle\">Documentation for it<\/a>.<\/p>\n\n\n\n<p id=\"e1a2\">At a high level, it is a series of numbers in which each number (the Fibonacci numbers)<strong> <\/strong>are the sum of the two preceding numbers. The series starts with 1, 1, 2, 3, 5, 8, 13, 21, etc.<\/p>\n\n\n\n<p id=\"acfb\">As the numbers get larger, the quotient between each successive pair of Fibonacci numbers is very close to 1.618, or its inverse 0.618. This is most commonly referred to as the Golden Ratio.<\/p>\n\n\n\n<p id=\"5417\">The Golden Ratio very interestingly appears in some patterns in nature, including spiral arrangements of leaves, number of flower petals, the structure of tree branches, and other plant life. It is also used to analyse artificial systems such as financial markets, which is the main focus on this article.<\/p>\n\n\n\n<p id=\"5706\"><strong>Golden ratio in Fibonacci sequence:<\/strong> 8\/13 = 0.618 (61.8%), 21\/34 = 0.618 (61.8%), 34\/55 = 0.618 (61.8%), 55\/89 = 0.618 (61.8%), etc.<br><img decoding=\"async\" class=\"wp-image-837\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png\" alt=\"Golden-ratio-in-Fibonacci-sequence\"><\/p>\n\n\n\n<p id=\"ff4f\">Mathematicians started investigating other ratios which may be connected to the Fibonacci sequence.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-center\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Fibonacci Retracement and Extensions<\/strong> for Trading in Python<br><img decoding=\"async\" class=\"wp-image-838\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Fibonacci-Retracement-and-Extensions.png\" alt=\"Fibonacci Retracement and Extensions\"><\/h2>\n\n\n\n<p id=\"6228\">Fibonacci retracement measures the percentage of how much of a correction may happen after a price movement.<\/p>\n\n\n\n<p id=\"bc68\">The Fibonacci retracement levels are 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100% with extension levels at 138.2%, 161.8%, 200%, and 261.8%.<\/p>\n\n\n\n<p id=\"5c84\">If we take the Fibonacci sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89; and divide 55\/89 we get <strong>0.618<\/strong>, divide 34\/89 we get <strong>0.382<\/strong>, divide 21\/89 we get <strong>0.236<\/strong>, etc. The square root of 0.618 is <strong>0.786. <\/strong>While not officially a Fibonacci ratio, 50% is also used.<\/p>\n\n\n\n<p id=\"5a5b\">This indicator is useful because it can be drawn between any two significant price points, such as a high and a low in trading. On trading graphs they look like support and resistance levels.<\/p>\n\n\n\n<p id=\"4691\">Fibonacci extensions use similar percentages but for a different purpose. They are a way to predict a target price to sell or find potential areas of support or resistance when the price is moving into unchartered territory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"234b\">Calculating Fibonacci levels in Python for trading<\/h2>\n\n\n\n<p id=\"f244\">We\u2019re going to need to retrieve some trading data. I\u2019ll be using my trusty financial data API provider EODHD APIs, previously EOD Historical Data. I have a paid for account as I use it often but there is a free tier if you want to use that instead and follow along.<\/p>\n\n\n\n<p id=\"db8f\">I\u2019ll be using <a href=\"https:\/\/colab.research.google.com\/\" rel=\"noreferrer noopener\" target=\"_blank\">Google Colab<\/a> notebooks to demonstrate this. It\u2019s free and easy to use. It will allow you to run Python code snippets without having to install anything locally.<\/p>\n\n\n\n<p id=\"729c\">I use Python a lot for trading data analysis. I wrote an article previously to help those get set up. It has instructions on how to use <a href=\"https:\/\/colab.research.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Colab<\/a>, which we will be using here. If you want to do this locally on your desktop, it will work fine as well.<\/p>\n\n\n\n<p id=\"ccfb\"><strong>Let\u2019s start by retrieving some data to work with\u2026<\/strong><\/p>\n\n\n\n<p id=\"b724\">I\u2019m going to use the S&amp;P 500 (GSPC.INDC or ^GSPC) interday index using the EODHD API\u2019s Python library in <a href=\"https:\/\/colab.research.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Colab<\/a>. This index is amazing to trade but data providers never offer it for free. If you want to access this data <a href=\"https:\/\/eodhistoricaldata.com\/pricing?utm_source=medium&amp;utm_medium=post&amp;utm_campaign=fibonacci_sequence_in_trading\" target=\"_blank\" rel=\"noreferrer noopener\">you will need a subscription<\/a>. If you want to try it out for free <a href=\"https:\/\/eodhistoricaldata.com\/financial-apis\/intraday-historical-data-api\" target=\"_blank\" rel=\"noreferrer noopener\">they have a demo API key<\/a> which allows you to access Apple\u2019s stock data using the AAPL stock code.<br><img decoding=\"async\" class=\"wp-image-841\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/207-days-of-SP-500-data-stored-in-a-Pandas-dataframe.png\" alt=\"207 days of S&amp;P 500 data stored in a Pandas dataframe\"><\/p>\n\n\n\n<p>We now have 207 days of S&amp;P 500 data stored in a Pandas dataframe called \u201cdf\u201d. We can now graph it like this.<br><img decoding=\"async\" class=\"wp-image-842\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/207-days-of-SP-500-data-stored-in-a-Pandas-plot.png\" alt=\"207 days of S&amp;P 500 data stored in a Pandas plot\"><\/p>\n\n\n\n<p id=\"66d6\">In order to perform our Fibonacci retracement calculations, we\u2019re going to need the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The highest price in the focus range<\/li>\n\n\n\n<li>The lowest price in the focus range<\/li>\n\n\n\n<li>If the market is in an uptrend or downtrend<\/li>\n<\/ul>\n\n\n\n<p id=\"aad9\">To get the high and low is easy\u2026<br><img decoding=\"async\" class=\"wp-image-843\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/207-days-of-SP-500-data-stored-in-a-Pandas-high-and-low.png\" alt=\"207 days of S&amp;P 500 data stored in a Pandas high and low\"><\/p>\n\n\n\n<p>The S&amp;P 500 currently visually looks like it\u2019s in a downtrend. If you want to be sure you can do something like this.<br><img decoding=\"async\" class=\"wp-image-844\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/207-days-of-SP-500-data-stored-in-a-Pandas-SMA50-and-SMA200.png\" alt=\"207 days of S&amp;P 500 data stored in a Pandas SMA50 and SMA200\"><\/p>\n\n\n\n<p>I\u2019ve added two simple moving averages to our dataset, SMA50 and SMA200. The SMA50 is the 50-day rolling average and the SMA200 is the 200-day rolling average. The SMA50 is currently below the SMA200 on the 21st of October 2022, which is indicating a long term downtrend.<\/p>\n\n\n\n<p>The question we are trying to answer now is how far this downtrend will go and potential places it may improve. This is where Fibonacci retracement levels can be really useful for Trading in Python.<\/p>\n\n\n\n<p>The calculations are as follows:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">Uptrend Retracement = High - ((High - Low) * Percentage)\n\nUptrend Extension = High + ((High - Low) * Percentage)\n\n<strong>Downtrend Retracement = Low + ((High - Low) * Percentage)<\/strong>\n\nDowntrend Extension = Low -((High - Low) * Percentage)<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>We will be using the \u201cDowntrend Retracement\u201d formula.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\"><strong>Low + ((High - Low) * Percentage)<\/strong>\n23.6% = 3577.03 + ((4796.5601 - 3577.03) * 0.236)\n23.6% = 3577.03 + (1219.5301 * 0.236)\n23.6% = 3577.03 + (1219.5301 * 0.236)\n23.6% = 3577.03 + 287.8091036\n23.6% = 3864.8391036<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>We then repeat this process with the other Fibonacci percentages. To do this programmatically we can do this.<br><img decoding=\"async\" class=\"wp-image-845\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Fibonacci-percentages.png\" alt=\"Fibonacci percentages\"><\/p>\n\n\n\n<p>For your convenience, here is the <a href=\"https:\/\/colab.research.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Colab<\/a> code.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">Low = df[\"adjusted_close\"].min()\nHigh = df[\"adjusted_close\"].max()\n\nDiff = High - LowFib100 = High\nFib764 = Low + (Diff * 0.764)\nFib618 = Low + (Diff * 0.618)\nFib50 = Low + (Diff * 0.5)\nFib382 = Low + (Diff * 0.382)\nFib236 = Low + (Diff * 0.236)\n\nFib0 = LowFib100, Fib764, Fib618, Fib50, Fib382, Fib236, Low<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>And this is how we plot it in Matplotlib.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">plt.figure(figsize=(30,10))\nplt.plot(df[\"adjusted_close\"], color=\"black\", label=\"Price\")\nplt.axhline(y=Fib100, color=\"limegreen\", linestyle=\"-\", label=\"100%\")\nplt.axhline(y=Fib764, color=\"slateblue\", linestyle=\"-\", label=\"76.4%\")\nplt.axhline(y=Fib618, color=\"mediumvioletred\", linestyle=\"-\", label=\"61.8%\")\nplt.axhline(y=Fib50, color=\"gold\", linestyle=\"-\", label=\"50%\")\nplt.axhline(y=Fib236, color=\"darkturquoise\", linestyle=\"-\", label=\"23.6%\")\nplt.axhline(y=Fib0, color=\"lightcoral\", linestyle=\"-\", label=\"0%\")\n\nplt.ylabel(\"Price\")\nplt.xticks(rotation=90)\nplt.title(\"S&amp;P 500 (^GSPC) Daily\")\nplt.legend()\nplt.show()<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-849\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/207-days-of-SP-500-plot-it-in-Matplotlib.png\" alt=\"207-days-of-SP-500-plot-it-in-Matplotlib\"><\/p>\n\n\n\n<p>Fibonacci extensions would be calculated like this (for an uptrend).<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">Fib2618 = High + (Diff * 2.618)\nFib2000 = High + (Diff * 2)\nFib1618 = High + (Diff * 1.618)\nFib1382 = High + (Diff * 1.382)\nFib1000 = High + (Diff * 1)\nFib618 = High + (Diff * 0.618)<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>The Pandas dataframe is showing 207 days of data, but maybe we are only interested in data from mid-August. The Fibonacci retracement calculation only needs a high and low value. We can truncate our data as follows.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\"><strong>df_subset = df.tail(48)<\/strong>\n\nplt.figure(figsize=(30,10))\nplt.plot(<strong>df_subset<\/strong>[\"adjusted_close\"], color=\"black\", label=\"Price\")\nplt.ylabel(\"Price\")\nplt.xticks(rotation=90)\nplt.title(\"S&amp;P 500 (^GSPC) Daily\")\nplt.legend()\nplt.show()<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-850\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Pandas-dataframe-is-showing-207-days-of-data.png\" alt=\"Pandas dataframe is showing 207 days of data\"><\/p>\n\n\n\n<p>We will calculate our new levels like this.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">Low = <strong>df_subset<\/strong>[\"adjusted_close\"].min()\nHigh = <strong>df_subset<\/strong>[\"adjusted_close\"].max()\nDiff = High - Low\n\nFib100 = High\nFib764 = Low + (Diff * 0.764)\nFib618 = Low + (Diff * 0.618)\nFib50 = Low + (Diff * 0.5)\nFib382 = Low + (Diff * 0.382)\nFib236 = Low + (Diff * 0.236)\nFib0 = Low\n\nFib100, Fib764, Fib618, Fib50, Fib382, Fib236, Low<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>And plot our new data.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">plt.figure(figsize=(30,10))\nplt.plot(<strong>df_subset<\/strong>[\"adjusted_close\"], color=\"black\", label=\"Price\")\nplt.axhline(y=Fib100, color=\"limegreen\", linestyle=\"-\", label=\"100%\")\nplt.axhline(y=Fib764, color=\"slateblue\", linestyle=\"-\", label=\"76.4%\")\nplt.axhline(y=Fib618, color=\"mediumvioletred\", linestyle=\"-\", label=\"61.8%\")\nplt.axhline(y=Fib50, color=\"gold\", linestyle=\"-\", label=\"50%\")\nplt.axhline(y=Fib236, color=\"darkturquoise\", linestyle=\"-\", label=\"23.6%\")\nplt.axhline(y=Fib0, color=\"lightcoral\", linestyle=\"-\", label=\"0%\")\n\nplt.ylabel(\"Price\")\nplt.xticks(rotation=90)\nplt.title(\"S&amp;P 500 (^GSPC) Daily\")\nplt.legend()\nplt.show()<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-851\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Fibonacci-retracement-levels-form-a-sort-of-support-and-resistance.png\" alt=\"Fibonacci retracement levels form a sort of support and resistance\"><\/p>\n\n\n\n<p>As you can see the Fibonacci retracement levels form a sort of support and resistance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"b9b6\">EODHD API\u2019s Python Library<\/h2>\n\n\n\n<p class=\"bordered_paragraph\" id=\"3a89\">I pushed an update to the EODHD API\u2019s <a href=\"https:\/\/github.com\/EodHistoricalData\/EODHD-APIs-Python-Financial-Library\">Python library<\/a> to make this functionality easily available to everyone. It\u2019s available from version 1.0.8.<\/p>\n\n\n\n<p id=\"cc22\">Retrieve our data as before, or any data you like.<br><img decoding=\"async\" class=\"wp-image-852\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/EODHD-APIs-Python-library.png\" alt=\"EODHD API\u2019s Python library\"><\/p>\n\n\n\n<p id=\"d121\">Two important points to mention here:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>I used the <strong>-U<\/strong> argument for my PIP install to make sure that my current \u201c<strong>eodhd<\/strong>\u201d library upgrades to the latest version<\/li>\n\n\n\n<li>I confirmed the version I\u2019m using on Google Colab is 1.0.8<\/li>\n<\/ol>\n\n\n\n<p id=\"f6fe\">So now the new exciting part!<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">from eodhd import EODHDGraphs\ngraphs = EODHDGraphs()<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>We can how render all our graphs as follows\u2026.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">graphs.fibonacci_retracement(df, \"downtrend\", \"adjusted_close\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-853\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/graphs.fibonacci_retracement.png\" alt=\"graphs.fibonacci_retracement\"><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">graphs.fibonacci_retracement(df, \"uptrend\", \"adjusted_close\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-854\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/graphs-fibonacci-retracement-uptrend-adjusted-close.png\" alt=\"graphs fibonacci retracement uptrend adjusted close\"><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">graphs.fibonacci_extension(df, \"uptrend\", \"adjusted_close\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-855\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/graphs-fibonacci-extension-uptrend-adjusted-close.png\" alt=\"graphs fibonacci extension uptrend adjusted close\"><\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code lang=\"python\" class=\"language-python\">graphs.fibonacci_extension(df, \"downtrend\", \"adjusted_close\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p><img decoding=\"async\" class=\"wp-image-856\" style=\"width: 900px;\" src=\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/graphs-fibonacci-extension-downtrend-adjusted-close.png\" alt=\"graphs fibonacci extension downtrend adjusted close\"><\/p>\n\n\n\n<p id=\"d606\">By default, the graphs will display without saving the graph. I\u2019ve added two optional arguments to both functions.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>save_file=\u201dfibonacci.png\u201d<\/strong> \u2190 default is \u201c\u201d which doesn\u2019t save a file<\/li>\n\n\n\n<li><strong>quiet=True<\/strong> \u2190 default is False which displays the graph<\/li>\n<\/ul>\n\n\n\n<p id=\"5c62\">This is how you can save the graph without displaying it.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<p id=\"af43\">I hope you enjoyed this article. If you did, please consider following me for future articles and clapping for the article as that helps remunerates me for my efforts \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs) data APIThe Fibonacci sequence is fascinating and a very popular topic for writers, mathematicians, and the lik If you want to learn how to install the EODHD APIs Python Financial Official Library and activate your API key, we recommend [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[59],"tags":[],"coding-language":[30],"ready-to-go-solution":[56],"qualification":[32],"financial-apis-category":[36],"financial-apis-manuals":[39],"class_list":["post-832","post","type-post","status-publish","format-standard","hentry","category-technical-analysis-examples","coding-language-python","ready-to-go-solution-eodhd-python-financial-library","qualification-guru","financial-apis-category-stock-market-prices","financial-apis-manuals-end-of-day"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.9 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fibonacci Sequence in Trading with Python | EODHD APIs Academy<\/title>\n<meta name=\"description\" content=\"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fibonacci Sequence in Trading with Python\" \/>\n<meta property=\"og:description\" content=\"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\" \/>\n<meta property=\"og:site_name\" content=\"Financial Academy\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-27T17:00:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-05T13:49:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Fibonacci-extensions-and-retracements-in-Python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"799\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Michael Whittle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Whittle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\"},\"author\":{\"name\":\"Michael Whittle\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad\"},\"headline\":\"Fibonacci Sequence in Trading with Python\",\"datePublished\":\"2022-10-27T17:00:30+00:00\",\"dateModified\":\"2025-02-05T13:49:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\"},\"wordCount\":1045,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png\",\"articleSection\":[\"Technical Analysis Examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\",\"name\":\"Fibonacci Sequence in Trading with Python | EODHD APIs Academy\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png\",\"datePublished\":\"2022-10-27T17:00:30+00:00\",\"dateModified\":\"2025-02-05T13:49:32+00:00\",\"description\":\"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage\",\"url\":\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png\",\"contentUrl\":\"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-academy\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fibonacci Sequence in Trading with Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"name\":\"Financial APIs Academy | EODHD\",\"description\":\"Financial Stock Market Academy\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad\",\"name\":\"Michael Whittle\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g\",\"caption\":\"Michael Whittle\"},\"description\":\"Solution architect, developer, and analyst with over 20+ years experience (TOP author on Medium).\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/author\/michaelwhittle\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fibonacci Sequence in Trading with Python | EODHD APIs Academy","description":"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python","og_locale":"en_US","og_type":"article","og_title":"Fibonacci Sequence in Trading with Python","og_description":"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)","og_url":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python","og_site_name":"Financial Academy","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2022-10-27T17:00:30+00:00","article_modified_time":"2025-02-05T13:49:32+00:00","og_image":[{"width":799,"height":450,"url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Fibonacci-extensions-and-retracements-in-Python.png","type":"image\/png"}],"author":"Michael Whittle","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"Michael Whittle","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python"},"author":{"name":"Michael Whittle","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad"},"headline":"Fibonacci Sequence in Trading with Python","datePublished":"2022-10-27T17:00:30+00:00","dateModified":"2025-02-05T13:49:32+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python"},"wordCount":1045,"publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage"},"thumbnailUrl":"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png","articleSection":["Technical Analysis Examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python","url":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python","name":"Fibonacci Sequence in Trading with Python | EODHD APIs Academy","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/#website"},"primaryImageOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage"},"thumbnailUrl":"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png","datePublished":"2022-10-27T17:00:30+00:00","dateModified":"2025-02-05T13:49:32+00:00","description":"Fibonacci extensions and retracements in Python using financial trading data from EOD Historical Data (EODHD APIs)","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#primaryimage","url":"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png","contentUrl":"https:\/\/eodhistoricaldata.com\/financial-academy\/wp-content\/uploads\/2022\/10\/Golden-ratio-in-Fibonacci-sequence.png"},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-academy\/technical-analysis-examples\/fibonacci-sequence-in-trading-with-python#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-academy\/"},{"@type":"ListItem","position":2,"name":"Fibonacci Sequence in Trading with Python"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-academy\/#website","url":"https:\/\/eodhd.com\/financial-academy\/","name":"Financial APIs Academy | EODHD","description":"Financial Stock Market Academy","publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-academy\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-academy\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/50784c270b6267df5969514d80d510ad","name":"Michael Whittle","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5076af85c7ee0445454257247cad4970ae8cf5d7d4940d2b32c521f51c0a0f5a?s=96&d=mm&r=g","caption":"Michael Whittle"},"description":"Solution architect, developer, and analyst with over 20+ years experience (TOP author on Medium).","url":"https:\/\/eodhd.com\/financial-academy\/author\/michaelwhittle"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pdOdVT-dq","jetpack_sharing_enabled":true,"acf":[],"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/comments?post=832"}],"version-history":[{"count":3,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/832\/revisions"}],"predecessor-version":[{"id":6302,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/832\/revisions\/6302"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/media?parent=832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/categories?post=832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/tags?post=832"},{"taxonomy":"coding-language","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/coding-language?post=832"},{"taxonomy":"ready-to-go-solution","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/ready-to-go-solution?post=832"},{"taxonomy":"qualification","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/qualification?post=832"},{"taxonomy":"financial-apis-category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-category?post=832"},{"taxonomy":"financial-apis-manuals","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-manuals?post=832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}