finance

How do I add and subtract numbers in SQLite for android?

巧了我就是萌 提交于 2019-12-07 00:17:27
I'm creating a simple financial app where the user can input an income or expense. I cannot find anywhere how I can change the "total" amount by adding or subtracting numbers inside the database. The easiest way I can explain it is: user enters an income of $10 : So I would add that 10 into the database. user enters an expense of -$5 : so i would also add that into the database the end result should be $5 as the total, but how do I do this? I'm completely stuck as I've never use SQLite before. Thanks You can do that simply by firing 2 commands on SQL a) Use Select to get the value from the

Implementing a Fast Fourier Transform for Option Pricing

僤鯓⒐⒋嵵緔 提交于 2019-12-06 16:27:48
I'm in need of some tips regarding a small project I'm doing. My goal is an implementation of a Fast Fourier Transform algorithm (FFT) which can be applied to the pricing of options. First concern: which FFT? There are a lot of different FFT algorithms, the most famous one being Cooley-Tukey. My thoughts on this: I prefer the most simple one, since this is no thesis or big project, just a course on Algorithms. But it has to be compatible with option pricing (in contrast with the most - well in our general literature- referenced application of images/sound processing). So it depends on the form

Can a PayPal transaction include a third party?

我是研究僧i 提交于 2019-12-06 14:54:34
问题 The situation is as follows: there's a website that connects sellers and buyers, like Ebay. Among other things the owner of the website needs to know the details of each transaction initialized from there. Essentially I am looking for a payment method that returns a digital receipt. Is it possible to do something like that with PayPal? 回答1: Of course you can do it like this. Couple of things that you will have to do: Have sellers register their PayPal information with. Lets say in "sellers"

OpenGL or Flash for 3d visualization in the browser

杀马特。学长 韩版系。学妹 提交于 2019-12-06 13:40:02
I am planning create a site that lets users in finance visualize the price of a foreign exchange option in 3d. x = price of underlying, y = price of option, z = days left to maturity. In other words, rather than a simple option payout diagram, this would allow you, on the Z axis, to view what the P&L scenarios would be if you sold before expiry of the option. In short, I want a visualizaion tool. But given that the surface of the P&L might be quite "curvy", it's going to be good for users to rotate around the space in real time. And it's going to be good to slice the surface up along any plane

How can i convert a dataframe with a factor column to a xts object?

怎甘沉沦 提交于 2019-12-06 08:58:36
I have a csv file and when i use this command SOLK<-read.table('Book1.csv',header=TRUE,sep=';') I get this output > SOLK Time Close Volume 1 10:27:03,6 0,99 1000 2 10:32:58,4 0,98 100 3 10:34:16,9 0,98 600 4 10:35:46,0 0,97 500 5 10:35:50,6 0,96 50 6 10:35:50,6 0,96 1000 7 10:36:10,3 0,95 40 8 10:36:10,3 0,95 100 9 10:36:10,4 0,95 500 10 10:36:10,4 0,95 100 . . . . . . . . . . . . 285 17:09:44,0 0,96 404 Here is the result of dput(SOLK[1:10,]) : > dput(SOLK[1:10,]) structure(list(Time = structure(c(1L, 2L, 3L, 4L, 5L, 5L, 6L, 6L, 7L, 7L), .Label = c("10:27:03,6", "10:32:58,4", "10:34:16,9",

Group OHLC-Stockmarket Data into multiple timeframes with T-SQL

Deadly 提交于 2019-12-06 08:33:27
问题 I'm using SQL Server 2008 R2 and need to create new tables grouped in Time intervals. The data is data from a stock market index. I have the data in 1 minute intervals, now i need them in 5,10,15,30,45,60...minute intervals. My primary key is the time stamp. My question is: how to query the 1 minute data table to return data that is grouped by a specific time interval for example 5 minute intervals. The query must return the Highest, Lowest, Last and First values in that particular group and

Change value of some column in xts based on other columns values with lookback

放肆的年华 提交于 2019-12-06 08:32:58
I have the following xts object (representing long/short entries (column 1 and 2) and exit (columns 3 and 4) triggers with "aggregate" signal column which should be 1 (system is long), -1 (system is short) or 0 (system is flat). I can not make this work for "aggregate" signal column5... The data: LongEntrySignal ShortEntrySignal LongExitSignal ShortExitSignal Signal 18.02.93 0 0 1 0 0 19.02.93 0 0 0 1 0 22.02.93 1 0 0 0 1 23.02.93 0 0 0 0 0 24.02.93 0 0 0 0 0 25.02.93 0 0 0 0 0 26.02.93 0 0 1 0 0 01.03.93 0 0 1 0 0 04.03.93 0 1 0 0 -1 05.03.93 0 0 0 0 0 11.03.93 0 0 0 1 0 12.03.93 0 0 1 0 0 I

Python: Plot candlesticks with automatic Y zoom

你说的曾经没有我的故事 提交于 2019-12-06 06:24:25
问题 I am looking for a Python plotting library that allows me to plot candlesticks (preferably the OHLC bars variant) with X zoom via mousewheel scrolling (or similar) and an automatically scaled Y axis when zooming. As an example of what I am looking for, tradingview.com does this perfectly. See https://uk.tradingview.com/chart/?symbol=NASDAQ:NDX. OHLC bars can be seen by clicking the candlestick icon near the top left and selecting 'Bars'. Plotly is almost able to do this. The Ohlc class in

XTS dates from different sources. Using R to calculate beta

喜欢而已 提交于 2019-12-06 02:25:44
问题 I'm somewhat new to R. I imagine my error will be trivial to the experienced. I'm attempting to write an R program that will calculate beta for a number of stocks. The stock symbols are read from Input.csv , and the data is downloaded from yahoo. The code then loops through a beta calculation for each stock and outputs a csv summarizing the regressions. I got the code to work when a single risk free rate was assumed in all periods, but I believe I may need to use the actual risk free rate in

Calculating monthly returns in R

孤街醉人 提交于 2019-12-06 01:54:24
This might be an insignificant question but unfortunately I'm unable to solve it. I have a portfolio of stocks of 50 companies. I have the dates and the closing prices on that particular day for each of the companies. Data for each company varies with respect to the date from which the stock is being traded. I used this code for calculating the daily returns: return=matrix(NA,nrow(companies),ncol(companies)-1) for (j in 2:52){ k=0 for (i in 1:nrow(companies)){ if (!is.na(companies[i,j]) & k==0) { base= companies[i,j] k=k+1 } else {if ( k==1) {return[i,j-1] = ((companies[i,j]-base)/base)*100}