TradingView
freedx
Mar 13, 2024 9:58 PM

FreedX Grid Backtest 

Bitcoin / TetherUS PERPETUAL CONTRACTBinance

Description

█ FreedX Grid Backtest is an open-source tool that offers accurate GRID calculations for GRID trading strategies. This advanced tool allows users to backtest GRID trading parameters with precision, accurately reflecting exchange functionalities. We are committed to enhancing trading strategies through precise backtesting solutions and address the issue of unreliable backtesting practices observed on GRID trading strategies. FreedX Grid Backtest is designed for optimal calculation speed and plotting efficiency, ensuring users to achieve fastest calculations during their analysis.

GRID TRADING STRATEGY SETTINGS

The core of the FreedX Grid Backtest tool lies in its ability to simulate grid trading strategies. Grid trading involves placing orders at regular intervals within a predefined price range, creating a grid of orders that capitalize on market volatility.

Features:

⚙️ Backtest Range:
    → Purpose: Allows users to specify the backtesting range of GRID strategy. Closes all positions at the end of this range.
    → How to Use: Drag the dates to fit the desired backtesting range.

⚙️ Investment & Compounding:
    → Purpose: Allows users to specify the total investment amount and select between fixed and compound investment strategies. Compounding adjusts trade quantities based on performance, enhancing the grid strategy's adaptability to market changes.
    → How to Use: Set the desired investment amount and choose between "Fixed" or "Compound" for the investment method.

⚙️ Leverage & Grid Levels:
    → Purpose: Leverage amplifies the investment amount, increasing potential returns (and risks). Users can define the number of grid levels, which determines how the investment is distributed across the grid.
    → How to Use: Input the desired leverage and number of grids. The tool automatically calculates the distribution of funds across each grid level.

⚙️ Distribution Type & Mode:
    → Purpose: Users can select the distribution type (Arithmetic or Geometric) to set how grid levels are determined. The mode (Neutral, Long, Short) dictates the direction of trades within the grid.
    → How to Use: Choose the distribution type and mode based on the desired trading strategy and market outlook.

⚙️ Enable LONG/SHORT Grids exclusively:




MANUAL LEVELS AND STOP TRIGGERS

Beyond automated settings, the tool offers manual adjustments for traders seeking finer control over their grid strategies.

Features:

⚙️ Manual Level Adjustment:
    → Purpose: Enables traders to manually set the top, reference, and bottom levels of the grid, offering precision control over the trading range.
    → How to Use: Activate manual levels and adjust the top, reference, and bottom levels as needed to define the grid's scope.

⚙️ Stop Triggers:
    → Purpose: Provides an option to set upper and lower price limits, acting as stop triggers to close or terminate trades. This feature safeguards investments against significant market movements outside the anticipated range.
    → How to Use: Enable stop triggers and specify the upper and lower limits. The tool will automatically manage positions based on these parameters.

---

This guide gives you a quick and clear overview of the FreedX Grid Backtest tool, explaining how you can use this cutting-edge tool to improve your trading strategies.

Release Notes

🛠️ Default settings updated.

Release Notes

🛠 Investment Settings:
    → Auto mode added.
    → Information updated.
    → Fixed mode enhanced with a fixed contracts variable for more realistic testing.

🛠 UI:
    → Quantity and capital control information tables added to notify the user.

Release Notes

🛠 Grid Settings:
    → Target modes added. Exchange mode is the default, and it sets take-profit levels based on exchange behavior.
    → Default Settings changed.
    → Recalculate: If "After order is filled" is enabled, the grid calculates more accurately on higher timeframes. It is set to passive by default due to warnings.
Comments
The_lone_traders
Good afternoon, the script is really great! I am testing it in OKX through alerts, but I ran into such a problem that on the chart it correctly distributes the volume of orders, but in okx the amount of transactions comes in twice as much. I use trading signals in okx. Waiting for your reply. Sincerely, Rod.
freedx
@The_lone_traders, Thank you for reaching out and for your feedback on the script! Below are topics that might help clarify the issues you’re experiencing:

Alert Integration: Our script currently does not include an alert feature for order execution. This decision was made because real-time execution on the exchange is generally more efficient, particularly for strategies that involve frequent trading. Your exchange offers a grid trading feature where you can manually set your trading parameters as per your backtest or prediction results. This method is usually faster than using alerts, which can introduce delays.

Alert Setup: Without specific details on how you've set up your alerts and the connection to your exchange, it’s challenging to pinpoint the exact issue. The problem of orders doubling might be due to modifications you've made in the code, your alert setup, or interactions with third-party automation platforms that aren’t covered by our original script. If you’re using an additional platform to process alerts, the duplication could be occurring there. The scripts’ quantity calculations appear on the chart without any visual modification, as you can see in our open-source code.
vorason
it`s really great! Is it possible to link with the exchange using Trading View Alert and actually trade?
freedx
@vorason, Thanks for your compliment,

We have not added the webhook alert feature. This is because:

1. Most exchanges provide this service directly. You can set parameters such as top level, bottom level, grid count, etc. Exchanges will execute these parameters quickly without any delay, as there is no intermediary communication service involved.
2. If you are looking to implement a different strategy, our backtest template can be directly connected with TradingView webhook alerts.
MidasCapital2
Seems like a very well designed code! But the grids seem to be very far apart. Is there a way to lower the distance between each grid but not manually?
freedx
@MidasCapital2, Thanks for your comment.

1. You can increase the number of grids.
2. You can activate manual levels. Then, select the top and bottom levels more closely. Also, you can drag and drop levels on the chart after activating manual levels mode.

+ More automated calculations will be published with future updates. Keep in touch!
robertlademann79
I downloaded it but nothing appeared on the chart. am I doing something wrong?
freedx
@robertlademann79, All you need to do is to search "FreedX Grid Backtest" in "indicators" tab and add the strategy to your chart. It should appear on your chart.
Niftystreamfree
good man
freedx
@Niftystreamfree, We're happy to hear that you liked it 🙏 You can also checkout our other open source tools in our profile.
More