INVITE-ONLY SCRIPT

linreg-gridbot

업데이트됨
Linreg-GridBot
>release note version 1<

Introduction
This script is a powerful trading strategy tool designed to help users identify market reversal points and make smarter trading decisions using grid thinking.

Background
Traditional grid/martingale strategies have several drawbacks: inefficient use of capital, premature grid boundaries, and trading at fixed intervals, all of which significantly reduce profitability. Since, there is not a gridbot can trail-stop at each level, stay close with the trend, and do better capital usage, tradalive has created this advanced gridbot to address these issues, and enhance the profitability.

How does it work?
Imagine plotting closes on a graph, where the x-axis represents the time-intervals and the y-axis represents the price. Linear regression would fit a straight line through these points that best represents the trend of the data.

In this script utilize the built-in [Linreg] to find consecutive slopes at each moment, and combine them to a smooth trend line. When turning point censored, an entry is placed right after the next bar. Then the gridbot starts working, the upper limit and lower limit is calculated by built-in [ATR], for example 3 ATRs above and under the entry price.

There is a 0.2 trailing stop for each step level. Also, when built-in VWMA is rising, this script uses built-in ROC to find the average change of lookback length, then move the grid upwards accordingly.

Size trading is crucial, in gridbot all-in when beginning the trade is risky, because turning point does not guarantee a reversal market upcoming. As a grid trader, we believe the price is relatively cheap near the lower limit, and the price is relatively expensive near the upper limit. Properly sized orders help prevent overexposure and reduce the potential for significant losses.

Features
  • Trend Detection: Utilizes linear regression to differentiate between upward and downward trends, displaying them as (orange) trend lines on the chart.
  • Signal Generation: Provides buy or sell signals at reversal points, helping users trade at optimal times.
  • Adjustable Parameters: Allows users to customize different indicator parameters to fit various trading strategies.
  • Backtested Device Parameters (see appendix)


Grid Parameters
  • 🔃: Cyclic Trading
  • 💰: Capital Turnover Ratio (Grid capital difference per level: 0.5 to 2)
  • ⬆️ / ⬇️ Expected Number of Upward and Downward Grids.
    The minimum number of grids is three: one level above and below the current price.
    The maximum number of grids is seven: three levels above and below the current price.
  • 🧭: Trade Signal: Controls the trading direction, long or short;
  • 📏: Linear regression length value.
  • ⏳⌛Backtest Period: Set the time range for users to analyze the performance of the strategy over different periods.
  • Analytic Toolbox (upper right corner) :스냅샷


Usage Instructions
  1. Add this script to your TradingView account.
  2. Apply the script to your chart.
  3. Adjust the parameters to fit your trading needs.
  4. Make trading decisions based on the buy and sell signals.
  5. Manually place orders on your trading platform using the parameters provided.
  6. Enter grid parameters according to the highest and lowest prices.
  7. Fill in the number of grid levels (the number of grids equals the number of upward grids plus the number of downward grids plus one).
  8. Set stop-loss and take-profit values.
  9. Alternatively, use a webhook to connect to your trading platform for automated trading.


Important Notes
  • This script currently only supports 4-hour and daily charts!
  • This script relies on historical data for calculations and may not be suitable for all market conditions.
  • Trading carries risks, so please use this script cautiously for trading decisions.
  • User has to update the backtest period, or else the strategy might not be seen.


Demostration
Phase one, the orange line is about to turn up. 스냅샷

Phase two, the reversal point is located, and right after the next bar start an entry of gridbot.
스냅샷

Phase Three, the gridbot operates, once level touches, then a 0.2ATR trailing stop is applied on each step.
스냅샷

Phase four, when vwma rises, the grid window follows it by the rate of change of lookback price. If vwma does not move up, then the grid boundaries remain.
스냅샷

Phase five, either side when the current price breaks through the white limits, the gridbot stops. And the trading strategy is done for this round.
스냅샷
릴리즈 노트
Linreg-GridBot >Release Note Version 2<
  • Pine script version updated to v6
  • Added explanations of initial strategy settings
  • Added assumptions for using this strategy
  • Added analytic toolbox explanations


