finance

Applications using Decimal versus double . .

孤人 提交于 2019-11-30 14:21:00
I wanted to see if folks were using decimal for financial applications instead of double. I have seen lots of folks using double all over the place with unintended consequences . . Do you see others making this mistake . . . We did unfortunately and we regret it. We had to change all doubles to decimals. Decimals are good for financial applications. You can look at this article A Money type for the CLR : A convenient, high-performance money structure for the CLR which handles arithmetic operations, currency types, formatting, and careful distribution and rounding without loss. Yes, using float

Common strategies to deal with rounding errors in currency-intensive soft?

喜夏-厌秋 提交于 2019-11-30 12:46:25
What is your advice on: compensation of accumulated error in bulk math operations on collections of Money objects. How is this implemented in your production code for your locale? theory behind rounding in accountancy. any literature on topic. I currently read Fowler . He mentions Money type, it's typcal structure (int, long, BigDecimal), but says nothing on strategies. Older posts on money-rounding ( here , and here ) do not provide a details and formality I need. Thoughts I found in the inet relate to "Round half even" as the best way to balance error. Thanks for help. There are many

Financial technical analysis in python [closed]

爱⌒轻易说出口 提交于 2019-11-30 10:05:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Do you know if there is any financial technical analysis module available for python ? I know Numpy has a little but I'm looking for classic technical indicators like RSI , Macd, EMA and so on. Was wondering if they existed as part of a module. 回答1: Here are a few thoughts... I have only used Numpy, Scipy, and

Need an API to find a full company name given a ticker symbol [closed]

别等时光非礼了梦想. 提交于 2019-11-30 09:36:29
I need a way from within client-side Javascript to find a full company name given a ticker symbol. I am aware of Yahoo Finance's interface at: http://finance.yahoo.com/d/quotes.csv?s=TKR&f=n and am able to access that via YQL (since this is cross-domain). However, that doesn't return the full company name, yet Yahoo Finance has such because it appears in their charts for the company and on their pages about the company. I don't need for the solution to be via Yahoo Finance... just mention it here as I already know about it (and am accessing it for other data). One of the community-provided YQL

How do these people avoid creating any garbage?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 08:24:12
Here's an interesting article that I found on the web. It talks about how this firm is able to parse a huge amount of financial data in a managed environment, essentially by object reuse and avoiding immutables such as string. They then go on and show that their program doesn't do any GC during the continuous operation phase. This is pretty impressive, and I'd like to know if anyone else here has some more detailed guidelines as to how to do this. For one, I'm wondering how the heck you can avoid using string, when blatently some of the data inside the messages are strings, and whatever client

Finance Lib with portfolio optimization method in python

一曲冷凌霜 提交于 2019-11-30 07:32:11
I'm looking for a finance library in python which offers a method similar to the MATLAB's portalloc . It is used to optimize a portfolio. Binary Phile If you know linear algebra, there is a simple function for solving the optimization problem which any library should support. Unfortunately, it's been so long since I researched it I can't tell you the formula nor a library that supports it, but a little research should reveal it. The main point is that any linear algebra library should do. Update: Here's a quote from a post I found. Some research says that "mean variance portfolio optimization"

Overlapping Dates in Candlestick Plot from a Pandas DataFrame

ぃ、小莉子 提交于 2019-11-30 05:09:26
I have a pandas dataframe output as follows Open High Low Close 2016-06-01 69.60 70.20 69.44 69.76 2016-06-02 70.00 70.15 69.45 69.54 2016-06-03 69.51 70.48 68.62 68.91 2016-06-04 69.51 70.48 68.62 68.91 2016-06-05 69.51 70.48 68.62 68.91 2016-06-06 70.49 71.44 69.84 70.11 I've used the following code to make the candlestick plot: import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker from matplotlib.finance import candlestick_ohlc import matplotlib.dates as mdates import datetime as dt #Reset the index to remove Date column from index df

Programmatically access Currency Exchange Rates from Yahoo Finance by Date

旧城冷巷雨未停 提交于 2019-11-30 04:58:38
I found the answer to this question VERY useful , but I would like to also get exchange rates for dates in the past, not just today's exchange rates. I'm writing an iPhone app that uses the exchange rate to calculate money made from sales in different countries. Here's the example from the answer mentioned above to get today's echange rate for GBP to EUR: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv Does anyone know how to do this for any other dates? THANK YOU! To retrieve historical data of currency exchange rates, you can't use Yahoo Finance. Their API only

Holiday files for G20 countries [closed]

浪尽此生 提交于 2019-11-30 01:27:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . For proper financial FX option pricing I require the exact number of business days between two dates. These dates can be up to 10 years in the future, for 2 different countries. I therefore need to know, in advance the holidays for both of those countries between the two dates. I plan to restrict myself to G20

How to efficiently calculate a moving Standard Deviation

穿精又带淫゛_ 提交于 2019-11-30 01:04:04
Below you can see my C# method to calculate Bollinger Bands for each point (moving average, up band, down band). As you can see this method uses 2 for loops to calculate the moving standard deviation using the moving average. It used to contain an additional loop to calculate the moving average over the last n periods. This one I could remove by adding the new point value to total_average at the beginning of the loop and removing the i - n point value at the end of the loop. My question now is basically: Can I remove the remaining inner loop in a similar way I managed with the moving average?