Skip to main content

Questions tagged [finance]

Finance is for anything related to currency, payment systems, credit card number validation, etc.

Filter by
Sorted by
Tagged with
1 vote
2 answers
49 views

Calculating the total value of an invoice with precision

I have written some functions to calculate the total cost of an invoice, gives its line items. Could someone please tell me if there seems to be a problem with the code? Since it is something as ...
Enrique Moreno Tent's user avatar
10 votes
2 answers
1k views

A simple Python class designed to facilitate investment portfolio analysis

Background In an attempt to learn a bit more about investing and economics, I've begun writing a simple historical portfolio analysis tool in Python. The ...
IntegerEuler's user avatar
6 votes
3 answers
302 views

edgar: Programmatic access to SEC's Edgar API in Python / via command-line

As indicated in the title, this small project fetches content from the SEC's Edgar REST API. It was designed with the intention of automatically gathering/refreshing large datasets of public company ...
Ryan's user avatar
  • 61
2 votes
1 answer
195 views

OrderBook Implementation - Follow up

This is a follow up to my previous implementation: The input is of the format ...
Avengerx9's user avatar
2 votes
2 answers
289 views

Design decisions for an efficient OrderBook

I am designing code for OrderBook based in C++, based on STL library. Note that there is a related question here, however it is more simple - it does not support deletion of orders, and I intend to ...
Avengerx9's user avatar
0 votes
1 answer
50 views

Aggregate transactions in slips

I wrote code to aggregate transactions in slips. I'm concerned with the performance of my code because it uses 3 loops that are nested so the time complexity will be cubic. This code won't scale well ...
bit's user avatar
  • 143
2 votes
2 answers
612 views

Fast OrderBook Implementation - Follow Up

