Questions tagged [finance]

Finance relates to the management of assets over time under varying conditions, usually in order to make a profit.

Introduction

Finance relates to the management of assets over time under varying conditions, usually in order to make a profit.

The finance (or "financial services") industry is an umbrella term for organisations that manage money & assets. It includes businesses like banks, credit card companies, insurance companies, consumer finance companies, stock brokerages, hedge funds and investment funds and some government sponsored enterprises.

These businesses are usually subject to government regulation, often rely on global standards and interact with each other through purely electronic markets. They employ many thousands of programmers who often turn up common programming problems.

What questions should have this tag?

Programming problems specific to the finance industry, such as:

  • financial messaging standards & protocol implementations (e.g. FIX or SWIFT)
  • domain models/patterns for accounting, currency, trading & brokerage, etc.
  • application of programming techniques to financial businesses & problems (e.g. risk management, pricing, trade netting, etc.)
  • low latency, high volume/frequency trading systems
  • implementation of common mathematical problems (e.g. time value of money, compound interest, etc.)
  • management and processing of market data
  • regulatory issues as they relate to systems programming

Other relevant forums

Questions which have more of a financial background than a programming background should rather be asked at quant.stackexchange. In particular, this tag should never be used on its own but rather in combination with a programming language.

2470 questions
0
votes
2 answers

How to run script multiple times for multiple variables?

So Im trying to have this script run multiple variables from the ticker variable Example ticker = ['NFLX','APPL'] How would I be able to loop this script so that I can run it on more than one variable import requests from bs4 import…
gambo
  • 3
  • 4
0
votes
0 answers

Calculating Daily Highs and Lows with Intraday Data

I am looking to calculate daily highs and lows that are updated as they happen (intraday). Meaning that the first value of the day is taken as the high/low then updated as new highs/lows are achieved. The values should reset each day. I saw some…
dsgid
  • 1
  • 1
0
votes
2 answers

Pandas: Annualized Returns

I have a dataframe with quarterly returns of financial entities and I want to calculate 1, 3, 5 10-year annualized returns. The formula for calculating annualized returns is: R = product(1+r)^(4/N) -1 r are the quarterly return of an entity, N is…
SimonC
  • 53
  • 6
0
votes
1 answer

Find parameters from the Vasicek model

I am given the following bond: and need to fit the Vasicek model to this data. My attempt is the following: # ... imports years = np.array([1, 2, 3, 4, 7, 10]) pric = np.array([0, .93, .85, .78, .65, .55, .42]) X = sympy.symbols("a b sigma") a,…
0
votes
1 answer

Calculate Stocks biWeekly Return Standard Deviation in R

I have a very long dataset of numerous stocks for many years, similar to this one: one_ticker = tq_get("AAPL", from = "2021-06-01") one_ticker <- one_ticker %>% mutate(day = day(date), month = month(date), …
YefR
  • 369
  • 3
  • 12
0
votes
1 answer

Printing an index number of dictionary entry, PLUS it's key, plus it's value

Suppose we have the following dataframe import yfinance as yf import numpy as np import numpy_financial as npf import matplotlib.pyplot as plt from os import system import sys, time import pandas as pd import requests import…
0
votes
1 answer

Turnover Contraint not working in Portfolio Optimization with Portfolio Analytics

I am trying to perform a standard portfolio optimization, but with a constraint to how much the final weights of the portfolio are allowed to deviate from a set of initial weights. I do this with the PortfolioAnalytics package and the following code…
Quastiat
  • 1,164
  • 1
  • 18
  • 37
0
votes
1 answer

How do you convert a string percent to a float decimal?

How do you convert a string percent to a float decimal? I wrote this code and when I run it I just get back errors like "cannot convert the series to " and "TypeError: unsupported operand type(s) for /: 'str' and 'int'" the problematic…
0
votes
1 answer

Using Python to get holdings and allocation of ETFs

Referencing this old post, does anyone know how to adjust the below script to also bring in the weight(%) column? import requests import re keys = ['XLU', 'XLRE'] headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0)…
Andrew Hicks
  • 572
  • 1
  • 6
  • 19
0
votes
1 answer

SAS - Calculating the present value of future interest and amortization payments of loans

I would like to calculate the present value (PV) of future interest and amortization payments on loans (flat amortization and annuity) in a dataset. The discount rate should be the inflation e.g. 2 per cent. I have seen the finance function in SAS,…
aef
  • 35
  • 8
0
votes
3 answers

Code to identify a specific aspect inside of a database and return the number associated with that aspect?

I am relatively new to python and I am using yfinance and pandas to scrape financial data from yahoo finance. I will provide code below, but basically, I am wondering how I can get, inside of the database, a line of code that will return the number…
0
votes
1 answer

Why the function weekOfYear(2019.12.31) returns 1?

which week in the year does this function return? Why is the return of 2019.12.31 the first week? I have checked this function in dolphindb-help, and it says that "weekOfYear(X): For each element in X, return a number indicating which week of the…
Polly
  • 603
  • 3
  • 13
0
votes
1 answer

Nasdaq ITCH order book build -> EOF error when expanding '.gz' file

I'm trying my first steps in ML using Jupter's IPython, I was advised to start with Nasdaq's order book ITCH dataset to create models. I'm following the same steps in this tutorial on github. I can't seem to unzip/expand files from the ITCH dataset,…
0
votes
0 answers

Add Plaid UI into Xamarin Forms Cross platform mobile App (iOS, Android)

I'm new to working with APIs and I'm trying to recreate the app Mint using Xamarin Forms. I want to integrate Plaid's UI into my app so the user can login to their bank from there and I can retrieve all the bank data associated with it but I'm lost…
0
votes
1 answer

Pinescript, financial(FLOAT_SHARES_OUTSTANDING) value is different than its corresponding float shares screener value

in my script I plot the symbol float shares with the classic financial method: floatShares = financial(syminfo.tickerid, "FLOAT_SHARES_OUTSTANDING", "FY") For some symbols, it is different than its corresponding float shares value in the…
Link 88
  • 553
  • 8
  • 27
1 2 3
99
100