avgtrade

Grid Settings & MM

This script is designed to help you plan your grid trading or when averaging your position in the spot market.
The script has a small error (due to the simplification of the code), it does not take into account the size of the commission.
You can set any values on all parameters on any timeframe, except for the number of orders in the grid (from 2 to 5).

The usage algorithm is quite simple:
1. Connect the script
2. Install a Fibo grid on the chart - optional (settings at the bottom of the description)
3.On the selected pair, determine the HighPrice & LowPrice levels and insert their values
4.Evaluate grid data (levels, estimated profit ’%’, possible profit ‘$’...)
And it's all)

Block of variables for calculating grid and MM parameters
Variables used regularly
--- HighPrice and LowPrice - constant update when changing pairs
--- Deposit - deposit amount - periodically set the actual amount

Variables that do not require permanent changes
--- Grids - set the planned number of grids, default 5
--- Steps - the planned number of orders in the grid, by default 5
--- C_Order - coefficient of increasing the size of orders in the base coin, by default 1.2
--- C_Price - trading levels offset coefficient, default 1.1
--- FirstLevel - location of the first buy level, default 0.5
--- Back_HL - number of candles back, default 150
*** For C_Order and C_Price variables, the value 1 means the same order size and the same distance between buy levels.

The fibo grid is used for visualization, you can do without it, ! it is not tied to the script code !
You can calculate the levels of the Fibo grid using the formula:
(level price - minimum price) / (maximum price - minimum price)
For default values, grid levels are as follows:
1 ... 0.5
2...0.359
3 ... 0.211
4...0.0564
5...-0.1043

Short description:

in the upper right corner
--- indicator of the price movement for the last 150 candles, in % !!! there is no task here to "catch" the peak values - only a relative estimate.

in the upper left corner
--- total amount of the deposit
--- the planned number of grids
--- “cost” of one grid
--- the size of the estimated profit depending on the specified HighPrice & LowPrice

in the lower left corner
--- Buy - price levels for buy orders
--- Amount - the number of purchased coins in the corresponding order
--- Sell - levels of profit taking by the sum of market orders in the grid
--- $$$ - the sum of all orders in the grid, taking into account the last active order
--- TP - profit amount by the amount of orders in the grid
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?