<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Finance Platform sorted by active.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3238233" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2306254" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1292641" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2148941" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2112849" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2111409" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1857773" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1731427" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1263219" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/540228" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1008389" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/925032" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/495628" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/573427" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/506000" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/476154" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/474096" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/426798" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/408719" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/389388" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3238233">
    <title>Mathematica, Wolfram|One, and other products are now accessed via the new unified WOLFRAM app</title>
    <link>https://community.wolfram.com/groups/-/m/t/3238233</link>
    <description>[![Mathematica, Wolfram|One, and other products are now accessed via the new unified product WOLFRAM][3]][3]&#xD;
&#xD;
Starting with Version 14.1, Wolfram|One, Mathematica, Wolfram|Alpha Notebook Edition, and Finance Platform are all accessed through the new unified product, Wolfram. The Wolfram application was created to ensure a simplified installer for all supported products.&#xD;
&#xD;
Changes can be noticed, for example, in some installation interfaces (see images above) or file system paths (see details at the links below).&#xD;
&#xD;
The way you get a license for the products you already have and enjoy will remain the same, it&amp;#039;s just that the application that you run will now be Wolfram. It will still be activated with whatever product license(s) you had previously/get now. If you had multiple products, you&amp;#039;ll be able to activate them all with this one Wolfram product, and switch between them as needed via the Product Settings screen in the Preferences menu.&#xD;
&#xD;
 - For more information on the release itself, see Stephen Wolfram&amp;#039;s release announcement: https://wolfr.am/NewIn14.1&#xD;
&#xD;
 - For more information on installing Wolfram (which is very similar to how installing Mathematica was), see: https://reference.wolfram.com/language/tutorial/InstallingWolfram.html&#xD;
&#xD;
 - For more information on activating your individual product (which uses the same workflow we updated for 14.0), see: https://reference.wolfram.com/language/tutorial/ActivatingMathematica.html&#xD;
&#xD;
 - For more information on any additional things to be aware of from this change (including notes on Paclet migration and updates to certain environmental variables), see: https://reference.wolfram.com/language/tutorial/UpgradingFromMathematicaToWolfram.html&#xD;
&#xD;
 - For assistance with importing settings/paclets/etc from previous versions, see: https://resources.wolframcloud.com/FunctionRepository/resources/MigrateSettingsToWolframApp/&#xD;
&#xD;
 - For more information on how to switch between products in Wolfram, see: https://reference.wolfram.com/language/tutorial/UsingTheWolframProductSwitcher.html&#xD;
&#xD;
 - Additionally, we encourage you to visit our curated support articles: https://support.wolfram.com/topic/mathematica&#xD;
&#xD;
&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Wolfram_141.png&amp;amp;userId=20103</description>
    <dc:creator>EDITORIAL BOARD</dc:creator>
    <dc:date>2024-07-30T17:30:57Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2306254">
    <title>Free featured webinar: getting started with interactive reporting</title>
    <link>https://community.wolfram.com/groups/-/m/t/2306254</link>
    <description>Hi all! We have an upcoming special event coming up on Friday 30th July at 3pm. Join our Getting Started with Interactive Reporting webinar and we&amp;#039;ll show you how to create dynamic dashboards, visualisations, self-service apps and more all from scratch.&#xD;
&#xD;
Whether its social media analytics, sales information, manufacturing outputs or anything else that generates data, dashboards and interactive reports give you a real-time view of how your business is performing and provide you with the all the information you need to make smarter, data-driven decisions.&#xD;
&#xD;
You can register here: http://wolfr.am/WOCRqmJb&#xD;
&#xD;
Please email us at events-europe@wolfram.com for more details or if you have any questions.&#xD;
&#xD;
Thank you!</description>
    <dc:creator>Idowu Badmus</dc:creator>
    <dc:date>2021-07-07T09:07:16Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1292641">
    <title>Get APIs to trade stocks?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1292641</link>
    <description>Does Mathematica offer any APIs that can be used to submit and execute trades on stock market? If the core Mathematica product can&amp;#039;t do it, are there any packages enabling an execution of trading transactions from Mathematica? Thanks - Larry</description>
    <dc:creator>Larry Dubov</dc:creator>
    <dc:date>2018-02-26T23:51:46Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2148941">
    <title>Modelling cycles trough Fourier Analyss/Synthesis on financial time series</title>
    <link>https://community.wolfram.com/groups/-/m/t/2148941</link>
    <description>Hi everyone!&#xD;
&#xD;
I am trying to develop modeling in Mathematica that presuppose the use of Fourier analysis and synthesis applied to financial historical series (eg stocks, financial indices, currencies, and so on). So I wanted to ask you if anyone knows any textbooks, papers, or any other references on these topics for my purposes (even better if with examples of applications on Mathematica).&#xD;
&#xD;
The purpose of my research is to apply Fourier analysis and synthesis on financial time series (as already mentioned), in order to extrapolate from them the relative market cycles, both to be able to carry out appropriate analyzes and to be able to make forecast analyzes. The output should be to obtain a graph similar to the one attached, where above there is a &amp;#034;candlestick&amp;#034; graph and below the sinusoidal trend of the market cycle reconstructed through the application of Fourier. This kind of analysis would also make it possible to create a sort of trading system to identify entry points (sell/buy) to the market, exploiting the phase-lag of the various cycles, and their crossover (the idea in fact is to exploit cycles with different periods- eg. daily, weekly, monthly, ergo with amplitude and different frequency) This in turn implicitly requires a strategy to optimize the cycle obtained as a function of the volatility of the underlying chart, as well as the optimal choice of parameters to be used in the Fourier transform (and this is another point I wanted to ask).&#xD;
&#xD;
Furthermore, another question (secondary, but equally important for me to understand) is that by doing some research, I could see how the Hilbert-Huang transform could be a more efficient strategy in this sense, since financial time series are non-series. stationary, so I was also wondering if it was appropriate to model everything using this type of transform. Many thanks in advance.</description>
    <dc:creator>Giuseppe Vonella</dc:creator>
    <dc:date>2020-12-27T11:43:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2112849">
    <title>Issue with viewing the windows generated from bloomberg link dashboard</title>
    <link>https://community.wolfram.com/groups/-/m/t/2112849</link>
    <description>For some reason, when trying to use the Bloomberg link dashboard, the window has no way to maximize the window and no way to expand or scroll within the window. I cannot view the full page to work with the tool. Let me know if anyone has had this problem before. Attached are some pictures of the problem I have encountered.enter image description here.</description>
    <dc:creator>Luke Jennings</dc:creator>
    <dc:date>2020-11-11T18:21:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2111409">
    <title>Visualizing the live tick with Bloomberg Terminal &amp;amp; InteractiveTradingChart</title>
    <link>https://community.wolfram.com/groups/-/m/t/2111409</link>
    <description>Does anyone have existing code that takes in historical data from bloomberg and updates and visualizes the live ticks coming in on the InteractiveTradingChart? Basically emulating a live chart that will even update any indicators that are on the chart as well?</description>
    <dc:creator>Luke Jennings</dc:creator>
    <dc:date>2020-11-09T17:21:30Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1857773">
    <title>Using SPARQL to construct a timeline of the Supreme Court Chief Justices</title>
    <link>https://community.wolfram.com/groups/-/m/t/1857773</link>
    <description>The intent of this post is to show those inexpert in SPARQL but curious about capabilities how much can be done with it within the Wolfram Language. My specific quest is to generate a timeline of chief justices of the United States Supreme Court but, in the course of doing so, to share some learning about SPARQL and Wikidata.&#xD;
