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.

How Grid Trading Works

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.

How to select currencies suitable for grid trading

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.

1. Amplitude

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.

  • Why is amplitude important?
    The core of grid trading is to make profits through market fluctuations, rather than a single rise or fall. A market with large fluctuations usually means more room for fluctuations, which provides more profit opportunities for grid trading.
    The core of grid trading is to make profits through market fluctuations, rather than a single rise or fall. A market with large fluctuations usually means more room for fluctuations, which provides more profit opportunities for grid trading.

2. Change

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.

  • Why is change important?
    Preventing unilateral trends : Grid trading is suitable for markets with frequent price fluctuations, but not for markets with unilateral increases or decreases. Currencies with excessive increases usually mean that the market has a unilateral trend, which is contrary to the principle of grid trading. A unilateral trend may cause grid trading to suffer losses when executed, because the price continues to lean in one direction, and the buy and sell operations in the grid may not be adjusted in time.
    Stable volatility : Grid trading is more suitable for those currencies with moderate gains and frequent fluctuations. Currencies with moderate gains usually maintain stable volatility, which provides stable trading opportunities for grid trading. Excessive gains may lead to market instability, thus affecting the execution of strategies.

Database Module Introduction:

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.

1. Data collection and processing

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.

WITHSymbolDataAS (
    SELECT 
        *,
        ((High - Low) / Open) * 100AS amplitude,  -- amplitude
        ((Close - Open) / Open) * 100AS change  -- change
    FROM 
        klines.spot_1dWHERESymbolLIKE'%usdt'  -- SelectUSDT related trading pairs only
        ANDTime > toUnixTimestamp(toStartOfDay(now()) - INTERVAL365DAY) * 1000  -- Datafrom the past 365 days
        ANDExchange = 'Binance'  -- SelectBinance exchange data only
    ORDERBYTimeDESC
)

Explanation:

  • This part of the code obtains all USDT-related transaction pair data in the past 365 days from the klines.spot_1d table.
  • Calculate the amplitude and change of each trading pair. The amplitude calculation formula is: (highest price - lowest price) / opening price * 100%, and the change calculation formula is: (closing price - opening price) / opening price * 100%.

2. Aggregate statistics

Next, we aggregate statistics for each currency and calculate the following information:

  • Number of trading days for each currency (day_count)
  • Average amplitude of each currency (avg_amplitude)
  • The maximum amplitude (max_amplitude) and minimum amplitude (min_amplitude) of each currency
  • Average increase of each currency (avg_change)
  • The maximum increase (max_change) and minimum decrease (min_change) of each currency

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
)

Explanation:

  • This code aggregates each currency and counts the average amplitude, maximum and minimum amplitude, average increase, and maximum and minimum increase and decrease of each currency.
  • 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.

3. Screening for currencies suitable for grid trading

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;

Explanation:

  • This code selects the currencies whose average amplitude is greater than the average amplitude threshold (amplitude_thre, default 10%) and whose cumulative absolute value of increase or decrease is less than the increase or decrease threshold (change_thre, default 100%) as the screening criteria.
  • The final query results will be sorted in descending order according to the amplitude, showing the currencies most suitable for grid trading.

4. Example results

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.

Summary

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:

U-based grid amplitude screening

From: Quantitative Analysis Helps Grid Strategy (I): Screening Target Currencies

Leave a Reply

Your email address will not be published. Required fields are marked *