Strategy Setting
  1. This strategy is intended for use in the cryptocurrency market. Otherwise, users must conduct their own research before applying this script in other markets.
  2. Maker/Taker 0.05%: This is a common value for spot/leveraged commission fees on centralized exchange platforms (CEX).
  3. The unit of currency is based on USD.
  4. The initial capital in this script is 1000 USDT; users might adjust the capital accordingly.
  5. Depending on the connected CEX or asset liquidity, slippage may vary significantly. In this script, we accept a slippage of 10 points.


Assumptions
  • Each coin has its own cycle, meaning that a fixed length of linear regression (linreg) for all kinds of assets is naive. We suggest users fine-tune script parameters periodically.
  • The configuration is based on the performance of some outstanding coins within the year, which have fulfilled the following criteria:
  • High Sortino Ratio: >= 2
  • Small Maximum Drawdown: <= 20%
  • High Profitability: >= 30%
  • Our auto-configuration will be updated annually; users are responsible for verification. Users can verify the performance using TradingView (TV) built-in backtest tools or our quick skim analytic tool.
  • The buy-and-hold (BnH) strategy is adopted. Gridbot/martingale bot is commonly considered a BnH strategy. Fluctuations within the upper and lower limits of the bot should be accepted before opening an entry.
  • In our setting, the minimal PNL ratio of a trade is at least 1:1; one grid below and above the current price. If users do not agree with the trade, they can skip it based on their own observations.


Analytic Toolbox
  • Total Capital: 💰 Represented as a percentage, for instance, 1.6x of initial capital.
  • Maximum Drawdown: 📉 Represented as a percentage, for instance, 7.81% during the period observed.
  • Gridbot Profit of Current Trade: 🉐 Used to analyze the current grid profit compared to the initial capital. Outside the white background, NaN is shown, meaning no grid profit is generated.
  • Current Position: 💼 The trading capital (USD) used at the moment.
  • Sortino Ratio: 🎢 It is a performance metric used to evaluate the risk-adjusted return of an investment, focusing specifically on downside risk. Unlike the Sharpe Ratio, which considers both upside and downside volatility, the Sortino Ratio only penalizes negative returns.
  • Win Rate: 📊 The ratio of winning trades to closed trades, represented as a percentage.


Feel free to let me know if you need any further adjustments or clarifications!
릴리즈 노트
Linreg-GridBot >Release Note Version 3<

  • Enhanced feature: 💸 Stop Loss setting


Description
  1. Hi, size trades and stops to only risk sustainable amounts of equity. Risking more than 5-10% on a trade is not typically considered viable. The function is built to fulfill the moderator's suggestion.
    *When open trade loss reaches the stop loss, this grid trading round is terminated.
    *💸 5% <= user input <= 10%, default is 5%.


Demonstration
Before Version 3, without advanced stop loss. Grid trading ends only when leaving the boundaries.
스냅샷

Version 3, with advanced stop loss. Grid trading ends with respect to the stop loss setting.
스냅샷

Users can actively check the unrealized profit/loss [%] on the strategy status bar (white circled).
스냅샷
Cycleseducationalgridtradinglinregstatistics

초대 전용 스크립트

이 스크립트에 대한 접근은 작성자가 승인한 사용자로 제한되며, 일반적으로 지불이 필요합니다. 즐겨찾기에 추가할 수 있지만 권한을 요청하고 작성자에게 권한을 받은 후에만 사용할 수 있습니다. 자세한 내용은 tradalive에게 문의하거나 아래의 작성자의 지시사항을 따르십시오.

트레이딩뷰는 스크립트 작성자를 100% 신뢰하고 스크립트 작동 원리를 이해하지 않는 한 스크립트 비용을 지불하고 사용하는 것을 권장하지 않습니다. 대부분의 경우 커뮤니티 스크립트에서 무료로 좋은 오픈소스 대안을 찾을 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

경고: 액세스를 요청하기 전에 읽어 보시기 바랍니다.

또한 다음에서도:

면책사항