&#xD;
The main insight is to exploit the many examples of SPARQL code at the Wikidata query site, find one that is relevant, and then use ImportString[#,&amp;#034;SPARQLQuery&amp;#034;]&amp;amp; to generate symbolic SPARQL within the Wolfram Language. Once that&amp;#039;s done, we can use core Wolfram Language tools to modify the code for the specific task at hand and then run it against the Wikidata &amp;#034;endpoint.&amp;#034; Once the results come back from Wikidata, some basic Wolfram Language code generates a nice timeline with relative ease.&#xD;
&#xD;
The notebook finishes with a little section on how to run Python from within a Wolfram notebook and get the same kind of results. Again, one doesn&amp;#039;t need to know much about Python to do this (trust me!). Wikidata actually itself provides the basic code. And, as version 12.1 and beyond permit the Wolfram ecosystem to expand its capabilities with other languages, it may be possible to use Wikidata&amp;#039;s fluency in multiple computer languages (Ruby, JavaScript, etc.) to diversify the set of tools with which to attack Wikidata while remaining in the comfortable and powerful Wolfram system. &#xD;
&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/526f27fd-6568-4ef1-a39a-00c0f0028d8c</description>
    <dc:creator>Seth Chandler</dc:creator>
    <dc:date>2020-01-13T16:50:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1731427">
    <title>[WSS19] Investment Strategies: Functional Weighted Choice Method</title>
    <link>https://community.wolfram.com/groups/-/m/t/1731427</link>
    <description>![pic03][4]&#xD;
&#xD;
Disclaimer&#xD;
--------&#xD;
This computational notebook is not to be sold or exchanged for either monetary or non-monetary gains in anyway. The notebook is not to be modified without prior written consent from the author. ?The calculation only serves as an additional reference for equity investors and investment advisors. Any liability, including any liability for negligence, for any loss or damage arising from reliance on this computational notebook, is expressly excluded. Under no circumstance shall the author of this computational notebook or Wolfram Research be held responsible for third-party&amp;#039;s application, investment recommendation, or other usage originating from this computational notebook.&#xD;
&#xD;
I. Abstract&#xD;
--------&#xD;
A quantitative model was derived to analyze common collections of investment tactics. The model was designed with flexibility: it can choose and weight the stocks into a portfolio of any size, based on any analytic expression of the stocks&amp;#039; financial characteristics, allowing both whole and fractional shares, with an option for additional investment. Using the model, several common investment strategies were investigated: chosen and weighted by price; chosen by price, equally weighted; chosen by volume, weighted by market capitalization; chosen and weighted by market capitalization. The model shows that a less frequently adjusted portfolio seems to perform better, supporting the buy-and-hold tactic. The model also indicate that the size of the portfolio, does not exert a strong effect on the strategy&amp;#039;s overall performance.&#xD;
&#xD;
II. Introduction&#xD;
--------&#xD;
Equity investing remains a significant vehicle to preserve and generate wealth. Owing to the advances in technology and computational instruments, as well as the readily available financial data, strategical equity investing has become more technically accessible. Yet, apart from large financial institutions (such as hedge-funds and investment banks), the analyzing tools for investment strategies are not readily available to most individual investors - and even when the tools are available, the analysis are often basic and limited. Hence, a mathematically robust, versatile tool for investment strategy would enable more people to participate in investing, to make better-informed choice, which may narrows the standard of living gap between different social classes.&#xD;
&#xD;
Here, a computational model was derived and freely distributed to help quantifying the most common collection of investment strategies: the model aims to quantify the portfolio&amp;#039;s performance, in which stocks are chosen and weighted based on certain criteria. The model consists of two distinct parts: the gathering of historical data/financial information, and the construction of the portfolios - back-testing on historical data for theoretical performance (transactional fees and other necessary costs are not included in the model).&#xD;
&#xD;
III. Data Gathering&#xD;
--------&#xD;
&#xD;
    ClearAll[&amp;#034;Global`*&amp;#034;];&#xD;
    SetDirectory[NotebookDirectory[]];&#xD;
&#xD;
First, a collection of stocks is specified: this collection will serve as the &amp;#034;set of all stocks&amp;#034;, from which the portfolios will be constructed. For the purpose of constructing and testing a computational model, the collection is chosen to be SP500: all the stocks that are listed on the Standard and Poor 500 Index (^SPX)&#xD;
&#xD;
    listStock = EntityList[EntityClass[&amp;#034;Financial&amp;#034;, &amp;#034;SP500&amp;#034;]];&#xD;
    DumpSave[&amp;#034;listStock.MX&amp;#034;, listStock];&#xD;
&#xD;
This specified &amp;#034;set of all stocks&amp;#034; SP500 is then associated with multiple other financial properties: price, option2, option3, option4, option5, option6. Price is always included, since stock price is necessary to quantify an investment strategy&amp;#039;s performance. The other options are chosen from the following list, so that they result in timeseries (measurements over time) of the properties (as currently supported by Wolfram Mathematica kernel, 2019-07-10): {&amp;#034;Change&amp;#034;, &amp;#034;Close&amp;#034;, &amp;#034;CumulativeFractionalChange&amp;#034;, &amp;#034;Dividend&amp;#034;, &amp;#034;DividendPerShare&amp;#034;, &amp;#034;Last&amp;#034;, &amp;#034;MarketCap&amp;#034;, &amp;#034;Open&amp;#034;, &amp;#034;Price&amp;#034;, &amp;#034;RawVolume&amp;#034;, &amp;#034;Return&amp;#034;, &amp;#034;Volume&amp;#034;}. If an option is not used, that option must be specified as &amp;#034;None&amp;#034;.&#xD;
&#xD;
The financial properties for the &amp;#034;set of all stocks&amp;#034; are collected with one call of FinanciaData[], in order to minimize the downloading time. Yet, because of the sheer size of the timeseries: all daily data points of several properties of all stocks since the stocks&amp;#039; inception, the financial properties may take as much as two hours to be procured (the Boolean variable run is used to prevent inadvertently overwriting the obtained data file - it needs to be changed to True in order to execute the codes in this section).&#xD;
&#xD;
    option2 = &amp;#034;MarketCap&amp;#034;;&#xD;
    option3 = &amp;#034;Volume&amp;#034;;&#xD;
    option4 = &amp;#034;Close&amp;#034;;&#xD;
    option5 = &amp;#034;Open&amp;#034;;&#xD;
    option6 = &amp;#034;None&amp;#034;;&#xD;
    listOptions = &#xD;
      DeleteCases[{option2, option3, option4, option5, option6}, &amp;#034;None&amp;#034;];&#xD;
    DumpSave[&amp;#034;listOptions.MX&amp;#034;, listOptions];&#xD;
    &#xD;
    run = False;&#xD;
    If[run == True, &#xD;
      listStockPropRaw = &#xD;
       FinancialData[listStock, Prepend[listOptions, &amp;#034;Price&amp;#034;], All]];&#xD;
&#xD;
The portfolios will be compared against a benchmark to assess their performance. This benchmark is chosen to be the Standard and Poor 500 Index (^SPX): the data is stored in sp500All variable.&#xD;
&#xD;
    sp500All = FinancialData[&amp;#034;^SPX&amp;#034;, All];&#xD;
    DumpSave[&amp;#034;sp500All.MX&amp;#034;, sp500All];&#xD;
&#xD;
Once all the financial properties are (finally) obtained, the timeseries are changed into interpolation order of 0, which means missing/interval measurements will be identical to its immediately previous measurement, effectively describing a step function (instead of interpolating the interval measurement from both its immediate previous data point and its next data point - i.e. using future data to make a present decision). This step is crucial for back-testing, especially with quarterly (every three months) financial data such as dividend, total asset, total liability, EBITDA (earnings before interest, tax, depreciation and amortization), etc.&#xD;
&#xD;
(At the moment, Wolfram Research has plan to incorporate EntityValue[] of entity &amp;#034;Company&amp;#034; into the FinancialData[] function, so that by querying a stock, the associated company&amp;#039;s financial and accounting information can be obtained.)&#xD;
&#xD;
    If[run == True,&#xD;
     listStockProp = &#xD;
      Replace[listStockPropRaw, &#xD;
       List[&amp;#034;Interpolation&amp;#034;, Rule[InterpolationOrder, 1]] -&amp;gt; &#xD;
        List[&amp;#034;Interpolation&amp;#034;, Rule[InterpolationOrder, 0]], {5}];&#xD;
     DumpSave[&amp;#034;listStockProp.MX&amp;#034;, listStockProp];&#xD;
     ]&#xD;
&#xD;
The SP500 stocks&amp;#039;s name and financial properties are combined into one variable: masterThread, with its definition saved into &amp;#034;masterThreadGeneral.MX&amp;#034;. The variable masterThread is ascertained with its length and an excerpt of its contents.&#xD;
&#xD;
    If[run == True,&#xD;
     CompoundExpression[&#xD;
      masterThreadNotIndexed =&#xD;
       DeleteMissing[&#xD;
        Transpose[Prepend[Transpose[listStockProp], listStock]],&#xD;
        1, 3];&#xD;
      &#xD;
      masterThread = &#xD;
       Transpose[&#xD;
        Prepend[Transpose[masterThreadNotIndexed], &#xD;
         Range[Length[masterThreadNotIndexed]]]];&#xD;
      DumpSave[&amp;#034;masterThreadGeneral.MX&amp;#034;, masterThread];&#xD;
      &#xD;
      masterThread // Length&#xD;
          RandomSample[masterThread, 5] // TableForm // Print&#xD;
      ]]&#xD;
&#xD;
For the sole purpose of constructing the computational model, a smaller set of 64 randomly selected stocks from SP500 are obtained (since making a portfolio by sorting the whole 505 stocks in the SP500 set would take a bit longer - which is unnecessary at this stage).&#xD;
&#xD;
    If[run == True,&#xD;
     CompoundExpression[&#xD;
      ClearAll[masterThread];&#xD;
      masterThreadNotIndexedSample = RandomSample[&#xD;
        DeleteMissing[&#xD;
         Transpose[Prepend[Transpose[listStockProp], listStock]],&#xD;
         1, 3], 64];&#xD;
      &#xD;
      masterThread = &#xD;
       Transpose[&#xD;
        Prepend[Transpose[masterThreadNotIndexedSample], &#xD;
         Range[Length[masterThreadNotIndexedSample]]]];&#xD;
      DumpSave[&amp;#034;masterThreadSample64.MX&amp;#034;, masterThread];&#xD;
      &#xD;
      masterThread // Length&#xD;
         RandomSample[masterThread, 5] // TableForm // Print&#xD;
      ]]&#xD;
&#xD;
IV. Constructing the computational model&#xD;
--------&#xD;
First, the previously constructed listOptions, sp500All, and the masterThread variables are reloaded into a clean Mathematica kernel.&#xD;
&#xD;
    ClearAll[&amp;#034;Global`*&amp;#034;];&#xD;
    SetDirectory[NotebookDirectory[]];&#xD;
    Off[InterpolatingFunction::dmval];&#xD;
    Off[EntityValue::conopen];&#xD;
    &#xD;
    Get[&amp;#034;listOptions.MX&amp;#034;];&#xD;
    Get[&amp;#034;sp500All.MX&amp;#034;];&#xD;
    Get[&amp;#034;masterThreadGeneral.MX&amp;#034;];&#xD;
&#xD;
The inputs for the computational model are specified:&#xD;
&#xD;
- timePeriod denotes the portfolio&amp;#039;s frequency of adjustment in whole number of days: timePeriod = n means that the portfolio is updated/adjusted every n days.&#xD;
&#xD;
- sizePortfolio denotes the portfolio&amp;#039;s size - the pre-specified number of stocks the portfolio contains. Obviously, the portfolio size must be smaller than the number of stocks in masterThread.&#xD;
&#xD;
- taxRate takes into account the rate of tax on capital gain. Here, the tax is set at 40% for any capital gain each time the portfolio is rebalanced, and immediately deducted. This setup is much more restrictive than the personal income tax schedule in the U.S.: rate depending on personal income (maximum 37%, 2019), calculated for the whole year, and not due until April of the following year.&#xD;
	&#xD;
- initialInvest specifies the initial amount of money invested in the portfolio.&#xD;
&#xD;
- dailyInvest specifies the additional daily amount of money invested in the portfolio. Each time the portfolio is rebalanced, an amount of dailyInvest*timePeriod will be added into the portfolio.&#xD;
	&#xD;
- optionWholeShare specified whether only whole numbers (positive integers) of stock share are allowed, or fractional shares are also possible, as some trading platforms permit whole share only. Variable optionWholeShare accepts only Boolean values True or False.&#xD;
	&#xD;
- beginDate denotes the first date of the investigated time window.&#xD;
&#xD;
- endDate denotes the last date of the investigated time window.&#xD;
	&#xD;
- funcSort[] determines how the stocks in masterThread (the &amp;#034;set of all stocks&amp;#034;) at one specific instant of time are sorted for selection, from largest to smallest. Function funcSort accepts any analytic expression of x1, x2, x3, x4, x5,..., corresponding to the financial properties &amp;#034;Price&amp;#034;, option2, option3, option4, option5,...&#xD;
&#xD;
- optionTake, which is linked to funcTake[] on the following paragraph, specified how the stocks are collected into a portfolio from the sorted  masterThread (using funcSort). Variable optionTake is designed to accept only three designation: &amp;#034;high&amp;#034;, meaning the largest stocks are taken (with respect to their metrics obtained from funcSort); &amp;#034;low&amp;#034;, meaning the smallest stocks are taken; and mid&amp;#034;, meaning the middle stocks are taken.&#xD;
&#xD;
- funcWeight[] determines how the selected stocks in the portfolio are weighted for investment. Function funcWeight accepts any analytic expression of x1, x2, x3, x4, x5,..., corresponding to the financial properties &amp;#034;Price&amp;#034;, option2, option3, option4, option5,... To use funcWeight, optionEqualWeight must be False.&#xD;
&#xD;
- optionEqualWeight denotes whether to use funcWeight[], or to assign equal weight to all selected stocks in the portfolio. Variable optionEqualWeight accepts only Boolean values True or False.&#xD;
	&#xD;
- Function funcTake[], mentioned earlier with variable optionTake, is defined to execute the input given to optionTake.&#xD;
- Variable sp500Ratio stores the relative value of the Standard and Poor 500 Index (^SPX) since the first date of the investigated time window - of which the portfolio performance is compared against.&#xD;
&#xD;
        timePeriod = 56;&#xD;
        sizePortfolio = 10;&#xD;
        taxRate = 0.4;&#xD;
        initialInvest = 100.00;&#xD;
        dailyInvest = 0.00;&#xD;
        optionWholeShare = False;&#xD;
        &#xD;
        beginDate = DateObject[&amp;#034;2004-07-01&amp;#034;];&#xD;
        endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
        &#xD;
        funcSort[x1_, x2_, x3_, x4_, x5_] := &#xD;
          x2/10^6 + x3/10^3 + Sqrt[(Sin[Log[x2 + 1]])^2 + (ArcTan[x3])^2];&#xD;
        &#xD;
        optionTake = &amp;#034;low&amp;#034;; (*high mid low*)&#xD;
        &#xD;
        funcWeight[x1_, x2_, x3_, x4_, x5_] := (&#xD;
           Abs[2 (x5 - x4)] + Log[x5 + x4 + 1]^-1)/(x5 + x4) x1;&#xD;
        &#xD;
        optionEqualWeight = False;&#xD;
        &#xD;
        initialFunc[] := Module[{},&#xD;
           CompoundExpression[&#xD;
            portValue[beginDate] = Quantity[initialInvest, &amp;#034;USDollars&amp;#034;];&#xD;
            investAmount = Quantity[dailyInvest, &amp;#034;USDollars&amp;#034;]*timePeriod;&#xD;
            &#xD;
            funcTake[sortedListVar_, sizePortfolioVar_] := Which[&#xD;
              optionTake == &amp;#034;high&amp;#034;, Take[sortedListVar, sizePortfolioVar],&#xD;
              optionTake == &amp;#034;mid&amp;#034;, &#xD;
              Take[sortedListVar, {Floor[(&#xD;
                 Length[sortedListVar] - sizePortfolioVar)/2], &#xD;
                Floor[(Length[sortedListVar] + sizePortfolioVar)/2] - 1}],&#xD;
              optionTake == &amp;#034;low&amp;#034;, Take[sortedListVar, -sizePortfolioVar]&#xD;
              ];&#xD;
            &#xD;
            sp500 = &#xD;
             TimeSeriesWindow[sp500All, {beginDate, endDate}, &#xD;
              IncludeWindowTimes -&amp;gt; True, &#xD;
              ResamplingMethod -&amp;gt; {&amp;#034;Interpolation&amp;#034;, InterpolationOrder -&amp;gt; 0}];&#xD;
            sp500Ratio = sp500/QuantityMagnitude[sp500[beginDate]];&#xD;
            ]];&#xD;
&#xD;
The function callFuncBody[] constitutes the essence of the model: it determines the portfolio&amp;#039;s value at each instant of adjustment.&#xD;
&#xD;
First, the function chooses the stocks to be included in the portfolio along with their weight-by-investment-amount: by sorting with funcSort, choosing with optionTake/funcTake, and weighting with funcWeight, on the pre-defined stocks&amp;#039; properties, from the previous day (to assure that all properties are available, that future information is not used to make present decision).&#xD;
Then, the function distributes the current portfolio value to the chosen list of stocks , from which it registers the number of shares of the chosen stocks.&#xD;
If only whole share number is allowed, the function ensures that portfolio&amp;#039;s value remains sufficient to purchase at least one share of each stock chosen, by mean of additional investment.&#xD;
&#xD;
At the next date of adjustment, the function uses the previous number of shares and new stock prices to compute the new portfolio value - after any applicable tax and additional investment.&#xD;
This new portfolio value is hence used to derive the new number of shares, etc.&#xD;
The function repeats the process until it spans over the whole pre-specified time window. The portfolio value is capped at 100 times the total amount of investment.&#xD;
&#xD;
The function callFunc[] imposes necessary conditions on callFuncBody[]: the model will only evaluates with proper inputs. More importantly, the function callFunc[] incorporates the model&amp;#039;s downstream processing steps.&#xD;
&#xD;
    (*callFuncBody[]*)&#xD;
    callFuncBody[] := &#xD;
      Module[{threadPrevious = {}, indexPrevious = {}, threadAtTime, &#xD;
        threadAtTimeMinus1, newPriceList, threadAtTimeAppend, sortedList, &#xD;
        listChosen, t, tMinus1, tprevious, newPortValue, &#xD;
        portValuePrevious, fractionalAmount, priceListPrevious, &#xD;
        differenceValue},&#xD;
       initialFunc[];&#xD;
       listDate = {};&#xD;
       TimeConstrained[&#xD;
        For[t = beginDate, t &amp;lt;= endDate, t = DatePlus[t, timePeriod],&#xD;
         threadAtTime = &#xD;
          MapAt[#[t] &amp;amp;, &#xD;
           masterThread, {All, Table[n, {n, 3, Length[listOptions] + 3}]}];&#xD;
         tMinus1 = DatePlus[t, -1];&#xD;
         threadAtTimeMinus1 = &#xD;
          MapAt[#[tMinus1] &amp;amp;, &#xD;
           masterThread, {All, Table[n, {n, 3, Length[listOptions] + 3}]}];&#xD;
         &#xD;
         If[And[&#xD;
           FreeQ[QuantityMagnitude[threadAtTime], _Missing, 2],&#xD;
           FreeQ[QuantityMagnitude[threadAtTimeMinus1], _Missing, 2],&#xD;
           threadAtTime != threadPrevious],&#xD;
          &#xD;
          CompoundExpression[&#xD;
           &#xD;
           If[indexPrevious != {},&#xD;
            CompoundExpression[&#xD;
             newPriceList = &#xD;
              Select[threadAtTime, MemberQ[indexPrevious, #[[1]]] &amp;amp;][[All,&#xD;
                3]];&#xD;
             differenceValue = &#xD;
              Dot[newPriceList - priceListPrevious, &#xD;
               listShareNumber[tPrevious]];&#xD;
             portValue[t] = If[QuantityMagnitude[differenceValue] &amp;gt; 0,&#xD;
               &#xD;
               Min[100 (investAmount*&#xD;
                    QuantityMagnitude[&#xD;
                     DateDifference[beginDate, endDate]] + (portValue[&#xD;
                      beginDate] + addFund[beginDate])), &#xD;
                portValuePrevious + (1 - taxRate) differenceValue + &#xD;
                 investAmount],&#xD;
               &#xD;
               Min[100 (investAmount*&#xD;
                    QuantityMagnitude[&#xD;
                     DateDifference[beginDate, endDate]] + (portValue[&#xD;
                      beginDate] + addFund[beginDate])), &#xD;
                portValuePrevious + differenceValue + investAmount]&#xD;
               ](*IF*);&#xD;
             ](*CompoundExpression*)](*IF*);&#xD;
           &#xD;
           sortList = funcSort[x1, x2, x3, x4, x5] /. Table[&#xD;
              Evaluate[Symbol[StringJoin[&amp;#034;x&amp;#034;, ToString[n - 2]]]] -&amp;gt; &#xD;
               QuantityMagnitude[threadAtTimeMinus1[[All, n]]],&#xD;
              {n, 3, Length[listOptions] + 3}];&#xD;
           &#xD;
           (*{x1\[Rule]QuantityMagnitude[threadAtTimeMinus1[[All,3]]],&#xD;
           x2\[Rule]QuantityMagnitude[threadAtTimeMinus1[[All,4]]],&#xD;
           x3\[Rule]QuantityMagnitude[threadAtTimeMinus1[[All,5]]],&#xD;
           x4\[Rule]QuantityMagnitude[threadAtTimeMinus1[[All,6]]],&#xD;
           x5\[Rule]QuantityMagnitude[threadAtTimeMinus1[[All,7]]]};*)&#xD;
           &#xD;
           weightList = If[optionEqualWeight == False,&#xD;
             funcWeight[x1, x2, x3, x4, x5] /. Table[&#xD;
               Evaluate[Symbol[StringJoin[&amp;#034;x&amp;#034;, ToString[n - 2]]]] -&amp;gt; &#xD;
                QuantityMagnitude[threadAtTimeMinus1[[All, n]]],&#xD;
               {n, 3, Length[listOptions] + 3}],&#xD;
             ConstantArray[1/Length[masterThread], Length[masterThread]]&#xD;
             ];&#xD;
           &#xD;
           threadAtTimeAppend = &#xD;
            Transpose[&#xD;
             Join[Transpose[threadAtTime], {sortList}, {weightList}]];&#xD;
           sortedList = Sort[threadAtTimeAppend, #1[[-2]] &amp;gt; #2[[-2]] &amp;amp;];&#xD;
           listChosen = &#xD;
            Sort[funcTake[sortedList, sizePortfolio], #1[[1]] &amp;lt; #2[[1]] &amp;amp;];&#xD;
           &#xD;
           weight = &#xD;
            If[And[optionEqualWeight == False, &#xD;
              0 &amp;lt; QuantityMagnitude[Min[weightList]], &#xD;
              QuantityMagnitude[Max[weightList]] &amp;lt; \[Infinity]],&#xD;
             listChosen[[All, -1]]/Total[listChosen[[All, -1]]],&#xD;
             ConstantArray[1/sizePortfolio, sizePortfolio]&#xD;
             ];&#xD;
           &#xD;
           If[optionWholeShare == True,&#xD;
            CompoundExpression[&#xD;
             If[&#xD;
              portValue[t] &amp;lt; &#xD;
               Dot[listChosen[[All, 3]], ConstantArray[1, sizePortfolio]],&#xD;
              CompoundExpression[&#xD;
               &#xD;
               addFund[t] = &#xD;
                investAmount + &#xD;
                 Dot[listChosen[[All, 3]], &#xD;
                  ConstantArray[1, sizePortfolio]] - portValue[t];&#xD;
               &#xD;
               portValue[t] = &#xD;
                investAmount + &#xD;
                 Dot[listChosen[[All, 3]], &#xD;
                  ConstantArray[1, sizePortfolio]];&#xD;
               ],&#xD;
              addFund[t] = investAmount];&#xD;
             &#xD;
             listShareNumber[t] = &#xD;
              Floor[weight*portValue[t]/listChosen[[All, 3]]];&#xD;
             ](*CompoundExpression*),&#xD;
            &#xD;
            CompoundExpression[&#xD;
              addFund[t] = investAmount;&#xD;
              &#xD;
              listShareNumber[t] = &#xD;
               weight*portValue[t]/listChosen[[All, 3]];&#xD;
              ](*CompoundExpression*);&#xD;
            ](*If*);&#xD;
           &#xD;
           portAtTime[t] = &#xD;
            Thread[{listChosen[[All, 1]], listChosen[[All, 2]], &#xD;
              listChosen[[All, 3]], listShareNumber[t], &#xD;
              listChosen[[All, -2]], listChosen[[All, -1]]}];&#xD;
           &#xD;
           Do[&#xD;
            shareNo[listChosen[[i, 1]], t] = listShareNumber[t][[i]],&#xD;
            {i, 1, Length[listChosen]}&#xD;
            ];&#xD;
           &#xD;
           Do[&#xD;
            shareNo[n, t] = 0,&#xD;
            {n, &#xD;
             Complement[Range[Length[masterThread]], listChosen[[All, 1]]]}&#xD;
            ];&#xD;
           &#xD;
           AppendTo[listDate, t];&#xD;
           threadPrevious = threadAtTime;&#xD;
           tPrevious = t;&#xD;
           portValuePrevious = portValue[t];&#xD;
           indexPrevious = listChosen[[All, 1]];&#xD;
           priceListPrevious = listChosen[[All, 3]];&#xD;
           &#xD;
           ](*CompoundExpression*),&#xD;
          t = DatePlus[t, -timePeriod + 1];](*If*)&#xD;
         ](*For*),&#xD;
        10*60, Print[&amp;#034;Time Out!&amp;#034;](*TimeConstrained*)];&#xD;
       ](*Module*);&#xD;
    &#xD;
    (*&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;***&amp;amp;&amp;amp;&amp;amp;*)&#xD;
    &#xD;
    (*callFunc[]*)&#xD;
    callFunc[] := If[&#xD;
       And[&#xD;
        Length[masterThread] &amp;gt; sizePortfolio,&#xD;
        IntegerQ[sizePortfolio],&#xD;
        sizePortfolio &amp;gt; 0,&#xD;
        beginDate &amp;lt;= endDate,&#xD;
        IntegerQ[timePeriod],&#xD;
        timePeriod &amp;gt; 0,&#xD;
        MemberQ[{&amp;#034;high&amp;#034;, &amp;#034;mid&amp;#034;, &amp;#034;low&amp;#034;}, optionTake],&#xD;
        BooleanQ[optionEqualWeight],&#xD;
        BooleanQ[optionWholeShare]&#xD;
        ](*And*),&#xD;
       &#xD;
       CompoundExpression[&#xD;
        callFuncBody[];&#xD;
        addFund[beginDate] = portValue[beginDate];&#xD;
        &#xD;
        Do[&#xD;
         shareNumberTimeSeries[n] = &#xD;
          TimeSeries[Table[shareNo[n, t], {t, listDate}], {listDate}, &#xD;
           ResamplingMethod -&amp;gt; {&amp;#034;Interpolation&amp;#034;, InterpolationOrder -&amp;gt; 0}],&#xD;
         {n, 1, Length[masterThread]}&#xD;
         ](*Do*);&#xD;
        &#xD;
        portValueTimeSeries = &#xD;
         TimeSeries[Table[portValue[t], {t, listDate}], {listDate}, &#xD;
          ResamplingMethod -&amp;gt; {&amp;#034;Interpolation&amp;#034;, InterpolationOrder -&amp;gt; 0}];&#xD;
        portValueTimeSeriesRatio = &#xD;
         portValueTimeSeries/portValueTimeSeries[&amp;#034;FirstValue&amp;#034;];&#xD;
        &#xD;
        addFundTimeSeries = &#xD;
         TimeSeries[Table[addFund[t], {t, listDate}], {listDate}, &#xD;
          MissingDataMethod -&amp;gt; {&amp;#034;Constant&amp;#034;, Quantity[0.00, &amp;#034;USDollars&amp;#034;]}, &#xD;
          ResamplingMethod -&amp;gt; {&amp;#034;Constant&amp;#034;, Quantity[0.00, &amp;#034;USDollars&amp;#034;]}];&#xD;
        addFundTimeSeriesRatio = &#xD;
         addFundTimeSeries/portValueTimeSeries[&amp;#034;FirstValue&amp;#034;];&#xD;
        &#xD;
        finalList = &#xD;
         Transpose[&#xD;
          Append[Transpose[masterThread], &#xD;
           Table[shareNumberTimeSeries[n], {n, 1, Length[masterThread]}]]];&#xD;
        &#xD;
        ](*CompoundExpression*),&#xD;
       &#xD;
       Print[&amp;#034;Error: problematic input(s)! Model will not run.&amp;#034;]&#xD;
       ](*If*);&#xD;
&#xD;
Function callFunc[] defines several global variables:&#xD;
&#xD;
- listDate: the list of all the dates at which the portfolio was adjusted.&#xD;
&#xD;
- portAtTime[t]: the component of the portfolio at an instance of time t. The instance of time t must be an element of the list of all date listDate.&#xD;
&#xD;
- shareNumberTimeSeries[n]: the timeseries of the share number in portfolio of the nth stock in masterThread (1 &amp;lt;= n &amp;lt;= Length[masterThread])&#xD;
&#xD;
- portValueTimeSeries: the timeseries of portfolio value.&#xD;
&#xD;
- addFundTimeSeries: the timeseries of additional investment.&#xD;
&#xD;
- finalList: the list of all stocks and their properties, with their share number appended.&#xD;
&#xD;
        callFunc[];&#xD;
        &#xD;
        Hold[&#xD;
          Take[listDate, 6] // TableForm // Print;&#xD;
          Table[{t, portAtTime[t]}, {t, listDate}] // TableForm // Print;&#xD;
          Table[{n, shareNumberTimeSeries[n]}, {n, 1, 6}] // TableForm // &#xD;
           Print;&#xD;
          portValueTimeSeries // Print;&#xD;
          addFundTimeSeries // Print;&#xD;
          Take[finalList, 5] // TableForm // Print;&#xD;
          ];&#xD;
&#xD;
Here is an example of the finalList, with appropriate annotation.&#xD;
&#xD;
    finalListHeadings = &#xD;
      Style[Framed[#], 16] &amp;amp; /@ &#xD;
       Flatten[{&amp;#034;No.&amp;#034;, &amp;#034;Name&amp;#034;, &amp;#034;Price&amp;#034;, listOptions, &#xD;
         &amp;#034;No. of shares in portfolio&amp;#034;}];&#xD;
    finalListwithHeadings = &#xD;
      Insert[finalList, finalListHeadings, {{1}, {-1}}];&#xD;
    &#xD;
    Rasterize[Take[finalListwithHeadings, 6] // TableForm, &#xD;
     RasterSize -&amp;gt; 2400, ImageSize -&amp;gt; 1200]&#xD;
&#xD;
![pic01][2]&#xD;
&#xD;
Here is an example of the portAtTime, with appropriate annotation.&#xD;
&#xD;
    portfolioAtTimeHeadings = &#xD;
      Style[Framed[#], 16] &amp;amp; /@ {&amp;#034;No.&amp;#034;, &amp;#034;Name&amp;#034;, &amp;#034;Price&amp;#034;, &amp;#034;No. of shares&amp;#034;, &#xD;
        &amp;#034;Sort value&amp;#034;, &amp;#034;Weight value&amp;#034;};&#xD;
    dateVar = RandomChoice[listDate];&#xD;
    portfolioAtTime = &#xD;
      Insert[portAtTime[dateVar], portfolioAtTimeHeadings, {{1}, {-1}}];&#xD;
    &#xD;
    Rasterize[Column[{dateVar, Take[portfolioAtTime, 12] // TableForm}], &#xD;
     RasterSize -&amp;gt; 1024, ImageSize -&amp;gt; 512]&#xD;
&#xD;
![pic02][3]&#xD;
&#xD;
Function callPlot[] is defined to expeditiously visualize the portfolio performance, in comparison with the Standard and Poor 500 Index if applicable (when there is no additional investment).&#xD;
The plot is saved in the global variable &amp;#034;plotVal&amp;#034;; and the annual rate of return is saved in the global variable &amp;#034;returnVal&amp;#034;.&#xD;
&#xD;
Function callExport[] will save the graph as a .PNG file, at the notebook&amp;#039;s directory. Function callPlot has to be called before callExport[].&#xD;
&#xD;
    (*callPlot*)&#xD;
    callPlot[] := Module[{},&#xD;
       frameLabel = Style[Framed[#], 12] &amp;amp; /@ {&amp;#034;Time&amp;#034;, &amp;#034;Relative Value&amp;#034;};&#xD;
       frameLable2 = {{Style[Framed[&amp;#034;Portolio Value&amp;#034;], 12], &#xD;
          Style[Framed[&amp;#034;Additional Investment&amp;#034;], 12]}, {Style[&#xD;
           Framed[&amp;#034;Time&amp;#034;], 12], None}};&#xD;
       &#xD;
       stringTotal = &#xD;
        ToString[&#xD;
         Round[QuantityMagnitude[&#xD;
           portValueTimeSeries[&amp;#034;FirstValue&amp;#034;] + Total[addFundTimeSeries] - &#xD;
            addFundTimeSeries[&amp;#034;FirstValue&amp;#034;]], 1]];&#xD;
       stringMax = &#xD;
        ToString[Round[QuantityMagnitude[Max[portValueTimeSeries]], 1]];&#xD;
       stringEnd = &#xD;
        ToString[&#xD;
         Round[QuantityMagnitude[portValueTimeSeries[&amp;#034;LastValue&amp;#034;]], 1]];&#xD;
       &#xD;
       firstVal = QuantityMagnitude[addFundTimeSeries[&amp;#034;FirstValue&amp;#034;]];&#xD;
       regularVal = QuantityMagnitude[investAmount];&#xD;
       dateVal = QuantityMagnitude[DateDifference[beginDate, endDate]]/&#xD;
        timePeriod;&#xD;
       lengthVal = Floor[dateVal];&#xD;
       totalVal = QuantityMagnitude[portValueTimeSeries[&amp;#034;LastValue&amp;#034;]];&#xD;
       &#xD;
       If[firstVal + regularVal != totalVal,&#xD;
        &#xD;
        CompoundExpression[&#xD;
         sol = &#xD;
          NSolve[(firstVal*(1 + interest)^lengthVal + &#xD;
                regularVal ((1 + interest)^lengthVal - 1)/interest) (1 + &#xD;
                 interest)^(dateVal - lengthVal) == totalVal, interest, &#xD;
            Reals][[1]];&#xD;
         returnVal = ((1 + interest)^(365.25/timePeriod) - 1) //. sol;],&#xD;
        &#xD;
        returnVal = 0];&#xD;
       stringReturn = ToString[PercentForm[returnVal, 4]];&#xD;
       &#xD;
       (*&#xD;
       stringReturn=ToString[PercentForm[QuantityMagnitude[(Exp[Log[&#xD;
       portValueTimeSeries[&amp;#034;LastValue&amp;#034;]/Total[addFundTimeSeries]]/(&#xD;
       QuantityMagnitude[DateDifference[beginDate,endDate]]/365.25)]-1;)],&#xD;
       4]];&#xD;
       &#xD;
       stringTotal=StringTake[StringPadRight[ToString[portValueTimeSeries[&#xD;
       &amp;#034;FirstValue&amp;#034;]+Total[addFundTimeSeries]-addFundTimeSeries[&#xD;
       &amp;#034;FirstValue&amp;#034;]],9,&amp;#034;0&amp;#034;],9];&#xD;
       stringMax=StringTake[StringPadRight[ToString[Max[&#xD;
       portValueTimeSeries]],9,&amp;#034;0&amp;#034;],9];&#xD;
       stringEnd=StringTake[StringPadRight[ToString[portValueTimeSeries[&#xD;
       &amp;#034;LastValue&amp;#034;]],9,&amp;#034;0&amp;#034;],9];&#xD;
       stringReturn=StringTake[StringPadRight[ToString[PercentForm[Exp[&#xD;
       Log[portValueTimeSeries[&amp;#034;LastValue&amp;#034;]/(portValueTimeSeries[&#xD;
       &amp;#034;FirstValue&amp;#034;]+Total[addFundTimeSeries]-addFundTimeSeries[&#xD;
       &amp;#034;FirstValue&amp;#034;])]/QuantityMagnitude[DateDifference[beginDate,endDate,&#xD;
       &amp;#034;Year&amp;#034;]]]-1,5]],5,&amp;#034;0&amp;#034;],5];&#xD;
       *)&#xD;
       &#xD;
       plotLabel = &#xD;
        Style[Framed[&#xD;
          StringJoin[&amp;#034;Total investment: $&amp;#034;, stringTotal, &#xD;
           &amp;#034;. Annual return: &amp;#034;, stringReturn, &amp;#034;\nPortfolio value max: $&amp;#034;, &#xD;
           stringMax, &amp;#034;; end: $&amp;#034;, stringEnd]], 16];&#xD;
       &#xD;
       max = Max[&#xD;
         Min[QuantityMagnitude[Max[portValueTimeSeriesRatio]], 12], &#xD;
         Max[sp500Ratio]];&#xD;
       min = Min[&#xD;
         Max[QuantityMagnitude[Min[portValueTimeSeriesRatio]], -1], &#xD;
         Min[sp500Ratio]];&#xD;
       plotVal = If[dailyInvest == 0,&#xD;
         DateListPlot[{portValueTimeSeriesRatio, sp500Ratio, &#xD;
           addFundTimeSeriesRatio}, FrameLabel -&amp;gt; frameLabel, &#xD;
          PlotLabel -&amp;gt; plotLabel, PlotRange -&amp;gt; {Automatic, {0, max}}, &#xD;
          PlotStyle -&amp;gt; {Thick, Thick}, Joined -&amp;gt; {True, True, False}, &#xD;
          Filling -&amp;gt; {1 -&amp;gt; Axis, &#xD;
            2 -&amp;gt; {{1}, {None, &#xD;
               Directive[Opacity[0.3], &#xD;
                ColorData[97, &amp;#034;ColorList&amp;#034;][[2]]]}}}, &#xD;
          FillingStyle -&amp;gt; Opacity[0.3], &#xD;
          PlotLegends -&amp;gt; &#xD;
           Placed[{&amp;#034;Portfolio&amp;#034;, &amp;#034;SP500&amp;#034;, &amp;#034;add&amp;#034;}, {Left, Top}], &#xD;
          ImageSize -&amp;gt; Large],&#xD;
         &#xD;
         addFundTimeSeriesRescaled = &#xD;
          addFundTimeSeries/addFundTimeSeries[&amp;#034;LastValue&amp;#034;]*&#xD;
           Max[portValueTimeSeries]/2;&#xD;
         DateListPlot[{portValueTimeSeries, addFundTimeSeriesRescaled}, &#xD;
          FrameLabel -&amp;gt; frameLable2, PlotLabel -&amp;gt; plotLabel, &#xD;
          PlotRange -&amp;gt; {Automatic, {0, &#xD;
             QuantityMagnitude[Max[portValueTimeSeries]]}}, &#xD;
          FrameTicks -&amp;gt; {{Table[&#xD;
              x Round[Max[portValueTimeSeries], 5]/5, {x, 0, 4}], &#xD;
             Table[{x Max[portValueTimeSeries]/4, &#xD;
               x addFundTimeSeries[&amp;#034;LastValue&amp;#034;]/2}, {x, 1, &#xD;
               3}]}, {Automatic, None}}, PlotStyle -&amp;gt; {Thick, Thick}, &#xD;
          Joined -&amp;gt; {True, False}, Filling -&amp;gt; {1 -&amp;gt; Axis}, &#xD;
          FillingStyle -&amp;gt; Opacity[0.3], &#xD;
          PlotLegends -&amp;gt; Placed[{&amp;#034;Portfolio&amp;#034;, &amp;#034;add&amp;#034;}, {Left, Top}], &#xD;
          ImageSize -&amp;gt; Large]&#xD;
         ]&#xD;
       ];&#xD;
    &#xD;
    callExport[plotVar_] := Export[&#xD;
       StringJoin[&amp;#034;plot&amp;#034;, ToString[plotVar],&#xD;
        StringPadLeft[ToString[sizePortfolio], 3, &amp;#034;0&amp;#034;],&#xD;
        StringTake[ToString[optionTake], 2],&#xD;
        StringPadLeft[ToString[timePeriod], 3, &amp;#034;0&amp;#034;],&#xD;
        &amp;#034;.png&amp;#034;&#xD;
        ]&#xD;
       , plotVal];&#xD;
    &#xD;
    callPlot[]&#xD;
    Hold[callExport[]];&#xD;
&#xD;
![pic03][4]&#xD;
&#xD;
V. Explicit quality-control: checking the model manually&#xD;
--------&#xD;
The model was explicitly checked to assure that it does what it is designed to do, given appropriate input data. The quality-control process is readily available using the following block of code.&#xD;
(Again, the  sort value and weight value are derived from the day immediately before, not the current day of portfolio balancing.)&#xD;
&#xD;
    timePeriod = 112;&#xD;
    sizePortfolio = 5;&#xD;
    taxRate = 0.4;&#xD;
    initialInvest = 100.00;&#xD;
    dailyInvest = 0.00;&#xD;
    optionWholeShare = False;&#xD;
    &#xD;
    beginDate = DateObject[&amp;#034;2014-07-01&amp;#034;];&#xD;
    endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
    &#xD;
    funcSort[x1_, x2_, x3_, x4_, x5_] := x1;&#xD;
    funcWeight[x1_, x2_, x3_, x4_, x5_] := (2 Abs[x5 - x4])/(x5 + x4);&#xD;
    optionEqualWeight = False;&#xD;
    &#xD;
    callFunc[];&#xD;
    &#xD;
    listDate;&#xD;
    listIndexTest = &#xD;
      Flatten[Table[portAtTime[listDate[[q]]][[All, 1]], {q, 1, 10}]];&#xD;
    &#xD;
    portfolioAtTimeHeadings = &#xD;
      Style[Framed[#], 16] &amp;amp; /@ {&amp;#034;No.&amp;#034;, &amp;#034;Name&amp;#034;, &amp;#034;Price&amp;#034;, &amp;#034;No. of shares&amp;#034;, &#xD;
        &amp;#034;Sort value&amp;#034;, &amp;#034;Weight value&amp;#034;};&#xD;
    finalListHeadings = &#xD;
      Style[Framed[#], 16] &amp;amp; /@ &#xD;
       Flatten[{&amp;#034;No.&amp;#034;, &amp;#034;Name&amp;#034;, &amp;#034;Price&amp;#034;, listOptions}];&#xD;
    &#xD;
    For[h = 1, h &amp;lt;= 2, h++,&#xD;
     col1x = MapAt[QuantityMagnitude[#[DatePlus[listDate[[h]], -1]]] &amp;amp;, &#xD;
       Select[masterThread, MemberQ[listIndexTest, #[[1]]] &amp;amp;], {All, &#xD;
        Table[n, {n, 3, Length[listOptions] + 3}]}];&#xD;
     col1 = Insert[col1x, finalListHeadings, {{1}, {-1}}];&#xD;
     &#xD;
     col2x = portAtTime[listDate[[h]]];&#xD;
     col2 = Insert[col2x, portfolioAtTimeHeadings, {{1}, {-1}}];&#xD;
     &#xD;
     Rasterize[TableForm[{&#xD;
         Rasterize[listDate[[h]]],&#xD;
         Style[&#xD;
          StringJoin[&amp;#034;Portfolio&amp;#039;s value: $&amp;#034;, &#xD;
           ToString[QuantityMagnitude[portValue[listDate[[h]]]]]], 16],&#xD;
         &#xD;
         {Style[Framed[&amp;#034;Sublist from list of all Stocks, previous day&amp;#034;], &#xD;
           16],&#xD;
          &amp;#034;      &amp;#034;,&#xD;
          Style[Framed[&amp;#034;Portfolio, rebalancing day&amp;#034;], 16]},&#xD;
         &#xD;
         {col1 // TableForm,&#xD;
          &amp;#034;      &amp;#034;,&#xD;
          col2 // TableForm}&#xD;
         }, TableAlignments -&amp;gt; {Left, Top}],&#xD;
       RasterSize -&amp;gt; 2048, ImageSize -&amp;gt; 1024] // Print;&#xD;
     ]&#xD;
&#xD;
![pic04][5]&#xD;
![pic05][6]&#xD;
&#xD;
VI. Analysis of investment strategies&#xD;
--------&#xD;
Since market conditions vary with time, the investment strategies are evaluated and compared using the same set of initial inputs, which is prescribed to best represents the current market conditions:&#xD;
&#xD;
- taxRate 40%&#xD;
&#xD;
- beginDate July 01st, 2014&#xD;
&#xD;
- endDate July 01st, 2019&#xD;
	&#xD;
The function reEvaluateFunc[] simplifies the model&amp;#039;s implementation, providing both the graph of the portfolio&amp;#039;s performance and the annual return.&#xD;
&#xD;
        taxRate = 0.4;&#xD;
        initialInvest = 100.00;&#xD;
        dailyInvest = 0.00;&#xD;
        optionWholeShare = False;&#xD;
        &#xD;
        beginDate = DateObject[&amp;#034;2014-07-01&amp;#034;];&#xD;
        endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
        &#xD;
        reEvaluateFunc[sizePortfolioVar_, optionTakeVar_, timePeriodVar_, &#xD;
           export_] := &#xD;
          Module[{o = optionTakeVar, t = timePeriodVar, s = sizePortfolioVar, &#xD;
            ex = export},&#xD;
           timePeriod = t;&#xD;
           sizePortfolio = s;&#xD;
           optionTake = o;&#xD;
           &#xD;
           callFunc[];&#xD;
           callPlot[];&#xD;
           If[ex == True, callExport[]];&#xD;
           &#xD;
           {plotVal, returnVal}&#xD;
           &#xD;
           ];&#xD;
&#xD;
## a) The sorted and weighted by price strategy ##&#xD;
The  sorted and weighted by price portfolio is one of the most common and simple strategies.&#xD;
This strategy results in equal number of shares for the stocks in portfolio (almost equal actually, since price of the day before adjustment is used as weight, but portfolio value is distributed to price of adjustment day).&#xD;
&#xD;
    funcSort[x1_, x2_, x3_, x4_, x5_] := x1 ;&#xD;
    funcWeight[x1_, x2_, x3_, x4_, x5_] := x1;&#xD;
    optionEqualWeight = False;&#xD;
    &#xD;
    plota11 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plota21 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 014, False][[1]];&#xD;
    plota31 = reEvaluateFunc[60, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plota41 = reEvaluateFunc[60, &amp;#034;high&amp;#034;, 014, False][[1]];&#xD;
    &#xD;
    plota12 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plota22 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 014, False][[1]];&#xD;
    plota32 = reEvaluateFunc[60, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plota42 = reEvaluateFunc[60, &amp;#034;mid&amp;#034;, 014, False][[1]];&#xD;
    &#xD;
    plota13 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
    plota23 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 014, False][[1]];&#xD;
    plota33 = reEvaluateFunc[60, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
    plota43 = reEvaluateFunc[60, &amp;#034;low&amp;#034;, 014, False][[1]];&#xD;
&#xD;
    k = 32;&#xD;
    tabLabel = &#xD;
      Style[Framed[&#xD;
        &amp;#034;Portfolio&amp;#039;s value, comparing to S&amp;amp;P500\nSorted and Weighted by \&#xD;
    Price&amp;#034;], 1.25 k];&#xD;
    row1 = Style[Framed[&amp;#034;Base Case:\nperiod 56\nsize 10&amp;#034;], k];&#xD;
    row2 = Style[Framed[&amp;#034;\[DownArrow]period 14\nsize 10&amp;#034;], k];&#xD;
    row3 = Style[Framed[&amp;#034;period 56\n\[UpArrow]size 60&amp;#034;], k];&#xD;
    row4 = Style[Framed[&amp;#034;\[DownArrow]period 14\n\[UpArrow]size 60&amp;#034;], k];&#xD;
    col1 = Style[Framed[&amp;#034;Largest Stocks&amp;#034;], k];&#xD;
    col2 = Style[Framed[&amp;#034;Middle Stocks&amp;#034;], k];&#xD;
    col3 = Style[Framed[&amp;#034;Smallest Stocks&amp;#034;], k];&#xD;
    &#xD;
    plotLista = {&#xD;
       {&amp;#034;&amp;#034;, col1, col2, col3},&#xD;
       {row1, plota11, plota12, plota13},&#xD;
       {row2, plota21, plota22, plota23},&#xD;
       {row3, plota31, plota32, plota33},&#xD;
       {row4, plota41, plota42, plota43},&#xD;
       {&amp;#034;&amp;#034;, tabLabel, SpanFromLeft, SpanFromLeft}};&#xD;
    Rasterize[TableForm[plotLista, TableAlignments -&amp;gt; Center]]&#xD;
&#xD;
![pic06][7]&#xD;
&#xD;
For this simple investment strategy:&#xD;
&#xD;
- a longer period of adjustment - a less frequent portfolio rebalancing schedule would generally yield a significantly better return (comparing row 1 and row 2, row 3 and row 4).&#xD;
&#xD;
- independent of how the stocks are chosen (largest, middle, and smallest, with respect to the sorting criteria), the size of the portfolio does not seem to affect portfolio&amp;#039;s performance: gaining portfolios remains gaining, and losing portfolios remains losing (comparing row 1 and row 3, row 2 and row 4).&#xD;
	&#xD;
Among the twelves scenarios investigated for this investment strategy, the scenario of choosing the smallest stocks and holding them for a longer period of time seems to be nearly as profitable as passive investing in SP500 Index, yielding a 1.50 times profit, corresponding to an annual return of 4.68%.&#xD;
&#xD;
## b) The sorted by price, equally weighted strategy ##&#xD;
This investment strategy is very similar to its cousin above: instead of equal number of share, each stock in the portfolio receive an equal amount of investment.&#xD;
&#xD;
    funcSort[x1_, x2_, x3_, x4_, x5_] := x1;&#xD;
    funcWeight[x1_, x2_, x3_, x4_, x5_] := x1;&#xD;
    optionEqualWeight = True;&#xD;
    &#xD;
    plotb11 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plotb12 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plotb13 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
&#xD;
    k = 32;&#xD;
    tabLabel = &#xD;
      Style[Framed[&#xD;
        &amp;#034;Portfolio&amp;#039;s value, comparing to S&amp;amp;P500\nSorted by Price, Equally \&#xD;
    Weighted&amp;#034;], 1.25 k];&#xD;
    row1 = Style[Framed[&amp;#034;period 56\nsize 10&amp;#034;], k];&#xD;
    col1 = Style[Framed[&amp;#034;Largest Stocks&amp;#034;], k];&#xD;
    col2 = Style[Framed[&amp;#034;Middle Stocks&amp;#034;], k];&#xD;
    col3 = Style[Framed[&amp;#034;Smallest Stocks&amp;#034;], k];&#xD;
    &#xD;
    plotListb = {&#xD;
       {&amp;#034;&amp;#034;, col1, col2, col3},&#xD;
       {row1, plotb11, plotb12, plotb13},&#xD;
       {&amp;#034;&amp;#034;, tabLabel, SpanFromLeft, SpanFromLeft}};&#xD;
    Rasterize[TableForm[plotListb, TableAlignments -&amp;gt; Center]]&#xD;
&#xD;
![pic07][8]&#xD;
&#xD;
The sorted by price, equally weighted strategy performs a bit better comparing to its relative (sorted and weighted by price).&#xD;
Nevertheless, it remains inferior to passively investing in SP500 Index: it only gives an annual return of 6.78%, similar to SP500.&#xD;
&#xD;
## c) The sorted by volume, weighted by market capitalization strategy ##&#xD;
&#xD;
    funcSort[x1_, x2_, x3_, x4_, x5_] := x3;&#xD;
    funcWeight[x1_, x2_, x3_, x4_, x5_] := x2;&#xD;
    optionEqualWeight = False;&#xD;
    &#xD;
    plotc11 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plotc12 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plotc13 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
&#xD;
    k = 32;&#xD;
    tabLabel = &#xD;
      Style[Framed[&#xD;
        &amp;#034;Portfolio&amp;#039;s value, comparing to S&amp;amp;P500\nSorted by Volume, \&#xD;
    Weighted by Market Cap.&amp;#034;], 1.25 k];&#xD;
    row1 = Style[Framed[&amp;#034;period 56\nsize 10&amp;#034;], k];&#xD;
    col1 = Style[Framed[&amp;#034;Largest Stocks&amp;#034;], k];&#xD;
    col2 = Style[Framed[&amp;#034;Middle Stocks&amp;#034;], k];&#xD;
    col3 = Style[Framed[&amp;#034;Smallest Stocks&amp;#034;], k];&#xD;
    &#xD;
    plotListc = {&#xD;
       {&amp;#034;&amp;#034;, col1, col2, col3},&#xD;
       {row1, plotc11, plotc12, plotc13},&#xD;
       {&amp;#034;&amp;#034;, tabLabel, SpanFromLeft, SpanFromLeft}};&#xD;
    Rasterize[TableForm[plotListc, TableAlignments -&amp;gt; Center]]&#xD;
&#xD;
![pic08][9]&#xD;
&#xD;
This strategy is abysmal: it manages to earn significantly less than the SP500 Index, or even lose money over time.&#xD;
However, it indicates perhaps a relevant strategy of shorting (selling) these portfolios - instead of longing (buying) them - might be profitable.&#xD;
&#xD;
## d) The sorted and weighted by market capitalization strategy ##&#xD;
&#xD;
    funcSort[x1_, x2_, x3_, x4_, x5_] := x2;&#xD;
    funcWeight[x1_, x2_, x3_, x4_, x5_] := x2;&#xD;
    optionEqualWeight = False;&#xD;
    &#xD;
    beginDate = DateObject[&amp;#034;2014-07-01&amp;#034;];&#xD;
    endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
    plotd11 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plotd12 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plotd13 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
    &#xD;
    beginDate = DateObject[&amp;#034;2009-07-01&amp;#034;];&#xD;
    endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
    plotd21 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plotd22 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plotd23 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
    &#xD;
    beginDate = DateObject[&amp;#034;2004-07-01&amp;#034;];&#xD;
    endDate = DateObject[&amp;#034;2019-07-01&amp;#034;];&#xD;
    plotd31 = reEvaluateFunc[10, &amp;#034;high&amp;#034;, 056, False][[1]];&#xD;
    plotd32 = reEvaluateFunc[10, &amp;#034;mid&amp;#034;, 056, False][[1]];&#xD;
    plotd33 = reEvaluateFunc[10, &amp;#034;low&amp;#034;, 056, False][[1]];&#xD;
&#xD;
    k = 32;&#xD;
    tabLabel = &#xD;
      Style[Framed[&#xD;
        &amp;#034;Portfolio&amp;#039;s value, comparing to S&amp;amp;P500\nSorted and Weighted by \&#xD;
    Market Capitalization&amp;#034;], 1.25 k];&#xD;
    row1 = Style[Framed[&amp;#034;period 56\nsize 10\n5 years&amp;#034;], k];&#xD;
    row2 = Style[Framed[&amp;#034;10 years&amp;#034;], k];&#xD;
    row3 = Style[Framed[&amp;#034;15 years&amp;#034;], k];&#xD;
    col1 = Style[Framed[&amp;#034;Largest Stocks&amp;#034;], k];&#xD;
    col2 = Style[Framed[&amp;#034;Middle Stocks&amp;#034;], k];&#xD;
    col3 = Style[Framed[&amp;#034;Smallest Stocks&amp;#034;], k];&#xD;
    &#xD;
    plotListd = {&#xD;
       {&amp;#034;&amp;#034;, col1, col2, col3},&#xD;
       {row1, plotd11, plotd12, plotd13},&#xD;
       {row2, plotd21, plotd22, plotd23},&#xD;
       {row3, plotd31, plotd32, plotd33},&#xD;
       {&amp;#034;&amp;#034;, tabLabel, SpanFromLeft, SpanFromLeft}};&#xD;
    Rasterize[TableForm[plotListd, TableAlignments -&amp;gt; Center]]&#xD;
&#xD;
![pic09][10]&#xD;
&#xD;
Theoretically, this strategy looks wonderful for stocks of small market capitalization: an annual return of 15.8% is impressive.&#xD;
It consistently performs significantly better than SP500 Index over different time frame (data not shown): 5, 10, 15 years till today.&#xD;
However, the strategy&amp;#039;s consistent performance instills doubts of systematic errors, either in the model itself or in the input data (as discussed in the next section). &#xD;
&#xD;
VII. Discussion&#xD;
--------&#xD;
&#xD;
A versatile computation model for portfolio&amp;#039;s performance was derived, which allows investment strategies to be analyzed and quantified. The model shows that a less frequently adjusted portfolio seems to perform better, supporting the buy-and-hold tactic. The model also indicate that the size of the portfolio does not exert a strong effect on the strategy&amp;#039;s overall performance.&#xD;
&#xD;
Generally, the model suggests that portfolios of small stocks (with respect to the sorting criteria) seem to outperform portfolios of larger stocks.&#xD;
&#xD;
There are two know systematic errors regarding the input data, which may significantly distort the results the model provided:&#xD;
&#xD;
- The stocks in Entity Class SP500 are the current components of the Standard and Poor 500 Index. Since the composition of SP500 changes over time, some of these stocks might not be included in the index until recently. As SP500 signifies large, successful companies, choosing the stocks that would be in SP500 in the future, but not at the time of portfolio rebalancing, would result in survivor bias. The same is true for excluding stocks that were in SP500 in the past, but is no longer a component of the index (for example, Enron). This survivor bias is expected to be much less significant with recent time period (e.g. past 5 years), comparing to more distant time period (e.g. past 10, 15 years).&#xD;
&#xD;
- At least one stock received insufficient property, which affects how the stocks are chosen and weighed: as of 2019-07-28, the FinancialData[] call for Loews, &amp;#034;NYSE:L&amp;#034;, only provide a timeseries of price up to 2013-11-05, which means price after that day is erroneous (due to missing value and interpolation), as shown in the block of codes below.&#xD;
&#xD;
        FinancialData[Entity[&amp;#034;Financial&amp;#034;, &amp;#034;NYSE:L&amp;#034;], &amp;#034;Price&amp;#034;]&#xD;
        FinancialData[Entity[&amp;#034;Financial&amp;#034;, &amp;#034;NYSE:L&amp;#034;], &amp;#034;Price&amp;#034;, All][&amp;#034;LastValue&amp;#034;]&#xD;
        FinancialData[Entity[&amp;#034;Financial&amp;#034;, &amp;#034;NYSE:L&amp;#034;], &amp;#034;Price&amp;#034;,&#xD;
                      {2013-01-01, 2019-07-01}]&#xD;
&#xD;
Just For Fun&#xD;
--------&#xD;
![just for fun][11]&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic01.png&amp;amp;userId=1707333&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic01.png&amp;amp;userId=1707333&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic02.png&amp;amp;userId=1707333&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic03.png&amp;amp;userId=1707333&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic04.png&amp;amp;userId=1707333&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic05.png&amp;amp;userId=1707333&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic06.png&amp;amp;userId=1707333&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic07.png&amp;amp;userId=1707333&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic08.png&amp;amp;userId=1707333&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=pic09.png&amp;amp;userId=1707333&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2019-07-09photoforpresentation.PNG&amp;amp;userId=1707333</description>
    <dc:creator>Nam Tran</dc:creator>
    <dc:date>2019-07-11T16:21:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1263219">
    <title>Use Wolfram Finance for regions other than US?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1263219</link>
    <description>Hi, new to wolfram here. I&amp;#039;ve just found out that Wolfram has this intuitive Finance platform (database from Bloomberg). Is it possible to use Wolfram Finance to compute/analyze data for regions other than the US? Would appreciate if someone can show me how.</description>
    <dc:creator>Yu Qing Lim</dc:creator>
    <dc:date>2018-01-10T14:52:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/540228">
    <title>Financial data from Quandl in Wolfram Language using QuandlLink</title>
    <link>https://community.wolfram.com/groups/-/m/t/540228</link>
    <description>QuandlFinancialData in QuandlLink package allows us to get financial data in Mathematica from Quandl. Please visit https://www.quandl.com to find out more about all open/free data as well as premium data that can be downloaded from them. The website also contains the limitation on how much data you can download.&#xD;
&#xD;
It is recommended to sign up for a free Quandl API key to download data from Quandl.&#xD;
&#xD;
Please go to following link to download QuandlLink package and for the installation instructions:&#xD;
&#xD;
   https://github.com/bajracha71/Quandl-Mathematica-QuandlLink&#xD;
&#xD;
Some of the Free Data source include:&#xD;
&#xD;
 1. US Federal Reserve Data Releases&#xD;
 2. US Treasury&#xD;
 3. Chicago Mercantile Exchange Futures Data&#xD;
 4. EUREX Futures Data&#xD;
 5. Google Finance&#xD;
 6. Yahoo Finance&#xD;
&#xD;
Please go to following link to find for complete list of databases available in Quandl:&#xD;
&#xD;
 - Free Databases: https://www.quandl.com/search?type=free &#xD;
 - Premium Databases: https://www.quandl.com/search?type=premium&#xD;
&#xD;
Examples:&#xD;
&#xD;
    Needs[&amp;#034;QuandlLink`&amp;#034;]&#xD;
    In[3]:= dowJones = &amp;#034;YAHOO/INDEX_DJI&amp;#034;;&#xD;
    dowJonesData = &#xD;
     QuandlFinancialData[dowJones, startDate -&amp;gt; &amp;#034;2015-05-01&amp;#034;, &#xD;
      endDate -&amp;gt; &amp;#034;2015-06-01&amp;#034;]&#xD;
    &#xD;
    Out[3]= {{{Date}, {Open, High, Low, Close, Volume, &#xD;
       Adjusted Close}}, {{2015, 5, 1}, {17859.3, 18028.9, 17859.3, &#xD;
       18024.1, 9.17*10^7, 18024.1}}, {{2015, 5, 4}, {18026., 18133.8, &#xD;
       18026., 18070.4, 8.601*10^7, 18070.4}}, {{2015, 5, 5}, {18062.5, &#xD;
       18086., 17905.7, 17928.2, 9.534*10^7, 17928.2}}, {{2015, 5, &#xD;
       6}, {17934.8, 18019.8, 17733.1, 17842., 1.0043*10^8, &#xD;
       17842.}}, {{2015, 5, 7}, {17840.3, 17973.1, 17796.9, 17924.1, &#xD;
       8.092*10^7, 17924.1}}, {{2015, 5, 8}, {17933.6, 18205.2, 17933.6, &#xD;
       18191.1, 9.496*10^7, 18191.1}}, {{2015, 5, 11}, {18187.8, 18200., &#xD;
       18089.1, 18191.1, 8.605*10^7, 18191.1}}, {{2015, 5, 12}, {18096.2, &#xD;
       18119.2, 17924.8, 18068.2, 8.927*10^7, 18068.2}}, {{2015, 5, &#xD;
       13}, {18070.4, 18132.8, 18039.2, 18060.5, 8.518*10^7, &#xD;
       18060.5}}, {{2015, 5, 14}, {18062.5, 18299.3, 18116.5, 18252.2, &#xD;
       9.158*10^7, 18252.2}}, {{2015, 5, 15}, {18252., 18272.7, 18215.1, &#xD;
       18272.6, 1.0822*10^8, 18272.6}}, {{2015, 5, 18}, {18267.3, 18325.5,&#xD;
        18244.3, 18298.9, 7.908*10^7, 18298.9}}, {{2015, 5, 19}, {18300.5,&#xD;
        18351.4, 18261.4, 18312.4, 8.72*10^7, 18312.4}}, {{2015, 5, &#xD;
       20}, {18315.1, 18350.1, 18272.6, 18285.4, 8.019*10^7, &#xD;
       18285.4}}, {{2015, 5, 21}, {18285.9, 18314.9, 18249.9, 18285.7, &#xD;
       8.427*10^7, 18285.7}}, {{2015, 5, 22}, {18286.9, 18286.9, 18217.1, &#xD;
       18232., 7.889*10^7, 18232.}}, {{2015, 5, 26}, {18229.8, 18229.8, &#xD;
       17990., 18041.5, 1.0944*10^8, 18041.5}}, {{2015, 5, 27}, {18045.1, &#xD;
       18190.4, 18045.1, 18163., 9.64*10^7, 18163.}}, {{2015, 5, &#xD;
       28}, {18154.1, 18154.1, 18066.4, 18126.1, 6.751*10^7, &#xD;
       18126.1}}, {{2015, 5, 29}, {18128.1, 18128.1, 17967.7, 18010.7, &#xD;
       1.3981*10^8, 18010.7}}, {{2015, 6, 1}, {18017.8, 18105.8, 17982.1, &#xD;
       18040.4, 8.564*10^7, 18040.4}}}&#xD;
&#xD;
Documentation on how to use QuandlFinancialData can be found in the package. &#xD;
&#xD;
    &amp;lt;&amp;lt;QuandlLink`&#xD;
    ?QuandlFinancialData&#xD;
&#xD;
&#xD;
  [1]: https://github.com/bajracha71/Quandl-Mathematica-QuandlLink</description>
    <dc:creator>Anmol Bajracharya</dc:creator>
    <dc:date>2015-07-31T15:34:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1008389">
    <title>Get data coverage of bloomberg link using finance platform?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1008389</link>
    <description>I have a difficulty in getting worldwide data usng &amp;#034;FinancialData[*]&amp;#034; of mathematica because most of data are ommitted in spite of its existencs. &#xD;
1) what is the reason?  from which database does &amp;#034;FinancialData[]&amp;#034; get data? How can i get permission about missing data ? &#xD;
2) if i use buy and use &amp;#039;finance platform&amp;#039; as additional package, can i solve this missing data problem? &#xD;
3) How much is the data coverage of Bloomberglink of &amp;#039;finance platform&amp;#039; ? Can i get time series of world-wide real estate(mortgaged house) price through Bloomberglink ?</description>
    <dc:creator>bongjoon kim</dc:creator>
    <dc:date>2017-02-05T04:01:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/925032">
    <title>FinancialDerivative: American vs. European Call</title>
    <link>https://community.wolfram.com/groups/-/m/t/925032</link>
    <description>To my knowledge, the American call option on a non-dividend paying stock has the same value as the European call option.&#xD;
&#xD;
Why does it happen then that according to *Mathematica* they are not equal?&#xD;
&#xD;
    FinancialDerivative[{&amp;#034;European&amp;#034;, &amp;#034;Call&amp;#034;}, {&amp;#034;StrikePrice&amp;#034; -&amp;gt; 100.00, &amp;#034;Expiration&amp;#034; -&amp;gt; 1},  &#xD;
        {&amp;#034;InterestRate&amp;#034; -&amp;gt; 0.03, &amp;#034;Volatility&amp;#034; -&amp;gt; 0.2, &amp;#034;CurrentPrice&amp;#034; -&amp;gt; 100, &amp;#034;Dividend&amp;#034; -&amp;gt; 0.0}]&#xD;
            &#xD;
    Out[5]= 9.4134&#xD;
&#xD;
---&#xD;
    &#xD;
    FinancialDerivative[{&amp;#034;American&amp;#034;, &amp;#034;Call&amp;#034;}, {&amp;#034;StrikePrice&amp;#034; -&amp;gt; 100.00, &amp;#034;Expiration&amp;#034; -&amp;gt; 1},  &#xD;
        {&amp;#034;InterestRate&amp;#034; -&amp;gt; 0.03, &amp;#034;Volatility&amp;#034; -&amp;gt; 0.2, &amp;#034;CurrentPrice&amp;#034; -&amp;gt; 100, &amp;#034;Dividend&amp;#034; -&amp;gt; 0.0}]&#xD;
        &#xD;
    Out[5]= 9.24515&#xD;
&#xD;
***&#xD;
Next question:&#xD;
&#xD;
The numbers of &amp;#034;Steps&amp;#034; in the following specification is some sort of placebo, right?&#xD;
&#xD;
    FinancialDerivative[{&amp;#034;American&amp;#034;, &amp;#034;Call&amp;#034;}, {&amp;#034;StrikePrice&amp;#034; -&amp;gt; 100.00, &#xD;
    &amp;#034;Expiration&amp;#034; -&amp;gt; 1},  {&amp;#034;InterestRate&amp;#034; -&amp;gt; 0.03, &amp;#034;Volatility&amp;#034; -&amp;gt; 0.2, &#xD;
    &amp;#034;CurrentPrice&amp;#034; -&amp;gt; 100, &amp;#034;Dividend&amp;#034; -&amp;gt; 0.10}, Method -&amp;gt; &amp;#034;Binomial&amp;#034;, &#xD;
    &amp;#034;Steps&amp;#034; -&amp;gt; 200]</description>
    <dc:creator>Sandu Ursu</dc:creator>
    <dc:date>2016-09-16T02:19:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/495628">
    <title>BloombergLink Connectivity</title>
    <link>https://community.wolfram.com/groups/-/m/t/495628</link>
    <description>Hi, &#xD;
I purchased the Finance Platform to get Bloomberg connectivity....when it works its great, but it is very intermittent, and half of the time the connectivity does not work.  I have tried everything, e.g. starting Bloomberg before the mathematica kernel, rebooting etc.  Does anyone else have similar issues?</description>
    <dc:creator>Vineer Bhansali</dc:creator>
    <dc:date>2015-05-12T17:31:27Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/573427">
    <title>Why almost all tutorials are charged?</title>
    <link>https://community.wolfram.com/groups/-/m/t/573427</link>
    <description>Even the tutorial book &amp;#034;Hands-On Start to Wolfram Mathematica&amp;#034; are so expensive...&#xD;
&#xD;
I think it would be easier for the community to be prosperous if all the contents are easily accessible.</description>
    <dc:creator>ying zhang</dc:creator>
    <dc:date>2015-10-01T05:12:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/506000">
    <title>Interface to TD Ameritrade  API ?</title>
    <link>https://community.wolfram.com/groups/-/m/t/506000</link>
    <description>Has anyone ever tried to interface to the TD Ameritrade API and obtain realtime level II data or even execute trades?  This would be some interest for me.</description>
    <dc:creator>Kay Herbert</dc:creator>
    <dc:date>2015-05-29T01:42:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/476154">
    <title>How do I implement this multidimensional chained prediction option(s)?</title>
    <link>https://community.wolfram.com/groups/-/m/t/476154</link>
    <description>I want to implement multidimensional chained prediction market options to be sold online as smart digital contracts. These chained options/contracts will be time-sensitive i.e. they will evolve with time and be linked to real-time data resources like quandl.com, https://blockchain.info/api/exchange_rates_api and http://www.xignite.com/xNews.xml/GetMarketNewsHeadlines. Please find the PDF file attached here describing a multidimensional contract with multiple decisions, states and dimensions. Which matrix functions, variables and superfunctions should I use? Please help.</description>
    <dc:creator>Aryan Howl</dc:creator>
    <dc:date>2015-04-09T13:36:16Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/474096">
    <title>Strange IRR results</title>
    <link>https://community.wolfram.com/groups/-/m/t/474096</link>
    <description>I am trying to calculate the IRR over time for a series of values.  I am seeing weird results in 1 or 2 of the values. I have created a notebook which shows what I am experiencing - here&amp;#039;s the output... the 3rd and 7th value is wrong.  What am I doing wrong?&#xD;
&#xD;
-92.6077&#xD;
-87.2071&#xD;
-117.452&#xD;
-76.0161&#xD;
-70.8105&#xD;
-65.9989&#xD;
-135.724&#xD;
-57.5769&#xD;
-53.9218&#xD;
-50.5947&#xD;
-47.5632&#xD;
-44.7965&#xD;
-42.2667&#xD;
-39.949&#xD;
-37.8211&#xD;
-35.8634&#xD;
-34.0589&#xD;
-32.3926&#xD;
-164.534&#xD;
-29.4238&#xD;
-28.0997&#xD;
-26.8701&#xD;
-25.7268&#xD;
-24.6627&#xD;
-23.6714&#xD;
-22.7472&#xD;
-21.8852</description>
    <dc:creator>Tim Heger</dc:creator>
    <dc:date>2015-04-06T01:47:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/426798">
    <title>FinancialData - Why are the daily rate EUR vs. USD not working anymore?</title>
    <link>https://community.wolfram.com/groups/-/m/t/426798</link>
    <description>Hi Community friends,&#xD;
I&amp;#039;m currently working on a code but the financial data of USD vs. EUR gives an error by missing data. As example see attached the FinanceData.nb. file.&#xD;
Plesae could you help?&#xD;
Your support will be highly appreciated !&#xD;
Jos</description>
    <dc:creator>Jos Klaps</dc:creator>
    <dc:date>2015-01-23T21:31:22Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/408719">
    <title>FinancialData indices not functioning</title>
    <link>https://community.wolfram.com/groups/-/m/t/408719</link>
    <description>`DateListLogPlot[FinancialData[&amp;#034;^DJI&amp;#034;, All]]`  returns  `DateListLogPlot[Missing[&amp;#034;NotAvailable&amp;#034;]]`&#xD;
&#xD;
I tried with several other common indices but none of them are currently available. Is this a disabled feature?</description>
    <dc:creator>Bruce Butler</dc:creator>
    <dc:date>2014-12-16T18:44:56Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/389388">
    <title>FinancialData for Goldman Sachs give incorrect historical results</title>
    <link>https://community.wolfram.com/groups/-/m/t/389388</link>
    <description>Although `FinancialData` gives the correct result for the current stock price:&#xD;
&#xD;
    In[49]:= FinancialData[&amp;#034;GS&amp;#034;]&#xD;
    &#xD;
    Out[49]= 190.002&#xD;
&#xD;
If (at least as of today), one asks for historical data the results are completely wrong.  E.g.:&#xD;
&#xD;
    In[50]:= FinancialData[&amp;#034;GS&amp;#034;, {{2014, 11, 10}, Today}]&#xD;
    &#xD;
    Out[50]= {{{2014, 11, 10}, 25.58}, {{2014, 11, 11}, &#xD;
     25.58}, {{2014, 11, 12}, 25.63}, {{2014, 11, 13}, 25.68}}&#xD;
&#xD;
Note that **Wolfram|Alpha** gives a correct time series graph, and the Yahoo site (which is the **API** that `FinancialData` uses) gives the correct values.</description>
    <dc:creator>David Reiss</dc:creator>
    <dc:date>2014-11-14T18:04:31Z</dc:date>
  </item>
</rdf:RDF>

