basilChart

bc Grid Backtest v1.4

This strategy is a full implementation of Grid Trading backtest.

Prominent features of this backtesting strategy are:
- Logarithmic Chart Support: This strategy can support Log Scale on graph. Meaning that grid lines won't have irregular gaps in between the lines if you would like to view the chart Log Scaled. Every line will be aligned correctly even if you use Log Scale or not.
- Precise Buy & Sell: Script will execute precise Buy and Sell orders.
- Dynamic Grid Level Count: From 2 grid levels to n amount of grid levels are supported. There is no limitation on grid level count. You can pick any number starting from 2.
- Customized Backtesting Results Table: A table which includes data for those who want to know has been added at top right. It can be disabled.

Characteristics of this script:
- Able to fill more than one order in one single candle.
- Levels will keep being updated with every trade.
- There will be always one grid level ignored and it will be the level which made the last order filling possible. This is normal behavior of grid trading system.
- You can both use Log Scale and Normal Scale with this script. No issue will be on grid levels.

Using the script:
- Add this script to the chart from indicators tab
- Set starting and ending date for the grid backtesting bot either by dragging and dropping the vertical lines or by the date-time picker from indicator Inputs tab.
- Set highest and lowest limit for the script. These will be the boundary limits. Highest and lowest price for the script to work on. Lines will populate between these two values
- Set grid level count. Number of levels of the grid.
- Set amount to spend on per level. This quantity of order will be placed on each level when needed.

After setting the above settings, there is one last thing to do in order to get precise results. It is setting the Initial Capital.
- We can set this setting from 'Properties' tab. Named 'Initial Capital'. After setting the boundaries all we need to is to navigate to TradingView's own 'Data Window', and get the value there. Then paste it on the strategy's own related setting area.

In this example we used pair BTCUSDT 4h timeframe, our settings are:
Inputs Tab:
- Grid Count: 13
- High Limit: 72 000
- Low Limit: 17 000
- Logarithmic Grids: Checked (because I always use Log Scale on charts, if Log Scale is turned on, this needs to be checked)
- Quantity per level: 0.1
- Show Table: Checked
- Show Grid Levels: Checked
- Show Average Position Price: Checked

Properties Tab:
- Initial Capital: 24 902
- Slippage: 5
- Commission: 0.1% (this is the broker commission value)

This script's purpose is to make simulating possible outcomes between two dates. Therefore making it easier to get the idea of grid trading, finding the best settings for your risk management and for your portfolio.
僅限邀請腳本

僅限作者授權的用戶訪問此腳本,並且通常需要付費。您可以將其增加到收藏腳本中,但是只有在向作者請求並獲得許可之後,才能使用它。 請與basilChart聯繫以獲取更多資訊,或按照以下作者的說明進行操作。

在您100%信任腳本作者並了解腳本的工作原理之前,TradingView不建議您購買腳本並使用它。在很多情況下,您可以在我們的社群腳本庫中免費找到一個不錯的開源替代品。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

作者的說明

此腳本的作者無法再授予對其的訪問權限。請不要請求訪問權限。

想在圖表上使用此腳本?

警告:請閱讀,然後再請求訪問權限。