Following up from: Fast OrderBook Implementation Here is the updated version (I've also implemented some extra functionality) ==> Order.hpp <== ...
jpf's user avatar
  • 63
4 votes
2 answers
2k views

Fast OrderBook Implementation

I'm creating a simple yet fast OrderBook, that only adds orders and matches them (no cancelling or modifications, etc.). I'm using partial template specialization to reduce branching in the hotpath, ...
jpf's user avatar
  • 63
1 vote
1 answer
66 views

Fixing math library functions in Black-Scholes options pricing model

I've amended a code for the Black-Scholes formula for European pricing options found here at the bottom of the page and fixed the math functions accordingly. Unlike the code on the website, mine has ...
Jessie's user avatar
  • 113
4 votes
2 answers
545 views

Geektrust coding challenge: simulating a marketplace for loans

This is the my solution to a coding challenge in Geektrust. The question is linked here. A shortened version would be as follows. The aim is to simulate a marketplace for banks to lend money to ...
SATW's user avatar
  • 43
3 votes
2 answers
106 views

Parse the weekly menus of a German delivery service

I am a C# beginner, and I wrote a program that parses the weekly menu of a German delivery service. It works fine and I think the code quality is okay. Can anyone with more experience than me review ...
user avatar
2 votes
1 answer
271 views

Heston model implementation in C++

I have implemented an option pricing algorithm following the Heston model. The simulation involves specifying the number of simulations, then generating a discretized path for each simulation (code ...
MattA's user avatar
  • 23
2 votes
2 answers
3k views

Calculating Discount C++

The following question is from the book Problem Solving With C++. This is given as an exercise in the chapter "Functions for all subtasks": Write a function that calculates a discount ...
Strange Alchemist's user avatar
1 vote
2 answers
115 views

Refactoring legacy java banking code

Hey i have some legacy code i'm working on (It is open source so no problem in me sharing it!). I wanted to refactor some parts in the extractResult method since it ...
Saltuk Kezer's user avatar
4 votes
1 answer
470 views

C++ bond mathematics calculator

I have written a program in C++ that processes financial bond mathematics, making extensive use of the valarray class, so that mathematical functions and operations ...
Giogre's user avatar
  • 331
3 votes
3 answers
2k views

Simple credit card validation with Luhn's Algorithm

Originally written in C (which was abysmal, you may check here if you want), I rewrote my simple credit card validation program using Python ...
flamethrower10's user avatar
1 vote
0 answers
78 views

quant. code. to calculate trend, momentum, correlation and volatility in Pandas(Python)

I am new to quant. finance and trying to calculate trend, momentum, correlation and ...
DDStackoverflow's user avatar
5 votes
0 answers
54 views

Compute a Working Capital Loan

This code takes a list of EBITDA amounts (for a hypothetical business), and computes a loan that would fund that business with working capital in periods of loss. When the business has positive EBITDA ...
lbseale's user avatar
  • 51
1 vote
1 answer
408 views

A Credit Payment Calculator

So I've attempted this project from hyperskills where you're asked to make a calculator script that can calculate annuity and differentiated payments given that 3 of 4 values are known. I think i went ...
Anonymous's user avatar
  • 1,224
4 votes
0 answers
139 views

Model profit/loss of a time series of financial position state changes

I'm newly exploring time series databases, and trying to wrap my head around what data I'll store and how I'll query it. Also, I'm relatively new to TypeScript. This prototype exercises my current ...
feuGene's user avatar
  • 363
4 votes
0 answers
58 views

Analyze Stock Market Bottom Timing without Looping over Data Frame Rows

I am replicating this blog post in Python. The blog post shows that even if you know future stock market bottoms, only buying stocks when the stock market is below future stock market bottoms provides ...
Richard Herron's user avatar
5 votes
1 answer
54 views

Calculate quote volumes (for a financial instrument) within numeric constraints

The function below is part of a trading system. Its purpose is to assign a volume (order size) to a bid (buy) quote and and ask (sell) quote, depending on the value of the ...
s_dbq's user avatar
  • 83
4 votes
0 answers
53 views

Get Asset Returns for multiple Tickers and Holding Periods

I've written some code that will take multiple stock tickers and calculate their returns over yearly, monthly, bi-weekly, and weekly holding periods. The results are written to an xlsx file. I'm ...
Dumbledore__'s user avatar
5 votes
2 answers
1k views

Calculating the necessary contribution to attain a savings goal with compound interest

This is a problem set from the MIT online course : Suppose you want to set a particular goal, e.g. to be able to afford the down payment in three years. How much should you save each month to ...
Elbasel's user avatar
  • 602
4 votes
2 answers
2k views

Pulling financial data via IEX Cloud API

I am pulling some financial data from the IEX Cloud API. Since it is a paid API w/ rate limits, I would like to do this as efficiently as possible (i.e., as few calls as possible). Given that the <...
user53526356's user avatar
0 votes
2 answers
18k views

Income tax calculator [closed]

I've just started coding and have written a program to calculate your tax to be paid. Is there anywhere where I can improve this? ...
AMG_'s user avatar
  • 81
1 vote
1 answer
50 views

Return timeframes relevant to just-elapsed time period (financial/trading context)

I am writing trading software, and have written this utility function. Its purpose is to return a list of timeframes relevant to the just-elapsed time period. "Timeframe" here means bar or candle ...
s_dbq's user avatar
  • 83
6 votes
2 answers
291 views

Asynchronous IBAN API with validation

I am working on an iban api which is about saving the iban of some members after (iban validation) in a database. The code is split between Domain (entities, behaviour for iban validation), Database ...
Natalie Perret's user avatar
4 votes
1 answer
132 views

Simple income/expenses accounting program

I've decided to start working on a budget application for the purposes of getting started on Rust. In its current form this program takes given expenses and income and tells the user whether they have ...
strangethingspy's user avatar
3 votes
1 answer
782 views

Python maintain precision for currency

Working with currencies I am aware it is not good to work with floating point values due to rounding and maintaining precision. Better is to work with integers. Would the following Currency class make ...
Bruno Vermeulen's user avatar
2 votes
2 answers
2k views

Loan repayment calculator

I am having some trouble figuring out how to modularize this code without rewriting it entirely. I know I should be able to break it up into modules for main, gathering info, doing calculation and the ...
Eight's user avatar
  • 21
1 vote
1 answer
188 views

Simple calculation of sector coefficients using PHP

Function This class extends the key class, called EQ, and does basic calculation based on minutely data. It then calculates weight coefficients (e.g., [0, 1]) for ...
Emma's user avatar
  • 3,527
3 votes
1 answer
95 views

Mortgage calculator with Swing for Helsinki MOOC

New to Java, just finished the Helsinki MOOC course. I programmed a basic mortgage calculator as my first solo project and while it works, I have a few questions about coding style: The listener and ...
JeremiahDixon's user avatar
3 votes
1 answer
517 views

Tracking stock prices using Python and Google Sheets

The purpose of this program is to keep track of some stocks that we bought in a game and every week we must list the closing prices of each stock in a Google Sheet. I thought since I had a lot of ...
Tommy's user avatar
  • 143
5 votes
2 answers
5k views

OOP bank account program in Python 3

Python beginner here. Building an OOP bank account program with SQLite and starting to struggle a bit with its design. From a design standpoint I have a file (bank) which calls ATM. ATM simulates an ...
anfield's user avatar
  • 173
0 votes
2 answers
4k views

Loan calculator in C

I wanted to create a loan calculator, but the code I could think of was using 3 functions, and calling them and getting result. But I felt it was easy but bad code because I thought this can be ...
heeat's user avatar
  • 23
0 votes
1 answer
877 views

Predicting credit card default

I have this code for predicting credit card default and it works perfectly, but I am checking here to see if anybody could make it more efficient or compact. It is pretty long though, but please bear ...
Death Exploit's user avatar
1 vote
1 answer
314 views

Python 'Cashflow' object

In the code shown below, I have created 3 classes. The first of these are an 'Payment' class and a 'Annuity' class, which allow the user to create objects representing individual or recurring payments ...
M Smith's user avatar
  • 147
0 votes
2 answers
294 views

Python 'interest rate' object

I have only recently started learning python and the below is my attempt to create an 'interest rate' object which, given one of several types of interest/discount rate, gives the user access to all ...
M Smith's user avatar
  • 147
1 vote
1 answer
275 views

Renting vs. owning comparison calculation

I have working code that compares rental prices and owning costs, given some parameters. It works, but it surely does not look good. I hadn't worked with time-series before and I wonder how I could ...
B Furtado's user avatar
  • 133
2 votes
2 answers
75 views

The importance of consistency in percentage returns when investing

It is said that Being consistent in percentage annual returns leads to larger amount over time. That is for any given principal, getting 20% successively for 2 years is better than 30% for first ...
kamalbanga's user avatar
-1 votes
1 answer
912 views

Compound interest calculator homework [closed]

I am a beginner at coding Java and am having a tough time understanding what is wrong with this code. This is an assignment I had posted about earlier and I also went to a Java tutor at my school for ...
Tori's user avatar
  • 1
7 votes
3 answers
1k views

Reversible tax calculator class

I have a class that contains 2 properties of the same type. decimal NetAmount and decimal GrossAmount I would like to ...
Konrad's user avatar
  • 227
3 votes
2 answers
4k views

JavaScript interest rate calculator

As I am still new to web development, refactoring my code is still something that gives me some trouble. I would really appreciate it if someone could look over the Javascript for an interest rate ...
Eric R.'s user avatar
  • 33
2 votes
1 answer
1k views

Profit Margin Calculator in Python (with installments)

I was sent here from StackOverflow to get some insight on how I can improve my code. I'm a beginner and the program is not streamlined at all. What the program does: Takes an input of the Retail ...
Jakub's user avatar
  • 23
6 votes
1 answer
987 views

Calculate implied volatility for options on stocks and futures with two models

I wrote a code for a quant finance job and they told me that, besides it worked, it was poorly written. I asked for a more detailed feedback but they did not send it to me. I paste it here with ...
spec3's user avatar
  • 165
2 votes
1 answer
187 views

Kids bank account in Clojure

I'm learning clojure. A while back I made a python bank account for my kids, teaching them to save. Have a look here. The Python one was a class and it created a table that had a little interest ...
manandearth's user avatar
7 votes
2 answers
2k views

Bank Management System

I'm new to C++ and wrote this Bank Management System app. It's one of the projects that everyone does as a beginner. This app runs perfectly so far. I tried to use OOP and encapsulation in this app. ...
A J's user avatar
  • 478
1 vote
1 answer
250 views

Currency exchange app

I'm making a currency exchange app, it works as follows: User types in on desired currency input and the rest of the input fields change with state based on the currency value from the input used, I'...
ricardoNava's user avatar
4 votes
1 answer
4k views

A little stock market game in Python

This is a stock market game I made in Python a while ago, and I wanted to go ahead and share it on here. If you are wondering, the reason why there is only 2 stocks is due to the fact that creating a ...
Colea's user avatar
  • 349

1
2 3 4 5 6