finance

How do I store data from the Bloomberg API into a Pandas dataframe?

若如初见. 提交于 2019-12-20 08:11:37
问题 I recently started using Python so I could interact with the Bloomberg API, and I'm having some trouble storing the data into a Pandas dataframe (or a panel). I can get the output in the command prompt just fine, so that's not an issue. A very similar question was asked here: Pandas wrapper for Bloomberg api? The referenced code in the accepted answer for that question is for the old API, however, and it doesn't work for the new open API. Apparently the user who asked the question was able to

Calculating interest rate in PHP

旧时模样 提交于 2019-12-20 04:09:47
问题 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

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

拜拜、爱过 提交于 2019-12-19 18:29:10
问题 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

TypeError: ufunc subtract cannot use operands with types dtype('<M8[ns]') and dtype('float64')

时光总嘲笑我的痴心妄想 提交于 2019-12-19 07:13:08
问题 I had met an error code by following the video tutorial of sentdex. When i want to plot a bar graph on ax2 for my Volume, however, it give me error code as listed at the topic. Please help. I am new in Python 0 experience in programming. import datetime as dt import matplotlib.pyplot as plt from matplotlib import style import pandas as pd import pandas_datareader.data as web style.use('ggplot') df = pd.read_csv('C:\\Users\\ngjun95\\Downloads\\7120.KL.csv', parse_dates=True, index_col=0) df[

How to avoid garbage collection in real time .NET application?

十年热恋 提交于 2019-12-18 15:32:30
问题 I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them. The point is that after the business logic is applied, I'm very sure I will never need this instance again. Rather than to wait for the garbage collector to free them, I'd like to explicitly "delete" them. Is there a better way to do so in C#, should I use a pool of object to reuse always

How to avoid garbage collection in real time .NET application?

限于喜欢 提交于 2019-12-18 15:32:02
问题 I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them. The point is that after the business logic is applied, I'm very sure I will never need this instance again. Rather than to wait for the garbage collector to free them, I'd like to explicitly "delete" them. Is there a better way to do so in C#, should I use a pool of object to reuse always

How do these people avoid creating any garbage?

陌路散爱 提交于 2019-12-18 12:54:24
问题 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

Finance Lib with portfolio optimization method in python

会有一股神秘感。 提交于 2019-12-18 12:37:40
问题 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. 回答1: 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:

Relative Strength Index in python pandas

青春壹個敷衍的年華 提交于 2019-12-18 10:23:08
问题 I am new to pandas. What is the best way to calculate the relative strength part in the RSI indicator in pandas? So far I got the following: from pylab import * import pandas as pd import numpy as np def Datapull(Stock): try: df = (pd.io.data.DataReader(Stock,'yahoo',start='01/01/2010')) return df print 'Retrieved', Stock time.sleep(5) except Exception, e: print 'Main Loop', str(e) def RSIfun(price, n=14): delta = price['Close'].diff() #----------- dUp= dDown= RolUp=pd.rolling_mean(dUp, n)

DSLs (Domain Specific Languages) in Finance

£可爱£侵袭症+ 提交于 2019-12-18 10:12:36
问题 Has anyone worked with DSLs (Domain Specific Languages) in the finance domain? I am planning to introduce some kind of DSL support in the application that I am working on and would like to share some ideas. I am in a stage of identifying which are the most stable domain elements and selecting the features which would be better implemented with the DSL. I have not yet defined the syntax for this first feature. 回答1: Jay Fields and Obie Fernandez have written and talked extensively on the