Skip to main content

# Questions tagged [algorithm]

The tag has no usage guidance.

71 questions
Filter by
Sorted by
Tagged with
2 votes
1 answer
67 views

### Weak Stationarity for Neural Network Input?

I am taking a course that detailed that input data into neural networks should be at least weakly predictive and weakly stationary (stable mean). Does this principle apply to other ML models like tree-...
0 votes
0 answers
62 views

### Automatic detection of technical patterns such as Head and Shoulder, Flag, Wedge or Double Top

To my understanding, Ta-Lib does not detect technical patterns such as Head and Shoulder, Flag, Wedge or Double Top. Is there any automatic way to detect such technical patterns?
• 109
1 vote
0 answers
198 views

### Calibration of $\rho$ in the heston model

When calibrating the Heston model, the gradient of the price of the call/cost function wrt $\rho$ (correlation between $S$ and $V$), is a lot less than the other parameters like $v_0$ and $\bar{v}$. ...
0 votes
1 answer
174 views

### Calibrating the Heston with the Levenberg-Marquardt algorithm

I am trying to implement the Levenberg-Marquardt algorithm similarly to Cui et al. Full and fast calibration of the Heston stochastic volatility model, 2017 here (although using a different method to ...
0 votes
0 answers
58 views

### Profit optimal algorithm for market clearing

There is a well known offline profit optimal algorithm for market clearing (matching buy-bids with sell-bids, visit for more details) which is based on bipartite weighted matching. This algorithm ...
0 votes
0 answers
79 views

### Pairs trading intercept [duplicate]

For a pairs trade, when calculating the zscore should I include the intercept point in the calculation: ...
2 votes
1 answer
521 views

### Applicability of AAD(Adjoint automatic differentiation) to an indifferentiable function at some point

Applicability of AAD(Adjoint automatic differentiation) to an indifferentiable function at some point. I recently learned about Adjoint automatic differentiation(AAD) while studying Monte Carlo ...
• 23
1 vote
1 answer
308 views

### What does it mean to "compute" an Itô integral?

I'm reading Shreve's Stochastic Calculus for Finance II. On page 191, Exercise 4.6, we are given the problem Exercise 4.6. Let $S(t)=S(0)\exp\Big \{\sigma W(t)+(\alpha-\frac{1}{2}\sigma^2)t\Big\}$ be ...
• 437
1 vote
1 answer
222 views

### How to Manage Large Orders

Forgive me for any violations of posting rules, I’m new to this forum. I’ve written an algorithm that checks the order book for the price point that would completely fill my entire available balance, ...
• 111
1 vote
2 answers
296 views

### Spectral clustering in finance

What are some examples of applying spectral clustering to financial times series data or other areas of finance? Why spectral clustering was used for each application rather than other types of ...
• 3,030
0 votes
1 answer
252 views

### The quality of an trading algorithm

Good day. I am currently writing a term paper on the creation of trading algorithms in the foreign exchange market (by an algorithm I mean the one that follows the alpha model, for example, signals ...
• 195
0 votes
0 answers
98 views

### Configuration of control parameters tol and delta in the rsolnp package

I am working with the rugarch package which includes a solver.control argument. I am using the solnp solver. I can pass values for tol and delta. In the rsolnp the authors suggest that the control ...
2 votes
1 answer
4k views

### What is the formula to calculate Implied Volatility Percentile [closed]

I googled and I am unable to find any formular . Can some one give me the formula to calculate IVP , based on sets of IV's given. Thanks.
1 vote
2 answers
388 views

### Implied volatility is returning infinity

I am trying to calculate implied volatility using javascript , I have following code ...
-1 votes
1 answer
40 views

### Custom normalisation from 0 to 20

I want to normalise from 0 to 20 For example right now I do normalisation with dynamic outlier exclusion , using median. So it works fine for some values like below ...
2 votes
0 answers
179 views

### How to backtest algorithms in parallel?

I want to backtest a large number of algorithms on the same dataset, one stock ticker. The algorithms are actually variations of one algorithm with various combinations of parameters, amounting to ...
• 527
4 votes
1 answer
72 views

### What are known algorithms to detect potential wrongdoings in funding distribution?

Imagine an entity with a money fund. This entity defines some budgets which it annually distributes to different applicants. Example data set: ...
• 141
1 vote
0 answers
33 views

### Has there been studies done on changes in model performance post-crisis?

My question is, has there been done any studies on whether the efficiency and accuracy of pricing and risk-management of derivatives using different models and algorithms has changed after the ...
• 11
1 vote
0 answers
70 views

### CFD broker spread as indicator for stock market

Retail trader on stock market has very limited ability to accomodate huge amount of information, it leds me to idea of using behavioir of more informed players - CFD brokers - spread of their CFD ...
• 1,018
4 votes
1 answer
163 views

### Neural Networks for Estimation of Unmarked Private Asset Returns from Market Data

Let's assume it is March and my illiquid private assets portfolio is only 50% marked for 12/31, but I want to get the most accurate estimate of my final return for the quarter ended on 12/31. What is ...
• 115
2 votes
1 answer
140 views

### What are common risk controls banks use when utilizing Trading Algorithims

Trying to understand what risk controls are used for algorithms that are classified as a) execution algos such as twap, vwap b) market making algos such as auto pricing, inventory management, auto ...
• 21
3 votes
1 answer
1k views

