{"id":12869,"date":"2023-07-04T14:00:00","date_gmt":"2023-07-04T06:00:00","guid":{"rendered":"https:\/\/www.tejwin.com\/?post_type=insight&#038;p=12869"},"modified":"2026-04-10T14:41:27","modified_gmt":"2026-04-10T06:41:27","slug":"options-pricing-with-monte-carlo-simulation","status":"publish","type":"insight","link":"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/","title":{"rendered":"Options Pricing with Monte Carlo Simulation"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-full caption-align-center is-style-default\"><img fetchpriority=\"high\" decoding=\"async\" width=\"4608\" height=\"2304\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash.jpg\" alt=\"Options Pricing with Monte Carlo Simulation\" class=\"wp-image-11832\" title=\"\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash.jpg 4608w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-300x150.jpg 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-1024x512.jpg 1024w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-150x75.jpg 150w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-768x384.jpg 768w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-1536x768.jpg 1536w, https:\/\/www.tejwin.com\/wp-content\/uploads\/rishi-jhajharia-1CkSNmbT7J0-unsplash-2048x1024.jpg 2048w\" sizes=\"(max-width: 4608px) 100vw, 4608px\" \/><figcaption class=\"wp-element-caption\">Photo by <a class=\"ek-link\" href=\"https:\/\/unsplash.com\/@rishi_1?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener\">Rishi Jhajharia<\/a> on <a class=\"ek-link\" href=\"https:\/\/unsplash.com\/photos\/1CkSNmbT7J0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener\">Unsplash<\/a> <\/figcaption><\/figure>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69d8c7343a5e9\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69d8c7343a5e9\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#key_takeaways\" >key takeaways!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Highlight\" >Highlight<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Preface\" >Preface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Programming_environment_and_Module_required\" >Programming environment and Module&nbsp;required<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Database\" >Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Import_data\" >Import data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Data_processing\" >Data processing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Stock_price_prediction\" >Stock price prediction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Options_pricing\" >Options pricing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Antithetic_variate_method\" >Antithetic variate&nbsp;method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Practical_example\" >Practical example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.tejwin.com\/en\/insight\/options-pricing-with-monte-carlo-simulation\/#Extended_reading\" >Extended reading<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"key_takeaways\"><\/span><span style=\"color: #333333;\"><strong>key takeaways!<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><span style=\"color: #3366ff;\"><b data-path-to-node=\"6,0,0\" data-index-in-node=\"3\">The Reality Gap<\/b>:<\/span> Standard theoretical prices often drift away from the market. Our tests prove that reality rarely aligns with static formulas.<\/li>\n<li><span style=\"color: #3366ff;\"><strong>Find the Truth with Python<\/strong>:<\/span> Simulate 10,000 paths and use <strong>smart fixes<\/strong> to get prices much more accurate than standard formulas.<\/li>\n<li><span style=\"color: #3366ff;\"><strong>Real Market Backtest at the End<\/strong>:<\/span> Which code snippets help you avoid overpricing? The <strong>key Code<\/strong> is revealed at the end.<\/li>\n<\/ol>\n<p><!-- notionvc: 53e0a428-f371-453f-82ec-55e02949c307 --><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Highlight\"><\/span>Highlight<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Difficulty\uff1a\u2605\u2605\u2605\u2605\u2606<\/li>\n\n\n\n<li>Price options via Monte Carlo simulation<\/li>\n\n\n\n<li>Introduce variance reduction technique for enhancing princing result<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Preface\"><\/span>Preface<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Monte Carlo simulation has been widely adopted in the field of financial research. In <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><a href=\"https:\/\/medium.com\/tej-api-financial-data-anlaysis\/quant-19-prediction-of-portfolio-performance-71d7dc01983a\" target=\"_blank\" rel=\"noreferrer noopener\">\u3010Quant(19)\u3011Prediction of Portfolio Performance<\/a>,<\/mark><\/strong> we have introduced how to use Monte Carlo simulation for stock price prediction. In today`s article, we will extend the application to more complex options pricing. In <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong><a href=\"https:\/\/medium.com\/tej-api-financial-data-anlaysis\/quant-crr-model-a8dadf1f88f6\" target=\"_blank\" rel=\"noreferrer noopener\">\u3010Quant\u3011CRR Model<\/a> <\/strong><\/mark>and <a href=\"https:\/\/medium.com\/tej-api-financial-data-anlaysis\/quant-black-scholes-model-and-greeks-f00dc82bcb81\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u3010Quant\u3011Black Scholes model and Greeks<\/mark><\/strong><\/a>, we respectively used the principles of binomial trees and the Black-Scholes formula to calculate theoretical prices of options. These articles also explained many fundamental concepts related to options. For those who have a limited understanding of options, it is recommended to read these two articles first before continuing with the current one. In the subsequent sections, we will demonstrate how to use Monte Carlo simulation to predict stock prices. We will then extend the discussion to pricing European options and finally introduce some variance reduction techniques to assist us in using Monte Carlo simulation.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-background has-medium-font-size has-custom-font-size wp-element-button\" href=\"https:\/\/www.tejwin.com\/en\/insight\/three-major-institutional-investors-position-based-trading-strategy-for-taiex-futures\/\" style=\"padding-top:15px;padding-right:15px;padding-bottom:15px;padding-left:15px\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u2728<strong>Signal Enhancement: Applying Absolute Thresholds to Institutional Positions<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Programming_environment_and_Module_required\"><\/span>Programming environment and Module&nbsp;required<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Windows 11 and Jupyter Notebook is used as editor<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Import required packages\nimport math\nimport pandas as pd\nimport numpy as np \nimport matplotlib.pyplot as plt \nimport seaborn as sns\nfrom scipy.stats import norm\nimport time\nimport tejapi\nplt.style.use('bmh')\n\n# Log in TEJ API\napi_key = 'YOUR_KEY'\ntejapi.ApiConfig.api_key = api_key\ntejapi.ApiConfig.ignoretz = True<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Database\"><\/span>Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Stock trading database: Unadjusted daily stock price, database code is (TWN\/APRCD).<br>Derivatives database: Options daily transaction information, database code is (TWN\/AOPTION).<\/p>\n\n\n\n<p>Before running simulations, however, practitioners must collect <strong>accurate and high-frequency market data<\/strong> to serve as input for these models. Whether you&#8217;re modeling volatility, interest rate changes, or stock price movements, <strong>reliable historical data is the foundation of any sound pricing strategy<\/strong>.<br>If you&#8217;re looking to apply option pricing techniques in practice, start with<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"> <a href=\"https:\/\/www.tejwin.com\/en\/solution\/market-data\/\" data-type=\"link\" data-id=\"https:\/\/www.tejwin.com\/en\/solution\/market-data\/\">TEJ Market Data<\/a><\/mark><\/strong>\u2014a comprehensive solution for time-series stock prices, implied volatility, and benchmark interest rates that are essential for simulation-based pricing.<\/p>\n\n\n\n<p class=\"has-text-align-left has-medium-font-size\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Import_data\"><\/span>Import data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Using the unadjusted closing prices of the Taiwan Weighted Stock Index (Y9999) within the time period from January 31, 2021, to April 19, 2023. We will also load the Taiwan Weighted Index call and put options (TXO202304C15500, TXO202304P15500). These options are European-style options, with a start trading date of January 31 and an expiration date of April 19. The strike price is set at 15,500. Furthermore, we will set the \u201cmdate\u201d (date) column as the index.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Import required data\ngte, lte = '2021-03-16', '2023-04-20'\nstocks = tejapi.get('TWN\/APRCD', # stock price\n                   paginate = True,\n                   coid = 'Y9999',\n                   mdate = {'gte':gte, 'lte':lte},\n                   opts = {\n                       'columns':&#91; 'mdate','close_d']\n                   }\n                  )\n# Get options price\nputs = tejapi.get( # puts price\n    'TWN\/AOPTION',\n    paginate = True,\n    coid = 'TXO202304P15500',\n    mdate = {'gte':gte, 'lte':lte},\n    opts = {\n        'columns':&#91;'mdate', 'coid','settle', 'kk', 'theoremp', 'acls', 'ex_price', 'td1y', 'avolt', 'rtime']\n    }\n)\ncalls = tejapi.get( # calls price\n    'TWN\/AOPTION',\n    paginate = True,\n    coid = 'TXO202304C15500',\n    mdate = {'gte':gte, 'lte':lte},\n    opts = {\n        'columns':&#91;'mdate', 'coid','settle', 'kk', 'theoremp', 'acls', 'ex_price', 'td1y', 'avolt', 'rtime']\n    }\n)\n<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Data_processing\"><\/span>Data processing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Calculating daily return and moving volatility, set 252 days as the window.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Calculate daily return  \nstocks&#91;'daily return'] = np.log(stocks&#91;'close_d']) - np.log(stocks&#91;'close_d'].shift(1))\nstocks&#91;'moving volatility'] = stocks&#91;'daily return'].rolling(252).std()<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Stock_price_prediction\"><\/span>Stock price prediction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We utilize Monte Carlo simulation to simulate stock price paths. The concept of Monte Carlo simulation is quite simple. It involves obtaining the return process of the asset and discretizing it, then using small time intervals to calculate the changes in asset prices. For example, considering stock prices, their returns follow a Geometric Brownian motion. Thus, we can obtain a discretized stochastic differential equation (Equation 1), where Wt represents a Wiener process. After applying It\u00f4\u2019s formula, we obtain Equation 2 as the main equation for Monte Carlo simulation to predict stock prices, where Zt follows a standard normal distribution.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"155\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/\/Screenshot-2023-06-21-130819-1024x155.png\" alt=\"formula(1)\" class=\"wp-image-11924\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-130819-1024x155.png 1024w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-130819-300x45.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-130819-150x23.png 150w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-130819-768x116.png 768w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-130819.png 1046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, we can use Python to program the above equation. The essence of the Monte Carlo method lies in simultaneously estimating multiple stock price paths using Equation 2. Finally, by summing and averaging the last stock price of each path, we obtain the predicted stock price. Here, we define the following variables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>S0: Asset price at initial date<\/li>\n\n\n\n<li>r: Asset`s historical return<\/li>\n\n\n\n<li>sigma: Asset`s standard deviation of historical return<\/li>\n\n\n\n<li>T: Time to maturity<\/li>\n\n\n\n<li>Nsteps: Numbers of time interval<\/li>\n\n\n\n<li>Nrep: Numbers of stock path<\/li>\n<\/ul>\n\n\n\n<p>We codify the above equation into \u201cmc_asset\u201d function for executing Monte Carlo simulation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def mc_asset(S0, r, sigma, T, Nsteps, Nrep):\n    SPATH = np.zeros((Nrep, 1 + Nsteps))\n    SPATH&#91;:, 0] = S0\n    dt = T \/ Nsteps\n    nudt = (r - 0.5 * sigma **2) * dt\n    sidt = sigma * np.sqrt(dt)\n    \n    for i in range(0,Nrep):\n        for j in range(0,Nsteps):\n            SPATH&#91;i,j+1] = SPATH&#91;i,j] * np.exp(nudt + sidt * np.random.normal())\n    return SPATH<\/code><\/code><\/pre>\n\n\n\n<p>After setting up the function, we can set the arguments to testify whether the function can work or not. The result can be visualized as figure 1. Each line in figure 1 represents a stock simulation path.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>S0 = 100\nK = 110\nCallOrPut = 'call'\nr = 0.03\nsigma = 0.25\nT = 0.5\nNsteps = 10000\nNrep = 1000\nSPATH = mc_asset(S0, r, sigma, T, Nsteps, Nrep)\n\nplt.figure(figsize = (10,8))\nfor i in range(len(SPATH)):\n    plt.plot(SPATH&#91;i])\nplt.xlabel('Numbers of steps')\nplt.ylabel('Stock price')\nplt.title('Monte Carlo Simulation for Stock Price')\nplt.show()<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized caption-align-center\"><img decoding=\"async\" width=\"1000\" height=\"800\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/monte-carlo-for-stock-price.png\" alt=\"figure 1: Monte Carlo Simulation for Stock Price\" class=\"wp-image-11934\" style=\"width:833px;height:666px\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/monte-carlo-for-stock-price.png 1000w, https:\/\/www.tejwin.com\/wp-content\/uploads\/monte-carlo-for-stock-price-300x240.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/monte-carlo-for-stock-price-150x120.png 150w, https:\/\/www.tejwin.com\/wp-content\/uploads\/monte-carlo-for-stock-price-768x614.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">figure 1: Monte Carlo Simulation for Stock Price<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Options_pricing\"><\/span>Options pricing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We can use the aforementioned method to predict the stock price at options expiration. Then, we calculate the intrinsic value of the option at expiration for each path. Finally, by discounting the intrinsic value back to present value and taking the average, we can obtain the theoretical option price. Please refer to the specific code below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def mc_options(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep):\n    SPATH = mc_asset(S0, r, sigma, T, Nsteps, Nrep)\n    if CallOrPut == 'call':\n        payoffs = np.maximum(SPATH&#91;:,-1] - K, 0)\n        return np.mean(payoffs)*np.exp(-r*T)\n    else:\n        payoffs = np.maximum(K - SPATH&#91;:,-1], 0)\n        return np.mean(payoffs)<strong>np.exp(-r<\/strong>T)<\/code><\/code><\/pre>\n\n\n\n<p>We can choose to calculate the price of call or put by simply modifying the argument of \u201cCallOrPut\u201d. Further, we provide all arguments appropriate value for verification. Moreover, we compare the result with the theoretical price calculated from <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong><a class=\"ek-link\" href=\"https:\/\/medium.com\/tej-api-financial-data-anlaysis\/quant-black-scholes-model-and-greeks-f00dc82bcb81\" target=\"_blank\" rel=\"noreferrer noopener\">Black Scholes model and Greeks<\/a>.&nbsp;<\/strong><\/mark><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>S0 = 100\nK = 110\nCallOrPut = 'put'\nr = 0.03\nsigma = 0.25\nT = 0.5\nNsteps = 10000\nNrep = 1000\np_ = mc_options(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep)\nmybs = BS_formula(S0, K, r, sigma, T)\nc, p = mybs.BS_price()\n\nprint(f'Monte Carlo price: {c_}')\nprint(f'Black Scholes price: {p}')<\/code><\/code><\/pre>\n\n\n\n<p>Results are displayed down below in figure 2. As you can see, there is little difference between the price of Monte Carlo simulation and Black-Scholes formula.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"63\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-135312.png\" alt=\"figure 2: Comparison between the price of MC and BS\" class=\"wp-image-11938\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-135312.png 461w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-135312-300x41.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-135312-150x20.png 150w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><figcaption class=\"wp-element-caption\">figure 2: Comparison between the price of MC and BS<\/figcaption><\/figure>\n\n\n<div style=\"border: 1px black; border-style: solid none; text-align: center; border-color: #296580; padding: 24px; margin-top: 24px; margin-bottom: 24px;\">\n<p style=\"margin: 0px; font-size: 24px; font-weight: bold; line-height: 1.5;\">Start Predict Market Pricing with High-Quality Investment Database by TEJ!<\/p>\n<div style=\"margin-top: 32px;\"><strong><a style=\"border: none; border-radius: 4px; background-color: #296580; color: white; font-size: 20px; width: fit-content; text-decoration: none; padding: 12px 30px 12px 30px;\" href=\"https:\/\/www.tejwin.com\/en\/solution\/market-data\/\">TEJ Databank Solutions<\/a><\/strong><\/div>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Antithetic_variate_method\"><\/span>Antithetic variate&nbsp;method<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Due to the nature of Monte Carlo simulation in option pricing, which involves generating a large number of theoretical prices and taking the average, there is a potential issue with higher volatility in the simulated prices. This means that the simulated prices may exhibit extreme values, leading to a deviation in the simulation results. To address this problem, we can employ the Antithetic Variate method to reduce volatility.<\/p>\n\n\n\n<p>The concept behind this method is to generate a price path for the underlying asset (Equation 3) and simultaneously generate a path with opposite returns (Equation 4). In this case, the correlation between the two paths is -1, resulting in the minimum covariance when combining the two paths. This, in turn, reduces the volatility in estimating the option price.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"257\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-140849.png\" alt=\"formula(2)\" class=\"wp-image-11941\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-140849.png 670w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-140849-300x115.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-140849-150x58.png 150w\" sizes=\"(max-width: 670px) 100vw, 670px\" \/><\/figure>\n\n\n\n<p>The specific code implementation is as follows. We generate two matrices for calculation: SPATH1 represents the forward path, while SPATH2 represents the path in the opposite direction. It can be observed that in each iteration when generating random numbers (epsilon), both matrices share the same random numbers. As a result, the computational effort is reduced, and the volatility in predicting option prices is decreased.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def mc_options_AV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep):\n\n    SPATH1 = np.zeros((int(Nrep\/2), 1 + Nsteps))\n    SPATH2 = np.zeros((int(Nrep\/2), 1 + Nsteps))\n    SPATH1&#91;:, 0], SPATH2&#91;:, 0] = S0, S0\n    dt = T \/ Nsteps\n    nudt = (r - 0.5 * sigma **2) * dt\n    sidt = sigma * np.sqrt(dt)\n    \n    for i in range(0,int(Nrep\/2)):\n        for j in range(0,Nsteps):\n            epsilon = np.random.normal()\n            SPATH1&#91;i,j+1] = SPATH1&#91;i,j] * np.exp(nudt + sidt * epsilon)\n            SPATH2&#91;i,j+1] = SPATH2&#91;i,j] * np.exp(nudt - sidt * epsilon)\n            \n    if CallOrPut == 'call':\n        C1 = np.maximum(SPATH1&#91;:, -1] - K, 0)\n        C2 = np.maximum(SPATH2&#91;:, -1] - K, 0)\n        C = np.mean(0.5 * (C1 + C2))\n        C0 = np.exp(-r*T) * C\n        return C0\n    else: \n        P1 = np.maximum(K - SPATH1&#91;:, -1], 0)\n        P2 = np.maximum(K - SPATH2&#91;:, -1], 0)\n        P = np.mean(0.5 * (P1 + P2))\n        P0 = np.exp(-r*T) * P\n        return P0<\/code><\/code><\/pre>\n\n\n\n<p>Next, we input the values and verify whether the option prices obtained using the Antithetic Variate method are consistent with the results from the regular Monte Carlo simulation. The results can be seen in Figure 3, and it can be observed that they are indeed very close to each other.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>CallOrPut = 'put'\nK = 110\nS0 = 100\nr = 0.03\nsigma = 0.25\nT = 0.5\nNrep = 10000\nNsteps = 1000\nprint('Price under AV: ', mc_options_AV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep))\nprint('Price under MC: ', mc_options(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep))<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized caption-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"426\" height=\"62\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-142311.png\" alt=\"figure 3: Comparison between AV and MC\" class=\"wp-image-11943\" style=\"width:426px;height:62px\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-142311.png 426w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-142311-300x44.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-142311-150x22.png 150w\" sizes=\"(max-width: 426px) 100vw, 426px\" \/><figcaption class=\"wp-element-caption\">figure 3: Comparison between AV and MC<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Control variate&nbsp;method<\/h4>\n\n\n\n<p>In addition to the Antithetic Variate method, we can also reduce the volatility of option theoretical prices using the Control Variate method. Suppose we have two random variables, X and Y, where calculating the mean and variance of variable Y is straightforward. Let\u2019s assume that these two variables can be combined to form a new variable, Z (Equation 5). In this case, the expected value of Z is the same as the expected value of X (as shown in Equation 6), while the variance is determined by the parameter c. Therefore, we can find an optimal value for c* that minimizes the variance of Z, as shown in Equation 7. We consider X and Y as the option and underlying stock prices for each path. By using the covariance between historical option and stock prices and the variance of stock prices, we can calculate the optimal c* and then compute the option theoretical price (E(Z)) using Equation 5. This allows us to achieve the goal of reducing the volatility in Monte Carlo simulations.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"177\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-163757.png\" alt=\"formula(3)\" class=\"wp-image-11947\" style=\"width:834px;height:177px\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-163757.png 834w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-163757-300x64.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-163757-150x32.png 150w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-163757-768x163.png 768w\" sizes=\"(max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<p>The programming result is shown as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CallOrPut: Choose between call and put<\/li>\n\n\n\n<li>K: Strike price<\/li>\n\n\n\n<li>S0: Asset price at initial time point<\/li>\n\n\n\n<li>r: Asset`s historical return<\/li>\n\n\n\n<li>sigma: Asset`s standard deviation of historical return<\/li>\n\n\n\n<li>T: Time to maturity<\/li>\n\n\n\n<li>Nsteps: Numbers of time interval<\/li>\n\n\n\n<li>Nrep: Numbers of stock path<\/li>\n\n\n\n<li>Npilot: Time period for obtaining optimal c*<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def mc_options_CV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep, Npilot):\n    \n    # Calculate covariance between stock and options price\n    SPATH = np.zeros((Npilot, 1 + Nsteps))\n    SPATH&#91;:, 0] = S0\n    dt = T \/ Nsteps\n    nudt = (r - 0.5 * sigma **2) * dt\n    sidt = sigma * np.sqrt(dt)\n    \n    for i in range(0,Npilot):\n        for j in range(0,Nsteps):\n            SPATH&#91;i,j+1] = SPATH&#91;i,j] * np.exp(nudt + sidt * np.random.normal())\n    Sn = SPATH&#91;:, -1] \n    if CallOrPut == 'call':\n        Cn = np.maximum(SPATH&#91;:,-1] - K, 0) * np.exp(-r*T)\n        MatCov = np.cov(Sn, Cn)&#91;0,1]\n        VarY = S0 ** 2 * np.exp(2 * r * T) * (np.exp(T * sigma ** 2) - 1)\n        c = -MatCov \/ VarY\n        ExpY = S0 * np.exp(r*T)\n    else:\n        Pn = np.maximum(K - SPATH&#91;:,-1], 0) * np.exp(-r*T)\n        MatCov = np.cov(Sn, Pn)&#91;0,1]\n        VarY = S0 ** 2 * np.exp(2 * r * T) * (np.exp(T * sigma ** 2) - 1)\n        c = -MatCov \/ VarY\n        ExpY = S0 * np.exp(r*T)\n\n    \n    # Applying control variate function with optimal c*\n    SPATH2 = np.zeros((Nrep, 1 + Nsteps))\n    SPATH2&#91;:, 0] =S0\n    dt = T \/ Nsteps\n    nudt = (r - 0.5 * sigma **2) * dt\n    sidt = sigma * np.sqrt(dt)\n    \n    for i in range(0,Nrep):\n        for j in range(0,Nsteps):\n            SPATH2&#91;i,j+1] = SPATH2&#91;i,j] * np.exp(nudt + sidt * np.random.normal())\n    S = SPATH2&#91;:, -1] \n    if CallOrPut == 'call':\n        C = np.maximum(SPATH2&#91;:,-1] - K, 0) * np.exp(-r*T)\n        CVC = np.mean(C + c * (S - ExpY))\n        return CVC\n    else:\n        P = np.maximum(K - SPATH2&#91;:,-1], 0) * np.exp(-r*T)\n        CVP = np.mean(P + c * (S - ExpY))\n        return CVP<\/code><\/code><\/pre>\n\n\n\n<p>By inputting numbers into arguments, we testify the difference between options price from Antithetic Variate and Control Variate method. The result is shown in figure 4. We can say they are identical.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>CallOrPut = 'put'\nK = 110\nS0 = 100\nr = 0.03\nsigma = 0.25\nT = 0.5\nNrep = 5000\nNsteps = 1000\nNpilot= 5000\n\nprint('Price under AV: ', mc_options_AV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep))\nprint('Price under CV: ', mc_options_CV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep, Npilot))<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"56\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-164827.png\" alt=\"figure 4: Comparison between AV and CV\" class=\"wp-image-11949\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-164827.png 427w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-164827-300x39.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-164827-150x20.png 150w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><figcaption class=\"wp-element-caption\">figure 4: Comparison between AV and CV<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_example\"><\/span>Practical example<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In summary, we have learned three methods for calculating option theoretical prices using Monte Carlo simulation: the conventional method, the Antithetic Variate method, and the Control Variate method. Next, we will introduce real-life examples to compare the theoretical prices obtained from each method with the Black-Scholes prices calculated by TEJ, to see if there are significant differences between them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>S0 = stocks.loc&#91;'2023-01-31']&#91;'close_d']\nK = 15500 \nr = stocks&#91;'daily return'].rolling(252).mean().loc&#91;'2023-01-31'] # average return of stock\nT = 51 \/ 252\nsigma = stocks.loc&#91;'2023-01-31']&#91;'moving volatility'] * np.sqrt(252)\nNstep = 50000 \nNrep = 50000\nNpilot = 5000\nCallOrPut = 'put'\n\nprint('Monte Carlo theoretical price: ', mc_options(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep))\nprint('Monte Carlo with AV theoretical price: ', mc_options_AV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep))\nprint('Monte Carlo with CV theoretical price: ', mc_options_CV(CallOrPut, K, S0, r, sigma, T, Nsteps, Nrep, Npilot))\nprint('TEJ Black Scholes price: ', puts.loc&#91;'2023-01-31']&#91;'theoremp'])\nprint('Real price: ', puts.loc&#91;'2023-01-31']&#91;'settle'])<\/code><\/code><\/pre>\n\n\n\n<p>We use a Taiwan Stock Exchange put with a strike price of 15,500 and a time period from January 1, 2023, to April 19, 2023. Sigma is calculated as the standard deviation of Taiwan Stock Exchange returns with a window of 252 days, and r is the average return over the past 252 days. We assume today is January 31, 2023. The results are shown in figure 5, where we can observe that <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">the prices obtained using the three methods are closer to the actual prices<\/mark><\/strong> compared to TEJ\u2019s calculated prices.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"129\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-173001.png\" alt=\"figure 5: Comparison for all method and TEJ BS price\" class=\"wp-image-11951\" srcset=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-173001.png 694w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-173001-300x56.png 300w, https:\/\/www.tejwin.com\/wp-content\/uploads\/Screenshot-2023-06-21-173001-150x28.png 150w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><figcaption class=\"wp-element-caption\">figure 5: Comparison for all method and TEJ BS price<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Monte Carlo pricing method relies more on the law of large numbers compared to the CRR model and Black-Scholes model. It gradually approximates reasonable theoretical prices by simulating a large number of stock price paths. In today\u2019s era of significant advancements in computer performance, data-driven algorithms and pricing models are expected to become increasingly prevalent. When engaging in options trading, investors may also consider incorporating the Monte Carlo method into their considerations. However, the accuracy of any simulation model depends on the quality of its inputs. Reliable, high-frequency <a href=\"https:\/\/www.tejwin.com\/en\/databank-solution\/market-data\/\" data-type=\"link\" data-id=\"https:\/\/www.tejwin.com\/en\/databank-solution\/market-data\/\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>market data<\/strong><\/mark><\/a> is essential not only for generating realistic price paths and making informed assumptions, but also for backtesting, scenario analysis, and risk assessment. <\/p>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link has-background has-custom-font-size wp-element-button\" href=\"https:\/\/www.tejwin.com\/en\/solution\/market-data\/\" style=\"border-radius:19px;background:linear-gradient(135deg,rgb(158,217,217) 0%,rgb(6,70,149) 100%);font-size:20px\"><strong>Predict Market Pricing with thorough data and investment model!<br><strong>Get Started with TEJ Database Now<\/strong>!<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extended_reading\"><\/span>Extended reading<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-tej wp-block-embed-tej\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"TuFnX63LO0\"><a href=\"https:\/\/www.tejwin.com\/en\/insight\/what-is-market-data\/\">What is Market Data: Meaning, Types, Examples, Pros, &amp; Cons<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;What is Market Data: Meaning, Types, Examples, Pros, &amp; Cons&#8221; &#8212; TEJ\" src=\"https:\/\/www.tejwin.com\/en\/insight\/what-is-market-data\/embed\/#?secret=Jx8hvBvErg#?secret=TuFnX63LO0\" data-secret=\"TuFnX63LO0\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-tej wp-block-embed-tej\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"xYuyxkhilx\"><a href=\"https:\/\/www.tejwin.com\/insight\/black-scholes-%e6%a8%a1%e5%9e%8b%e8%88%87-greeks\/\">Black-Scholes \u6a21\u578b\u8207 Greeks<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Black-Scholes \u6a21\u578b\u8207 Greeks&#8221; &#8212; TEJ\" src=\"https:\/\/www.tejwin.com\/insight\/black-scholes-%e6%a8%a1%e5%9e%8b%e8%88%87-greeks\/embed\/#?secret=UvbZQ5por0#?secret=xYuyxkhilx\" data-secret=\"xYuyxkhilx\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>key takeaways! The Reality Gap: Standard theoretical prices often drift away from the market. Our tests prove that reality rarely aligns with static formulas. Find the Truth with Python: Simulate 10,000 paths and use smart fixes to get prices much more accurate than standard formulas. Real Market Backtest at the End: Which code snippets help [&hellip;]<\/p>\n","protected":false},"featured_media":11833,"template":"","tags":[2962,2987,3199],"insight-category":[690,50],"class_list":["post-12869","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-market-data","tag-quant","tag-tej-database","insight-category-data-analysis","insight-category-fintech"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/12869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/types\/insight"}],"version-history":[{"count":36,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/12869\/revisions"}],"predecessor-version":[{"id":44980,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/12869\/revisions\/44980"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media\/11833"}],"wp:attachment":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media?parent=12869"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/tags?post=12869"},{"taxonomy":"insight-category","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight-category?post=12869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}