Tag Info

Hot answers tagged

13

This is interesting because I see another trend: Matlab is being replaced by R, but I guess this is another story. I use R for my academic (I am also teaching this stuff) as well as my consulting work (I am mainly working in the $\mathbb{P}$ area, with some excursions into $\mathbb{Q}$). I tried Python but it didn't work for me. I think the main reasons I ...


12

My deal is HFT so what I care about is read/load data from file or DB quickly in memory perform very efficient data-munging operations (group,transform) visualize easily the data I think is is pretty clear that 3. goes to R, graphics and ggplot2 and others allow you to plot anything from scratch with little effort. About 1. and 2. I am amazed reading ...


10

I've used both R and Python with Pandas in a professional quantitative financial work to do both large and small scale projects. I would strongly recommend Python with Pandas over R for most new projects in the field especially in time series analysis. While I don't dispute vonjd in that you will find more libraries in R with algorithms on the bleeding ...


6

For data analysis, particularly for large data analysis project, pretty much most of the top quant hedge funds and a lot of the banks are using Python (over R) for a couple of reasons, although many still have bits and pieces of R for specific packages or functions (I work at a bank and interface with quite a few quant hedge funds on data analysis): ...


4

Instead of wild guesses about R's/python's future in the community, here some facts: The following query on StackExchange Data Explorer counts the number of questions that have <r> or <python> tags. If you scroll down on one of the three webpages provided below, you can see a graph with data on a monthly basis. You can easily run this query on ...


3

For the tasks listed, both Python and R preform very well. There are some packages in Python not in R and visa-versa, my solution for this is to simply call R from Python. This allows for the best of both worlds. It is also important to note I do not write any R code other than calling an R library from Python. Calling Python from R does not work equally ...


3

Firstly, you'll probably be directed to consider Zipline. It's worth a look but I don't think that it's a good starting point, since: Quantopian's developers don't have a financial background and it shows through in the Zipline source code. Zipline is dreadfully slow if you compare it to any commercial platform with backtesting functionality in a compiled ...


3

It doesn't matter if you use *100 or just pct_change, as long as you are consistent. However, in practice, due to underlying floating point numerical instabilities in the underlying optimization algorithms/default tolerances used in scipy/arch, having the returns expressed in %, i.e. multiplied by 100, will have a better chance of converging during the ...


2

You will need an entry and then a "Grouped" stop loss and take profit (one cancels other). An implementation of this exists in quantstrat in R called ordersets. Documentation and source code can be found here: https://r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/orders.R?view=markup&root=blotter You will unfortunately need to port this and ...


2

Quandl has a python api: https://www.quandl.com/help/api and free stock fundamentals (some) https://www.quandl.com/help/api-for-stock-data


2

Both R and Python can do this very nicely. For Python you would need the pandas package and its dependencies. pandas has a lot of basic statistics, but for more advanced statistics like it looks like you want to do, you can use the statsmodels package, which can work directly with pandas data types. It can also download the csv files directly off the ...


2

possible update: http://pmorissette.github.io/bt/ based on http://pmorissette.github.io/ffn/ both were easily installed and somewhat usable for a novice. would love some examples other that github documentatiion


2

def bbands(price, length=30, numsd=2): """ returns average, upper band, and lower band""" ave = pd.stats.moments.rolling_mean(price,length) sd = pd.stats.moments.rolling_std(price,length) upband = ave + (sd*numsd) dnband = ave - (sd*numsd) return np.round(ave,3), np.round(upband,3), np.round(dnband,3) sp['ave'], sp['upper'], ...


2

You can get this using a pandas rolling_max to find the past maximum in a window to calculate the current day's drawdown, then use a rolling_min to determine the maximum drawdown that has been experienced. Lets say we wanted the moving 1-year (252 trading day) maximum drawdown experienced by a particular symbol. The following should do the trick: import ...


1

highOutput = [] lowOutput = [] lsth = [None]*window lstl = [None]*window for i in range(0, len(highValue)): maxValue=0 lsth.append(highValue[i]) lsth = lsth[-window:] for j in range(0, len(lsth)): if lsth[j] > maxValue: maxValue = lsth[j] highOutput.append(maxValue) for i in range(0, len(lowValue)): ...


1

True this is a stackoverflow question but have you tried the fool around with the package Pandas? You can do in Python import pandas as pd data = pd.read_csv('filepath/file.csv') That's the easiest way.


1

You need to use a groupby, timegrouper, and its annual option, and take the first value in each group. For example, if I grab yahoo data: import pandas as pd import pandas.io.data as web # Grab S&P 500 data going back to beginning of 2011 SPY_Dat = web.DataReader('SPY', 'yahoo', datetime.date(2011,1,1), end) # Convert to annual data: SPY_Ann_Dat = ...


1

Just checked in my python script for daily futures data from Interactive Brokers. Maybe it will be useful for you: https://github.com/busygin/ib_data_loader


1

The IB API calls your code asynchronously when there are account updates after you have called reqAccountUpdates. But you have to provide a callback function (handler) for the IB API to call. Looks like from the [ibPy documentation example] (https://code.google.com/p/ibpy/wiki/IbPyOptional) and how the Java IB API is defined, you want to call ...


1

In addition to the above answers - You should be very careful that you do not introduce survivorship bias in your creation of indices and choose your data source carefully to remove such bias. For example, Yahoo Finance only contains currently-listed securities.


1

There is a module called visualize-wealth that provides: Documentation auto-generation capability with sphinx Portfolio construction methodologies in 3 ways (trade blotter, weight allocation frame, and static allocation series) All basic statistical measures, including many sophisticated ones such as CVaR, Mean Absolute Tracking Error, Cornish Fisher ...


1

Go talk to Fincad. Here is their page on integrating with scripting languages: http://www.fincad.com/news-events/assets/pdfs/mar07/using-fincad-developer-scripting-languages.pdf Their analytics libraries include bond analytics, and they have a spreadsheet product so you can test methods and results before implementing them. Disclaimer: I work for a ...



Only top voted, non community-wiki answers of a minimum length are eligible