### What's the rationale behind having several orders on each each side for market makers

I've been browsing market making codebases and I've noticed most of them tend to create multiple orders on each side. Originally I thought having orders on each side is an advanced approach but here'...
• 125
11 votes
3 answers
16k views

### Programmatically detect RSI divergence

How can I programmatically detect bullish and bearish RSI divergences? A bullish divergence occurs when the underlying security makes a lower low and RSI forms a higher low. RSI does not confirm the ...
• 219
1 vote
1 answer
40 views

### Comparing account equity vs maintenance margin on large number of positions

Forex brokers will start liquidating your positions when your account's equity falls below the maintenance margin set by the broker. ...
2 votes
2 answers
846 views

### Algorithm for calculating Capped Index weightings

I'm trying to build a Capped Index Fund of crypto currencies. As Investopedia explains, a "Capped index is an equity index that has a limit on the weight of any single security. Thus, a capped index ...
• 41
0 votes
1 answer
311 views

### Genetic Algorithm - Portfolio Optimization / Index Tracking crossover process

i am currently doing a research on index tracking using Genetic Algorithm (replicating the index using a subset of the index members). This is a new topic to me. I have been reading research paper on ...
1 vote
2 answers
3k views

### Online algorithm for calculating EWMA at irregular intervals?

What is a fast online algorithm for calculating the EWMA (exponentially weighted moving average) of an input variable observed at irregular intervals? I know the formula for when sampling at regular ...
1 vote
1 answer
152 views

### Literature on credit risk premia

I am looking for a comprehensive ressource describing known strategies of credit risk premia. Is there such kind of articles/books/websites?
• 281
1 vote
0 answers
308 views

### Adjoint Algorithmic Differentiation: swap pricing

I have tried to implement an AAD routine to price call options using the Black-Scholes formula, but my greeks are not quite agreeing with the expected ones, so I have decided to start with something a ...
• 223
5 votes
1 answer
686 views

### How to (efficiently) calculate the maximum possible return of a perfect "crystal ball" investment strategy?

I am new to the world of investing, so please excuse the clumsy wording of the question... there is probably a better term for what I am looking for or maybe this is even a known/classic problem. If ...
0 votes
1 answer
577 views

### How buying/selling pairs and entering/exiting trade works in pairs trading?

Lets say I have two stocks x and y and their corresponding stock price p(x) and p(y). consider HR as hedge ratio. Then we can calculate the spread using this equation. $spread=p(x)-HR*p(y)$ from ...
• 647
5 votes
1 answer
3k views

### What is the pseudo code for a pairs trading strategy?

I am trying to learn about pairs trading strategy. I know that we have to long and short cointegrated assests simultaneously. But I still have some confusion in how the strategy works. I wrote the ...
• 647
2 votes
2 answers
509 views

### Backtesting algorithms

Are there any books/papers/articles to describe how to develop a backtesting software? Something like backtest in quantopian website. How do they calculate the Cumulative performance?
• 121
8 votes
5 answers
4k views

### Thoughts on how quantitative hedge funds use machine learning to invest in the stock market (algorithms, examples of data, etc.)

I believe there are several post on this general topic but I thought I would start my own thread. I'm a former fundamental hedge fund investor (i.e. modeling a company's financials, forecasting the ...
• 81
1 vote
0 answers
36 views

### What are appropriate algorithms for forecasting contract schedules to maximize profit?

