Skip to main content

# Questions tagged [finance]

Questions related to quantifying risk and the allocation of assets and liabilities over time under conditions varying uncertainty--including questions on the use of the built-in financial functions of Mathematica.

231 questions
Filter by
Sorted by
Tagged with
5 votes
2 answers
125 views

### Converting between currencies using a pair of currency codes

Mathematica can convert currencies using real time data: CurrencyConvert[Quantity[13.25, "USDollars"], "Euros"] which gives €10.8 Can I do ...
• 2,195
1 vote
0 answers
86 views

### Numerical computation of a loan and numerous parameters

I'm not an expert of Wolfram Language, but I'd like to create a simple way to solve a financial problem maybe not very straightforward as it involves numerical computation, numerous variables and a ...
• 11
0 votes
1 answer
96 views

### Calculate The Declining Balance Method For Depreciation?

I have code generated by AI Aria in Opera browser The code gives wrong answer only for: Depreciation factor=1? ...
• 14.7k
2 votes
1 answer
101 views

### Historical data of financial funds

I would like to obtain the historical data of some funds, of which I know the ISIN code. Is there any way to do this with mathematica? For example, this fund here: https://markets.ft.com/data/funds/...
1 vote
1 answer
115 views

### How to improve performance of making an Exponentially Weighted Correlation Matrix?

