Grid trading is an automated trading strategy that aims to make profits through market price fluctuations without relying on unilateral market trends. The core idea of this strategy is to set a series of price ranges, and buy and sell automatically when market prices fluctuate within these ranges to achieve profits. Unlike other strategies that rely on trends, grid trading uses the natural fluctuations of the market to operate, and can make profits both in the ups and downs.
The main operation of grid trading is to set a fixed price range to buy and sell automaticallywhen the market price fluctuates. When the market price reaches the set buy point, the system will execute the buy operation automatically; when the market price rises to the set sell point, it will sell automatically, thereby earning the difference between buying and selling. The whole process is automated and does not require human intervention.
The core of grid trading strategy is to use price fluctuations for automated buying and selling, so it is necessary to select currencies with strong and frequent price fluctuations. In order to screen out currencies suitable for grid trading, we usually rely on several key indicators, such as amplitude, change, etc. Through these indicators, we can evaluate the price fluctuations of each currency and further determine whether it is suitable for grid trading.
In grid trading strategies, our goal is to execute buy and sell operations automatically through the natural fluctuations of market prices, rather than relying on unilateral trends in the market. The core concept of grid trading is to set a series of price ranges and perform automated trading when market prices fluctuate. Therefore, when choosing a currency suitable for grid trading, its price volatility must be considered. At this time, Amplitude and Change are two key indicators.
Amplitude refers to the fluctuation range of prices within a certain time frame, which can usually be measured by the difference between the highest price and the lowest price. A larger amplitude means that the market price fluctuates violently, and the range of price fluctuations is larger. In the grid trading strategy, a larger amplitude provides more buying and selling opportunities, and the system can frequently execute buy and sell operations between these fluctuations, thereby earning the difference.
The increase refers to the percentage change in price over a certain period of time. It can help determine whether there is a unilateral trend in the currency. The main purpose of controlling the change is to avoid a unilateral trend in the market. For example, if a currency increases too much, it may indicate that the market is in a state of unilateral rise or fall. In this case, grid trading may not be able to be executed effectively.
When screening for currencies suitable for grid trading, the Database module developed by FMZ provides powerful data support. The Database module brings together data from multiple mainstream exchanges around the world, and it can provide high-frequency real-time data query and historical data analysis, helping users to obtain various market data in real time. Through this module, users can easily access the K-line data of various currencies, and process, analyze and filter the data through SQL queries, so as to make more informed trading decisions.
The following is the process of screening grid trading currencies, which is explained in detail in conjunction with the SQL query steps.
First, on the query page of the Database module, we collected K-line data of all USDT trading pairs from the Binance exchange, including the daily opening price, highest price, lowest price, and closing price. Then, we calculated the amplitude and change of each currency. The amplitude indicates the amplitude of price fluctuations, while the change indicates the change of the price relative to the opening price.
WITH SymbolData AS (
SELECT
*,
((High - Low) / Open) * 100 AS amplitude, -- amplitude
((Close - Open) / Open) * 100 AS change -- change
FROM
klines.spot_1d
WHERE
Symbol LIKE '%usdt' -- Select USDT related trading pairs only
AND Time > toUnixTimestamp(toStartOfDay(now()) - INTERVAL 365 DAY) * 1000 -- Data from the past 365 days
AND Exchange = 'Binance' -- Select Binance exchange data only
ORDER BY Time DESC
)
Explaination:
klines.spot_1d
table.Next, we aggregate statistics for each currency and calculate the following information:
These statistics will help us analyze the volatility of each currency and filter out the currencies that are suitable for grid trading.
AggregatedData AS (
-- Compute statistics for each symbol
SELECT
Symbol,
COUNT(*) AS day_count,
AVG(amplitude) AS avg_amplitude,
MAX(amplitude) AS max_amplitude,
MIN(amplitude) AS min_amplitude,
MAX(change) AS max_change,
MIN(change) AS min_change,
SUM(amplitude) AS total_amplitude,
AVG(change) AS avg_change
FROM
SymbolData
GROUP BY
Symbol
)
Explaination:
SUM(amplitude)
is used to calculate the total amplitude, this indicator can reflect the total degree of currency price fluctuations over the past period of time.Next, we will screen the currencies that are suitable for grid trading. Grid trading strategies are best suited for coins that are highly volatile and have moderate gains. We can screen by the following criteria:
1. Larger amplitude: Select currencies with larger amplitude (avg_amplitude), which usually means that their price fluctuates more frequently. 2. Moderate increase: Select currencies with moderate increase (max_change and min_change), and avoid currencies with unilateral increase or decrease that is too drastic. 3. Frequent price fluctuations: Select currencies whose prices fluctuate frequently and within a certain fluctuation range.
The final query results will display relevant statistics for each currency and determine which currencies are suitable for grid trading based on our screening criteria.
SELECT
ad.Symbol,
ad.day_count AS "Number of days",
ROUND(ad.avg_amplitude, 2) AS "Average amplitude%",
ROUND(ad.max_amplitude, 2) AS "Maximum amplitude%",
ROUND(ad.min_amplitude, 2) AS "Minimum amplitude%",
ROUND(ad.total_amplitude, 2) AS "Total amplitude%",
ROUND(ad.avg_change, 2) AS "Average increase or decrease%",
ROUND(ad.max_change, 2) AS "Maximum change%",
ROUND(ad.min_change, 2) AS "Minimum change%",
ROUND(ad.avg_change * ad.day_count, 2) AS "Total increase or decrease%" -- Corrected total increase or decrease
FROM
AggregatedData ad
WHERE
ad.avg_amplitude > {{amplitude_thre}} -- Select the currency whose average amplitude is greater than the average amplitude threshold
AND ABS(ad.avg_change * ad.day_count) < {{change_thre}} -- The absolute value of the cumulative increase or decrease is less than the increase or decrease threshold
ORDER BY
ad.avg_amplitude DESC;
Explaination:
Through the above SQL query, we can get the filtered list of currencies suitable for grid trading. For example:
According to these screening conditions, we can see the suitable currencies within 365 days of listing. Of course, the above code is just a rough version, and you can improve it in more details, such as adding volatility, trend analysis, volume screening and other factors to help you more accurately screen out currencies suitable for grid trading.
The core of the grid trading strategy is to make profits by taking advantage of market fluctuations, rather than simply relying on the unilateral trend of the market. By screening the currencies suitable for grid trading effectively and combining the powerful data support of the FMZ Database module, we can implement this strategy more efficiently. For traders with a certain foundation, they can further optimize the screening criteria and combine their own trading preferences to screen out the currencies that best suit their strategies.
Reference: