finance

FIX internal sequence numbers

百般思念 提交于 2019-12-03 17:04:56
问题 I have a process between the Sell side client and an exchange that does currency conversons. There are two FIX adapters - one recieving the messages from the sell side and serving the messages to the process. And another FIX engine that takes the messages from the process and sends them in FIX to the exchange. Every FIX message has a unique sequence number dented by tag 34. However, it seems that each of these FIX engines has a INCOMING SEQUENCE number (what FIX engine is expecting for

Showing what quarter of a financial year a date is in

99封情书 提交于 2019-12-03 16:20:57
I'm trying to construct a query that will map two columns, one, a date from a table, the second column an alias to show what quarter and financial year the date falls into. Unfortunately I don't have enough knowledge of SQL to know where to begin. I know that I'd do this with a combination of getdate() and dateadd(MONTH,,) however nothing that I've put together has come close to working. To further complicate this the financial years in Australia go from 1st July- 30th of June so quarter one of financial year 2012 would start from July 1st 2012. I can do this without a statement however I'd

trying to compare two distributions

别来无恙 提交于 2019-12-03 16:05:13
I found this code on internet that compares a normal distribution to different student distributions: x <- seq(-4, 4, length=100) hx <- dnorm(x) degf <- c(1, 3, 8, 30) colors <- c("red", "blue", "darkgreen", "gold", "black") labels <- c("df=1", "df=3", "df=8", "df=30", "normal") plot(x, hx, type="l", lty=2, xlab="x value", ylab="Density", main="Comparison of t Distributions") for (i in 1:4){ lines(x, dt(x,degf[i]), lwd=2, col=colors[i]) } I would like to adapt this to my situation where I would like to compare my data to a normal distribution. This is my data: library(quantmod) getSymbols("

Arelle Webserver - How to extract the income statement from an XBRL filing?

拥有回忆 提交于 2019-12-03 15:10:10
问题 I am trying to extract financial statement information based on type of the statement. Let me explain to you in a little more details. I want to extract the income statement, balance sheet and cash flow statement from an XBRL instance – especially US GAAP. For me, the perfect solution would be to have tags in the XML file in such a way that I can extract the income statement with tag <incomestatement> , balance sheet with <balancesheet> and cash flow with <cashflow> . Please help me here. I

Calculating future value with compound interest with JavaScript

非 Y 不嫁゛ 提交于 2019-12-03 13:52:55
问题 I'm trying to work on a script where the user inserts a monthly income and gets the future value with compound interest after 30 years. As it is now, I've assigned some values for testing purposes. // Future Value var investment = 800; var annualRate = 2; var monthlyRate = annualRate / 12 / 100; var years = 30; var months = years * 12; var futureValue = 0; for ( i = 1; i <= months; i++ ) { futureValue = futureValue + investment * Math.pow(1 + monthlyRate, months); } Problem is, I'm actually

“For money, always decimal”?

爱⌒轻易说出口 提交于 2019-12-03 12:16:50
Well, the rule " For money, always decimal " isn't applied inside the Microsoft development team, because if it was: Namespace: Microsoft.VisualBasic Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll) Financial.IPmt and all the other methods would receive/return decimal and not double as it is. Now I wonder if I can use these methods without worry with round mistakes? Should I use some other libraries to work with finances? If yes, could you point me some good ones (for C# use) ? You can use this class: public class Financial { #region Methods public static decimal IPmt(decimal

Speed up WMA (Weighted Moving Average) calculation

六眼飞鱼酱① 提交于 2019-12-03 08:41:57
I am trying to calculate exponential moving average on 15 day bars, but want to see "evolution" of the 15 day bar EMA on each (end of) day/bar. So, this means that I have 15 day bars. When new data comes in on a daily basis I would like to recalculate EMA using new information. Actually I have 15 day bars and then, after each day my new 15 day bar starts to grow and each new bar that comes along is supposed to be used for EMA calculation together with previous full 15 day bars. Lets say we start at 2012-01-01 (we have data for each calender day for this example), at the end of 2012-01-15 we

Open source or free financial analysis programs/libraries

ぐ巨炮叔叔 提交于 2019-12-03 07:35:35
I'm looking for something containing similar functions to Matlab’s financial and financial derivatives toolbox but don’t have the cash to spend on matlab. I would appreciate any info on free or open source libraries or programs that will let me easily calculate interest rates, risk etc. How about JQuantLib or QuantLib ? How about the Octave financial functions? http://www.gnu.org/software/octave/doc/interpreter/Financial-Functions.html#Financial-Functions I'm not familiar with the Matlab toolbox, so you'll have to judge for yourself. GNU Octave is a high-level language, primarily intended for

Python Code: Geometric Brownian Motion - what's wrong?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:22:52
问题 I'm pretty new to Python, but for a paper in University I need to apply some models, using preferably Python. I spent a couple of days with the code I attached, but I can't really help, what's wrong, it's not creating a random process which looks like standard brownian motions with drift. My parameters like mu and sigma (expected return or drift and volatility) tend to change nothing but the slope of the noise process. That's my problem, it all looks like noise. Hope my problem is specific

Parallelize a rolling window regression in R

拥有回忆 提交于 2019-12-03 06:10:11
问题 I'm running a rolling regression very similar to the following code: library(PerformanceAnalytics) library(quantmod) data(managers) FL <- as.formula(Next(HAM1)~HAM1+HAM2+HAM3+HAM4) MyRegression <- function(df,FL) { df <- as.data.frame(df) model <- lm(FL,data=df[1:30,]) predict(model,newdata=df[31,]) } system.time(Result <- rollapply(managers, 31, FUN="MyRegression",FL, by.column = FALSE, align = "right", na.pad = TRUE)) I've got some extra processors, so I'm trying to find a way to