finance

getFinancials (quantmod) and tq_get (tidy quant) not working?

六月ゝ 毕业季﹏ 提交于 2019-12-02 05:48:45
问题 I'm getting the same error in both quantmod and tinyquant for financials data. Can anyone see if this is reproducable? Is this a google finance server issue? None of the below functions have been working for me.I'm not sure if it's me or the server. tq_get("AAPL", get= "financials") [1] NA Warning message: x = 'AAPL', get = 'financials': Error in thead[x]:thead[x + 1]: NA/NaN argument and: getFin("AAPL") Error in thead[x]:thead[x + 1] : NA/NaN argument Can somebody help? 回答1: Yes I get the

Calculating interest rate in PHP

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 03:53:01
I'm trying to calculate the interest on a loan given the initial loan amount, the number of repayments and the amount of repayments. I can't seem to get a close enough figure using a basic formula, so I've been trying to use the Newton Raphson method, which can be seen in use here: http://www.efunda.com/formulae/finance/loan_calculator.cfm (this is the exact functionality I am looking to implement) I've tried using the RATE() function from PHPExcel, however I'm not getting a correct output for my inputs, i.e. the interest rate comes back as 0.1% or similar (when in fact it's more like 5.75%)

getFinancials (quantmod) and tq_get (tidy quant) not working?

若如初见. 提交于 2019-12-01 23:39:46
I'm getting the same error in both quantmod and tinyquant for financials data. Can anyone see if this is reproducable? Is this a google finance server issue? None of the below functions have been working for me.I'm not sure if it's me or the server. tq_get("AAPL", get= "financials") [1] NA Warning message: x = 'AAPL', get = 'financials': Error in thead[x]:thead[x + 1]: NA/NaN argument and: getFin("AAPL") Error in thead[x]:thead[x + 1] : NA/NaN argument Can somebody help? Yes I get the same issue for the past couple of days as well. I think it may have to do with a change on the part of Google

Calculating Variable Cash-flow IRR in Python (pandas)

感情迁移 提交于 2019-12-01 21:04:48
问题 I have a DataFrame of unpredictable cashflows and unpredictable period lengths, and I need to generate a backward-looking IRR. Doing it in Excel is pretty straightforward using the solver, wondering if there's a good way to pull it off in Python. (I think I could leverage openpyxl to get solver to work in excel from python, but that feels unnecessarily cumbersome). The problem is pretty straightforward: NPV of Cash Flow = ((cash_flow)/(1+IRR)^years_ago) GOAL: Find IRR where SUM(NPV) = 0 My

Calculating Variable Cash-flow IRR in Python (pandas)

偶尔善良 提交于 2019-12-01 19:10:21
I have a DataFrame of unpredictable cashflows and unpredictable period lengths, and I need to generate a backward-looking IRR. Doing it in Excel is pretty straightforward using the solver, wondering if there's a good way to pull it off in Python. (I think I could leverage openpyxl to get solver to work in excel from python, but that feels unnecessarily cumbersome). The problem is pretty straightforward: NPV of Cash Flow = ((cash_flow)/(1+IRR)^years_ago) GOAL: Find IRR where SUM(NPV) = 0 My dataframe looks something like this: cash_flow |years_ago ----------------------- -3.60837e+06 |4.09167

Issue with quantmod add_TA and chart_Series - lines and text disappear after next add_TA is called

寵の児 提交于 2019-12-01 17:16:52
I am using new chart_Series and add_TA quite a lot. It works very well for me and I find it very useful. I am trying to add a few things (horizontal lines and some text) on a graph. Here problems start to occur. After horizontal lines and text are drawn correctly they disappear if I call subsequent add_TA ... Please see the example code below which reproduces the problem: library(quantmod) getSymbols("SPY") dev.new() chart_Series(SPY) add_TA(ADX(HLC(SPY))$ADX) abline(h=15, col="red") abline(h=35, col="green") text(10, 7, "Text and horizontal lines disappear after next add_TA is called", col=

Stuck at removing/adding multiple taxes from a value?

感情迁移 提交于 2019-12-01 08:09:08
问题 I have to remove/add multiple taxes or adjustments from a value to get back to the original value that it was applied to. I will define what an adjustment can be: An adjustment can be a percentage that is either compounded or non-compounded. It can also be a flat dollar amount. It can also be added or removed to the initial value. I just have to write the part that reverses the taxes from the post-tax value. I wrote something up I could use to generate test data and I wrote something else

Coding the exponential moving average with Python

北城余情 提交于 2019-11-30 23:54:09
I want to do calculations on three columns of a dataframe df . In order to do that I want run a price of assets (cryptocurrencies) list in a three column table in order to calculate the exponential moving average of them after having enough data. def calculateAllEMA(self,values_array): df = pd.DataFrame(values_array, columns=['BTC', 'ETH', 'DASH']) column_by_search = ["BTC", "ETH", "DASH"] print(df) for i,column in enumerate(column_by_search): ema=[] # over and over for each day that follows day 23 to get the full range of EMA for j in range(0, len(column)-24): # Add the closing prices for the

Coding the exponential moving average with Python

元气小坏坏 提交于 2019-11-30 18:38:19
问题 I want to do calculations on three columns of a dataframe df . In order to do that I want run a price of assets (cryptocurrencies) list in a three column table in order to calculate the exponential moving average of them after having enough data. def calculateAllEMA(self,values_array): df = pd.DataFrame(values_array, columns=['BTC', 'ETH', 'DASH']) column_by_search = ["BTC", "ETH", "DASH"] print(df) for i,column in enumerate(column_by_search): ema=[] # over and over for each day that follows

Holiday files for G20 countries [closed]

北战南征 提交于 2019-11-30 17:41:40
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 countries for now. Anybody know if Python modules exist which have holiday lists included? Anywhere else to find holiday lists/files? Andre Miras Edit: Updated the link from from novapost's github repo. I recently came across https://github.com/peopledoc/workalendar . I use it for France