All Questions
67
questions
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 ...
6
votes
3
answers
301
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 ...
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 ...
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 ...
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
...
1
vote
0
answers
77
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 <...
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?
...
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 ...
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 ...