# Questions tagged [algorithmic-trading]

Algorithmic trading has two meanings: - the process of taking in inputs such as market data, current news, and producing orders without human intervention. - the process of optimising the trading of a large order or the market making process.

347 questions
Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

### How can a top-of-the book market maker protect itself from exploiting?

Let's consider there is an instrument N traded on a single venue (centralized anonymous limit orderbook). Let's say that most taker orders are tiny, therefore the one who stays at the best bid/offer ...
• 123
1 vote
1 answer
56 views

### Suggestions for backtesting machine learning 'model'/strategy in Python

I have coded a machine learning algo (sklearn) in Python, that uses different 'look back periods' for training a model, which is then used to predict future prices of a stock. It has a 52% accuracy in ...
8 votes
4 answers
548 views

### Does anyone know where to practice mental math for trader interviews?

I am currently using zetamac (has customizable number ranges but doesn't allow for decimals), tradermath (seems to be made to resemble the actual test for flow but costs money unfortunately), and ...
• 170
1 vote
0 answers
41 views

### ATR with direction considered?

ATR is defined without considering the direction of the move. But when the price is going up or going down, just knowing the range loses some of the big pictures. Is there a modified definition of ATR,...
1 vote
0 answers
60 views

### How to optimize the finding of divergences between 2 signals

I am trying to create an indicator that will find all the divergences between 2 signals. (A divergence being defined as t1, t2 such that one signal increases between t1 and t2 while the other ...
• 121
0 votes
0 answers
40 views

### How the vwap band is defined?

https://www.prorealcode.com/prorealtime-indicators/vwap-bands/ https://www.investopedia.com/terms/v/vwap.asp I don't see a clear definition of the vwap bands. There can be several reasonable ways to ...
0 votes
0 answers
47 views

### Relation between historical volatility and ATR?

https://help.tc2000.com/m/69445/l/754439-historical-volatility-ratio "Historical volatility is calculated by taking the standard deviation of the natural log of the ratio of consecutive closing ...
0 votes
0 answers
73 views

### Correlation between fundamental and market data

I got hold of a data set which contains fundamental data like analyst recommendations/revisions (consensus only) and I am trying to come up with an idea of how this could be used as a trading signal ...
0 votes
0 answers
66 views

### What is SIV and LMV in the hollywood stock exchange?

I am studying the Hollywood Stock Exchange (HSX). It is a popular prediction market/ stock simulator, that uses movies as stocks. In the patent details, US5950176A - Computer-implemented securities ...
0 votes
0 answers
36 views

### free download of 1- or 5-minute stock quote data [duplicate]

I know Yahoo has stock quote data (OHLCV). But it contains errors. tdameritrade API have 1- and 5-minute data. But it only starts at 7AM ET, instead of 4AM ET. It is only limited to 182 trading days, ...
0 votes
0 answers
125 views

### How do you model optimal take-profit levels?

I have a very good model for directional trading. It gives me highly accurate predictions for short periods with predefined length (10 bars ahead; hourly timeframe). When I enter the trade I wait 10 ...
0 votes
0 answers
53 views

### Should I always round the data before even trying defining and backtesting my trading strategy?

Newbie here, it happens that I have 8 months of OHLC price data set at 1 hour timeframe from a particular cryptocurrency (ticket) called ALICE, here's a little ...
0 votes
0 answers
161 views

### Data science techniques for intraday trading

I am a Masters student in data science looking to get into a financial-themed project related to intraday trading. This will not be HFT, so the frequency will be somewhere around 1 or 5 minutes. I am ...
0 votes
1 answer
175 views

### TradingView STC vs any python STC

I am trying to use in a trading strategy the STC indicator, but I can not find out why its not working properly. The chart that I am using is BTC/USDT on UTC as a timeframe. Chart time: 01 Feb 22 - 16:...
• 121
0 votes
0 answers
50 views

### There is given a buy limit order. What is a probability that price will drop below this order?

Let's suppose that there is a buy limit order placed at time $t_0$ i.e. $(P,Q,t_0)$. Here $P$ stands for price of this order and $Q$ is the number of shares. Assuming that this order will be filled, ...
• 279
0 votes
0 answers
91 views

### Equity curve money management strategy to minimize drawdowns

Some high risk/returns automated trading systems requires an on/off switch as a fail-safe feature and to minimize drawdowns. Besides using a moving average on the equity P&L curve to turn on/off ...
• 11
1 vote
0 answers
93 views

### Can a losing algo strategy be good if it was winning for 1000 trades?

My algo, in back test, runs for 1000 trades and makes a 10% profit (over a few weeks of candles), from research it seems 1000 trades is statistically significant. Obvs not all 1000 trades were winners ...
0 votes
1 answer
89 views

### Backtest with mid-quotes?

I have built a trading strategy and also a backtest. The backtest has been a lot of work. I was using mid-prices throughout. It’s based on candles, so I make trading decisions at the end of each bar. ...
0 votes
1 answer
161 views

### Workflow in algorithmic strategies

Sorry for the basic question, I'm trying to educate myself on algorithmic strategies. Just to see how it works, my idea is to create a simple moving average strategy. Let us suppose I have $N$ ...
• 101
0 votes
1 answer
134 views

### What kinds of data should be curated for day trading?

From previous research about data curation with research papers, it seems to me that most algorithmic trading systems (at least in regards to day trading) solely use historical price data- but I'd be ...
0 votes
1 answer
78 views

### Trading currency on Kraken.com platform using their REST API (AddOrder), is this correct?

I would like some confirmation on whether what I came up for buying/selling currency on kraken.com is valid. Right now I get ...
• 101
0 votes
0 answers
93 views

### Bull/Bear/Flat Market mathematical definition

I need to label historical dataset by market type and look for automated solution. I have couple related questions. Maybe there some ready solutions that I was not able to find? Is there some price ...
0 votes
0 answers
65 views

### Could this pattern be used as the base for algorithmic trading?

There is the pattern in the historical NYSE data (2019 - 2021M10) that I found. If certain conditions are met then in more than 75% of cases the close bid price of the share XYZ at 9:30 is at least 0....
1 vote
1 answer
227 views

### Rogers Satchell Volatility

I am trying to implement Roger Satchell volatility in Go, but my results do not match reality... I have been at this all day, but cannot find my error. The 30 day Rogers Satchell vol is at 8.75%, but ...
1 vote
1 answer
115 views

### Moving Average Window Size Determination

Is there a "correct" way of determining a moving average window/smoothing parameter (or at least a starting guess for a financial time-series? I understand of course that in some sense, ...
• 279
0 votes
0 answers
42 views

### When developing an algo code with Interactive Brokers: which instruments to take during the weekend for testing orders and live data?

I am developing a trading algo that will use Interactive Brokers. Presently I use my paper trading account but face the difficulty that during the weekend the exchanges are closed. Are there any (...
0 votes
1 answer
126 views

### Kelly Criterion at the individual trade level or the broader trade rule?

Suppose I've raised some initial capital, $C$. I would like to invest it according to three different trading rules, $T_1$, $T_2$, and $T_3$. Each of these rules will yield several trades over the ...
• 103
3 votes
0 answers
98 views

### Known methods for big order detection

I have an access to the order book from stock market and i am interested in finding an anomalous behaviour. What are the known methods, algorithms for detecting big orders or other activities of ...
• 279
2 votes
1 answer
425 views

### python library for backtesting buying and selling multiple cryptos

What is a good python backtesting library to use if I want to test buying and selling a list of different cryptocurrencies every day? Most libraries I find like backtesting.py and pyalgotrade are ...
• 81
0 votes
1 answer
179 views

### Historical Options data

Are there any good sources where I can obtain daily historical options data (strike price, expiration dates, bid/ask spread, etc). I understand that this type of data is very hard to come by and ...
1 vote
0 answers
184 views

### In Avellaneda-Stoikov market making, what is the difference between "reservation prices" and "optimal bid ask quotes"?

Question What is the difference between "reservation price" and "optimal bid and ask quotes"? Are they the same thing? (1) Reservaton price In the paper High-frequency trading ...
• 520
0 votes
0 answers
73 views

### Is this an Example where Maximum Adverse Excursion (MAE) is not useful for a Stop-Loss?

Below is an attached screenshot of a scatter plot of a long position Percentage Return of a Asset Security on the Y-axis, and the Maximum Adverse Excursion (MAE) Percentage on the X-axis. Green dots ...
0 votes
0 answers
69 views

### Maximum Adverse Excursion Formula - Short Trade Position?

Is the formula for the Maximum Adverse Excursion for a Short Selling Trade the (Open - High) / Open, or (High - Open) / Open ?
1 vote
0 answers
121 views

### Market making algo using bid ask order volume ladder

I am looking for references for market-making strategies using bid-ask order ladder. Algo should suggest entry prices, and do inventory management. I am more interested in practical simple algo used ...
• 499
0 votes
1 answer
272 views

### YFinance incoherent daily and hourly values

I'm comparing daily and hourly values extracted from YFinance in Python. I'm expecting the open value of the first hour of the market to be equal to the daily open value of the corresponding day, and ...
0 votes
0 answers
38 views

### Variable Position Sizing: Equity Curve vs Buy & Hold

I have a trading strategy that can take multiple long positions with different sizes before selling them. For example, buy 5 shares of ABC on days 1, 2, 3 and sell 15 on day 4. Going forward, buy 10 ...
• 131
1 vote
0 answers
37 views

### What types of messaging middleware solutions are used by the biggest exchanges like Nasdaq, NYSE, ICE, NYMEX, Japan Exchange Group, Euronext, etc?

Exchanges are famous for having to deal with a huge amount of messages. For example, some years (decades?) ago Nasdaq has migrated their reliable UDP protocol from 32-bit, which could support sequence ...
5 votes
1 answer
387 views

### Modelling queue position

Is there any viable way for me to know the dynamics of my LOB position? Lets suppose the LOB is order based LOB, and i send a order to this level, can i know if the qty in front of me cancelled vs ...
• 183
1 vote
0 answers
92 views

### OLPS in real conditions

The Online Portfolio Selection problem has been extensively researched over the years, and various models have been implemented in open-source projects on GitHub. However the theoretical frameworks of ...
0 votes
0 answers
320 views

### Train/test: why 80:20 split performed better than 90:10 split?

Playing with Random Forest Classifier, I am wondering what could cause in a 80:20 split the test results to perform better than in a 90:10 split? With 2000+ data points and: with 80:20 split, ...
• 1
0 votes
1 answer
127 views

### benchmark scalping strategy in timeseries [closed]

I've a trade data for set of portfolios to analyse. I'm looking for simplest (most efficient but deterministic way) to calculate and find best scalps during a trade day. Criteria are pretty ... ...
• 101
0 votes
3 answers
694 views

### If 90% of retail traders lose money, doesn’t that mean price movements are not random?

If 90% of retail traders are said to loose money, which trade in the short term, doesn’t that mean price movements are not random? My reasoning is that if short term price fluctuations were ...
• 117
4 votes
1 answer
284 views

### Ensuring market order creation idempotency

I am trying to find a way of placing market orders on crypto exchanges in an idempotent way. Specifically, I want to ensure that retrying the same request does not cause another order to be placed. ...
• 141
0 votes
0 answers
92 views

### Backtesting trading algos using simulated price instead of historical prices

I don't have any real experience in trading. I have a question in my mind for which I can't convince myself. Why do we need real history price data to do back-testing? In my mind, real data is only a ...
• 321
0 votes
0 answers
113 views

### Convert stock symbols so that they are useful for Yahoo Finance (yfinance)

I am working on my first investment algorithm, and I am using the following list of stock symbols and company names: https://public.acho.io/embed/...
1 vote
0 answers
48 views

### Exchange order matching system/core for local testing

I am looking for a service that can be deployed locally or connected to it and would emulate the order matching system of exchange (a.k.a matching core). I remember, that I have seen on GitHub repo, ...
• 219
0 votes
1 answer
427 views

### What is the quickest way to start a database for algo trading from scratch?

Many people who are interested in algo/quant trading must have faced the same question before: how do I set up my own database from scratch? I think much effort has been duplicated when we brainstorm ...
0 votes
1 answer
148 views

### What data should I use for a machine learning model

I would like to ask you for an advice of any of you could help me with this information it would be really helpful. I am trying to build a reinforcement learning trading bot that based on the current ...
• 121
2 votes
1 answer
435 views

### Formerly profitable algorithmic trading strategies?

Since algorithmic trading strategies often stop being profitable after a while, I wonder if any such formerly profitable strategies have been made public, and if so, where can I find them?
• 281
8 votes
2 answers
2k views

### How long do algorithmic trading strategies typically remain profitable?

As I understand it, an algorithmic trading strategy could lose profitability, if, for example: it's rediscovered by others employee turnover leaks the strategy to others market conditions change ...
• 281