Imagine a situation where a business negotiates contracts for the maintenance of widgets it sells. Situation Customer buys 20 widgets. Customer negotiates contract for widgets to be serviced/...
• 111
1 vote
1 answer
668 views

### Memory-efficient clustering algorithm for large time-series datasets

I have a simulation task at hand with ~1e6 time series to be clustered on the basis of statistical measures every few days in the simulation. Most clustering methods I'm aware of require an affinity ...
• 305
2 votes
0 answers
156 views

### Efficient construction of binomial tree

The goal is to build a $n$ step binomial tree knowing the end nodal probabibilities $p_1, \dots, p_m$, which correspond to the time $T$ states $S_1, \dots, S_m$. We assume that all paths ending in the ...
• 624
15 votes
3 answers
12k views

### Which algorithms do robo-advisors use?

Some pundits claim that there is a revolution in portfolio management under way: The rise of the robots, a.k.a. robo-advisors. The most well known are Betterment.com, FutureAdvisor, Schwab Intelligent ...
• 27.5k
1 vote
0 answers
43 views

### order routing for a fill [closed]

Lets assume a FIFO rules in futures, I buy a contract and id like to sell it. Should I estimate the possibilite of orders on opposite side would be filled first? If I watch new orders incoming at new ...
• 11
9 votes
2 answers
7k views

### Quantitative Finance Programming Language

Since couple of weeks, I started to do my research on quant finance. During this time, I could discover a lot of stuff and with that stuff, a lot of questions came to my mind. A lot of news or ...
• 91
5 votes
3 answers
2k views

### How to apply the "Knapsack Problem" to minimise a portfolio's volatility?

Suppose I have a stock selection universe of 100 stocks. I have estimated the covariance matrix of this 100 stocks. I would like to create an equaly-weighted basket of 5 stocks which has the lowest ...
• 368
1 vote
0 answers
95 views

### Multi-objective optimization: Where to find qualified examples for portfolio management?

I am looking for qualified examples of multi-objective optimization applied to a portfolio management situation in non-normal markets. Where can I find one or more examples of such a multi-objective ...
• 450
1 vote
2 answers
956 views

### Importance sampling for barrier option like pricing by Monte carlo

I would like to know some references regarding importance sampling algorithms for variance reduction of Monte Carlo barrier options pricing. Please could someone help me leaving some references? If ...
• 608
1 vote
2 answers
179 views

### Controlling portfolio concentration

I'm working with a heterogenous basket of instruments (in volatility terms). Risk parity allocation seems to be useful for the portfolio( * 1/Volatility). However, there are times when the ...
• 305
1 vote
0 answers
69 views

### How do I determine what is a separate objective in a multi-objective portfolio optimization?

Is there a general rule to determining when to separate objectives when developing a multi-objective portfolio optimization? For example, one might start with a standard portfolio optimization of ...
• 146
1 vote
0 answers
718 views

### What is the algorithm for the Fama-Bliss instrument selection?

Fama-Bliss discount bonds are defined through a straight forward calculation (Famma, Bliss 1987). For the purposes of a project I need to derive forward rates, yields &c. for periods not included ...
1 vote
0 answers
63 views

### Approaches to check/validate the output of an optimization algorithm

Let's say we want to optimize the a function $f(x_1,\dots, x_n)$ with $(x_1, \dots , x_n) \in \mathbb{D}^n$. For the sake of simplicity let $\mathbb{D}^n$ be the unit sphere. We chose an optimization ...
• 3,377
7 votes
2 answers
1k views

### Algorithmical replication of a profit and loss function using different options

I often see questions like "Given this payoff graph (example below), construct a portfolio that replicates it." I want to know if there is an efficient method/algorithm to find the individual pieces ...
• 73
25 votes
1 answer
10k views

### Algorithm to fit AR(1)/GARCH(1,1) model of log-returns

I am fitting numerically an AR(1)/GARCH(1,1) process to index and stock log-returns, $r_t=\log(P_t/P_{t-1})$, where $P_t$ is the price at time $t$, and thus far am not clear on where the observed log ...
-2 votes
1 answer
983 views

### How to look for fractals/harmonics patterns in time series?

I want to build trading systems based on two things: 1)Fractal Theory 2)Harmonics Pattern I have read the book : The Misbehavior of Markets: A Fractal View of Financial Turbulence By Mandelbrot ...