Questions tagged [algorithmic-trading]

Algorithmic trading is a technique of trading financial assets through an algorithm which has been fully or partially automated into a computer program.

Algorithmic trading refers to the use of electronic platforms for entering trading orders in with minimum human intervention. The algorithm controls aspects of the order such as the timing, price, or quantity of the order and can look at the market data feeds (Trades, Quotes, Bars etc), indicators and other techniques to aid in the order placement decision making process. A trading algorithm can be automated using different platforms available specifically for this purpose. Algorithmic Trading APIs are available in a variety of general purpose languages including python, Java, C++, C#, VB. Some platforms, like Tradestation, MetaTrader Terminal, NinjaTrader or xStation offer their own, Domain Specific, programming languages aswell, to develop trading algorithms.

The trading system can utilize very simple to advanced mathematical models for making transaction decisions in the financial markets or for visual tools for computer / AI - augmented trading experience. The strict rules built into the model attempt to determine the optimal time for an order to be placed that will cause the least amount of impact on a stock's price. Large blocks of shares are usually purchased by dividing the large share block into smaller lots and allowing the complex algorithms to decide when the smaller blocks are to be purchased.

Wikipedia Article

1316 questions
51
votes
9 answers

How fast is state of the art HFT trading systems today?

All the time you hear about high frequency trading (HFT) and how damn fast the algorithms are. But I'm wondering - what is fast these days? Update I'm not thinking about the latency caused by the physical distance between an exchange and the server…
Nicholas
  • 2,147
  • 3
  • 23
  • 31
49
votes
6 answers

What is the equivalent of console.log in pine-script?

Is it possible to console.log variables, or the results of function invocation in pine-script? I'd like to convert a pine-script script into JavaScript, and I'd like to verify pinescript variables I'm moving into JavaScript are have the same value…
zero_cool
  • 3,960
  • 5
  • 39
  • 54
29
votes
6 answers

Start, End and Duration of Maximum Drawdown in Python

Given a time series, I want to calculate the maximum drawdown, and I also want to locate the beginning and end points of the maximum drawdown so I can calculate the duration. I want to mark the beginning and end of the drawdown on a plot of the…
siegel
  • 819
  • 2
  • 12
  • 24
28
votes
5 answers

How to test my FIX client? Is there a fake FIX exchange out there that I can use?

I have implemented my own FIX client, something like QuickFIX. Now I need to test it. Is there a fake FIX exchange somewhere that I can use? Has anyone ever implemented a FIX server that I can use to validate my client? Is there a real exchange from…
chrisapotek
  • 6,007
  • 14
  • 51
  • 85
21
votes
8 answers

JSON Decode Error with yFinance [JSONDecodeError: Expecting value: line 1 column 1 (char 0)]

I have been using yfinance for the last several weeks to pull historical data on a number of stocks. I normally run the program at the end of each week to store data for that week, but this problem error just randomly starting occurring this past…
16
votes
2 answers

Indicator for current price in Pine Script

Is there a way to create an indicator which reflects the current price of a stock in Pine Script? I need this indicator because I need to enter an order before the candle closes (when there is a specific crossover) and the data for back testing is…
15
votes
2 answers

How to use CopyRates() to search and filter through several timeframes for Bullish Engulfing pattern

I am trying to use CopyRates() to search for a bullish engulfing candlestick pattern (bearish candle followed by a bigger bullish candle) on several timeframes (all timeframes H2 to M10 within an H4 bullish candle after it closes). I read the…
SuperHueman
  • 165
  • 15
14
votes
1 answer

How to enable TWS delayed market data?

Here is a script I am using to request market data. I am not subscribed to the data-feed yet, so I though it would automatically return delayed market data, but apparently I have to enable it, but cannot find where to do that. Here is the script and…
TB1
  • 269
  • 2
  • 5
  • 10
13
votes
6 answers

How to send/receive data to/from MetaTrader Ternminal 4 with JAVA (or anything!)

I have been working on an algorithm ( Not mine, I am just modifying it ) that predicts when to buy and sell on the FOREX market. I need to be able to open and close orders, dynamically update parameters of the orders ( such as stoploss, maximum stop…
Jay Povey
  • 539
  • 2
  • 6
  • 15
12
votes
3 answers

How to get ALL (or multiple) pair's historical klines from Binance API in ONE request?

I have a trading bot that trades multiple pairs (30-40). It uses the previous 5m candle for the price input. Therefore, I get 5m history for ALL pairs one by one. Currently, the full cycle takes about 10 minutes, so the 5m candles get updated once…
sellthehype
  • 123
  • 1
  • 1
  • 6
12
votes
2 answers

import table data from Mac .numbers file

I'm trying to crunch some numbers in: I have tested a few variations of importing data but failed. Really appreciate some advise. Thanks! path = 'Data/Price.numbers' with open(path) as file: file.readline() for line in file: values =…
pappusenpai
  • 131
  • 1
  • 1
  • 5
12
votes
1 answer

Getting stock's historical data

We would like to check on stock's historical data, using HTTP request, and get JSON. Using the yahoo API ,I found it hard to not only clearly understand the HTTP request fields, but also to get the data of a certain day (not average for each day,…
Curnelious
  • 1
  • 16
  • 76
  • 150
11
votes
4 answers

Binance Future api : APIError(code=-2015): Invalid API-key, IP, or permissions for action, request ip

I used Binance Python api in my algotrading bot, but I get an error when I use future market api. ''' BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action, request ip ''' I am sure that my API-key is true and I…
Mohammad Masih
  • 121
  • 1
  • 1
  • 4
11
votes
2 answers

Getting all filled orders from the Binance API

I am working on a trading bot and I wanted to train it by getting a list of my order history from Binance for a specific period of time. I looked at the API documentation here, but it seems that I am always required to provide a ticker symbol. While…
11
votes
2 answers

Adding MFC support to a Qt project

I have a Qt project and would like to use an external library that includes "afxstr.h". Problem is that whenever I compile after linking to the lib and including their header, I get an error: #error afxstr.h can only be used in MFC projects. Use…
David Menard
  • 2,261
  • 3
  • 43
  • 67
1
2 3
87 88