I would like to make an Exponentially Weighted version of Correlation (similar to https://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.ewmcov.html)....
0 votes
1 answer
80 views

### Speed up compoundReturn across an array

I am trying to calculate a moving-window of compounded returns on a large 2D-array. (ie some kind of MovingMap on geometric returns) The Rows are time-steps and the Columns are different financial ...
1 vote
0 answers
71 views

### How to Name a Path in TemporalData?

Preamble: I am working with stock prices and need to perform calculations on them. And then extract the information for further calculations. TimeSeries/...
1 vote
1 answer
141 views

### Legacy Finance package

There used to be an old package Finance which contained useful functionality for converting between different interest rate representations, ...
• 9,523
0 votes
1 answer
176 views

### How do I retrieve the SOFR (Secured Overnight Financing Rate) index/value in Mathematica?

SOFR doesn't show up in FinancialData[] (despite being a Bloomberg symbol). When I ask Wolfram|Alpha, it thinks I'm talking about "Overnight: The Movie". ...
3 votes
1 answer
51 views

### Inconsistent Timing on FinancialBond valuations

I need to do bond valuations (lots of them across lots of data) using FinancialBond. Context & Background I have daily interest rate data on 30 year US Treasury ...
• 14.5k
3 votes
0 answers
59 views

### How to leave empty space on the right in tradingchart

The Tradingchart function is very useful, although tremendously graphics heavy. For better understanding of the image I would like to leave a white space on the right but it is ignored. For example. ...
1 vote
0 answers
40 views

### CandlestickChart how to display a separate x-axis tick for every single second?

I use CandlestickChart to display some price data. The data is only 30 seconds long and contains one candle per second. I'd like the chart to display a separate ...
• 12k
0 votes
0 answers
57 views

### Can I use Timeseries of a Data to plot the ARCHProcess?

So, I have a list s={Timeseries1,Timeseries2,Timeseris3} I want to Plot a graph just like :Mathematica I tried to do this but I didn't understand some parts of the ...
3 votes
0 answers
36 views

### Is the way TimeValue[s, i, {t, t1}] works with s being a Cashflow using date expressions a bug or a feature?

The documentation for TimeValue tells us that in TimeValue[s,i,t] we can have s be a Cashflow...
• 13.5k
1 vote
0 answers
295 views

### How To Fit Heston Model To Stock Data Stochastic Volatility Model

The stochastic volatility model known as the Heston model can be expressed in Mathematica in the following way https://reference.wolfram.com/language/example/HestonModel.html Define the Ito process of ...
1 vote
1 answer
85 views

### Federal Reserve Interest Rate Data has years with differing number of weeks

I need to compute annual mean interest rates from public data. FRED mortgage rate data (available here: https://fred.stlouisfed.org/series/MORTGAGE30US) when downloaded as an Excel file, Imports as ...
• 940
4 votes
1 answer
94 views

### FinancialData anomaly

As I learned from this quantitative finance question, 1981-04-17 was a trading holiday. This is in agreement with the 0 volume in that day ...
• 1,088
3 votes
1 answer
105 views

### How To Compile The Computation Of Cumulative Returns

I'm trying to compile this function, specifically the second line which computes the cumulative return of 100 daily returns. ...
3 votes
1 answer
105 views

### How to apply color function to my financial indicator?

My goal is to make a figure like this picture in a financial indicator, I want to plot “a colored” financial indicator below a trading chart. I prepared financial data and data of my indicator: ...
1 vote
0 answers
70 views

### Irregular interval Internal Rate of Return [closed]

Does anyone know of a function that has been written that takes a list of cash flows and a list of associated dates and returns the internal rate of return? In other words a function similar to ...
• 71
3 votes
2 answers
175 views

I'm new to Mathematica and am trying to plot log-returns of a stock as a timeseries object. However, the following code gives me back elements of the form "Log[151.23$]" unevaluated. What am ... 1 vote 1 answer 94 views ### Currency Interpretation for VND Bug introduced in v12.2.0 or earlier, persisting through v13.2.1. Case number: 4973722 As I was helping an OP with a question involving Vietnamese currency, I didn't realize at the time that the ... • 56k 0 votes 1 answer 91 views ### About Internal mechanics in FinancialDerivative I want to find the price of a call option,using mathematica. However, I found a question when using Financial Derivative. The following two codes are to get the price of the call. ... • 1 2 votes 1 answer 95 views ### select the right numbers based on a condition I want to optimize my stock portfolio based on three components: the price of the different stocks the number to buy of each of the stocks the expected return of each stock (after 12 months) For ... • 2,855 1 vote 2 answers 94 views ### Rearrange a matrix with new Table Headings-List I have used a procedure to rearrange my data in a more appropriate way for data analysis such that more similar elements lie next to each other and dissimilar ones far apart. Let's say I have a 5x5 ... • 83 0 votes 0 answers 90 views ### Customize FinancialIndicator I have a set of financial data in a 5-minutes (download here) and 1-day timeframe (download here) Since the ordering of my dataset is different than the ordering taken by ... • 1,658 0 votes 2 answers 188 views ### Antithetic Variates in Monte-Carlo simulations (code taking too long to execute) I am trying to use the Antithetic Variates method to reduce error in stock price estimates. Essentially, I generate pairs of negatively correlated RV's and use them to simulate stock price. The ... 0 votes 1 answer 104 views ### List industry segment members using FinancialData [closed] I'm trying to select get price, div yield and PE ratios for a given Sector (Industrial Segment) from the LSE. At the moment I'm trying to just get a list of the companies Unfortunately my script is ... 0 votes 1 answer 202 views ### Portfolio optimization Mathematica provides codes for a portfolio optimization https://www.wolframcloud.com/objects/summerschool/pages/2017/AndresLopezMartinez_TE that do not work anymore. Any reason why? I have been trying ... 1 vote 0 answers 82 views ### How can I use TradingChart without volume data? I am trying to use the Mathematica Function TradingChart to produce a chart. I am using data produced by me for the plot and I do not have the volume data. Here is ... • 189 6 votes 2 answers 349 views ### Is there a CryptocurrencyData alternative to FinancialData? What's the easiest way to ingest time series data on cryptocurrencies into Mathematica? I'm looking for up-to-date price, volume, and other properties for both major coins and altcoins. • 3,695 4 votes 1 answer 255 views ### Doing calculations on values input in USD currency format (e.g.,$1,234.56)

I'd like to be able to copy and paste, into MMA, numbers that have a standard USD currency format, i.e., that include dollar signs and comma separators, and get the output in the same format. I'd ...
• 3,643
3 votes
2 answers
354 views

### Calculating Average Price and P&L Efficiently Without Loops

A very common task is stock portfolio evaluation is to calculate the average price of stock holdings for a sequence of trades and from there to calculate the (realized) profit or loss. Obviously one ...
• 1,334
4 votes
1 answer
108 views

### How to show net income geographically of a company in a certain city

Let's say that I have a company, and I already extracted it's net profit with time series. ...
• 241
0 votes
2 answers
95 views

### (rolling) n-weekly average

I have the data of the SPX index weekly ...
• 1,303
1 vote
2 answers
287 views

### Exporting Stock Financial Data into Excel

I would like to pull 3 attributes (Open, Close, Volume) for a variety of stock symbols. I would like to pull the stock data within a specific range and export it to an excel spreadsheet. I would also ...
• 139
1 vote
1 answer
51 views

### Index (SPX) weekly return with a condition

I am looking at statistics of the weekly returns of SPX. Taking all the weeks starting from 1st Jan 2010, the hisotgram of the returns is: ...
• 1,303
2 votes
2 answers
222 views

### How to plot a new numerical FinancialIndicator in TradingChart

I plot a trading chart by using TradingChart for early December data: ...
0 votes
0 answers
184 views

### Getting the source code of the custom indicator MESA

I would like to ask how to get the source code of a custom indicator offered by the InteractiveTradingChart function, in particular the MESA indicator (Maximum ...
2 votes
1 answer
74 views

### InteractiveTradingChart with date and time displayed for selected data

It is possible to modify TradingChart such that instead of just the date, date and time are displayed for a selected data point. Is there a "trick" that ...
• 487
3 votes
1 answer
91 views

### Manipulate InteractiveTradingChart or lazy Manipulate

Back in 2012, it seems that something like Manipulate[InteractiveTradingChart[ticker], {ticker, {"AMZN", "GOOGL"}}] worked fine. Mathematica 12....
• 487
1 vote
1 answer
114 views

### The server returned the HTTP status code 406 + how to obtain stocks data

Any solution for this: Import["https://es.investing.com/indices/germany-30-futures-\ historical-data"] not successful. The server returned the HTTP ...
• 135
2 votes
1 answer
455 views

### Overlay a line plot onto a candlestick chart?

With the command CandlestickChart one can create charts such as CandlestickChart[data] Let's say, we take the 20-period moving ...
• 12k
12 votes
2 answers
598 views

### How can I plot my financial indicator below a trading chart (produced by TradingChart) with the same x-axis?

Since this question was not answered, I would like to ask again with some additional information. I have a trading chart saved as chart1 as follows. ...
• 255
4 votes
1 answer
365 views

### Looking up Stock Symbols in Mathematica

It has been a few years since i had used Mathematica, and I know that after yahoo feed was discontinued there have been some changes to how mathematica handles financial data. Back in the day we would ...
0 votes
1 answer
131 views

### Is financial visualization broken? Can you run any of these examples or InteractiveTradingChart[] at all?

I can't run anything relevant to financial visualization in my mathematica installation, i found these interesting example but anything that use the trading chart is kind of broken. EDIT: I'll add a ...
• 189
3 votes
2 answers
587 views

### two tier compound interest problem

I am trying to make sense of how mortgage repayment figures are calculated for two tier mortgages, where you fix your interest rate for a certain period and after that period, you fall back to the SVR ...
• 701
3 votes
0 answers
102 views

### Problems with CUDAFinancialDerivative in Mathematica 12.1

I am attempting to run some CUDA functions in MMA 12.1, specifically CUDAFinancialDerivative. As I recall, this function (and other CUDA functions) ran successfully on this machine with earlier ...
• 1,334
4 votes
1 answer
101 views

### Problem with StringPosition[] and slowness of Import[] in sentiment analysis

Using the post by J. Kinlay at Market Sentiment Analysis we can employ a simple yet effective Mathematica implementation for sentiment analysis in trading. Everything is very clear and useful in the ...
• 1,817
4 votes
0 answers
64 views

### Why am I getting incorrect result from EntityClass?

Suppose I want get 6 largest companies by market capitalization. I try the class using the old syntax: ...
• 9,523