TradingView
TaTaTaCrypto
4. Jan. 2023 16:26

Lines and Table for risk management 

Fantom / TetherKuCoin

Beschreibung

ABOUT THIS INDICATOR
This is a simple indicator that can help you manage the risk when you are trading, and especially if you are leverage trading. The indicator can also be used to help visualize and to find trades within a suitable or predefined trading range.

This script calculates and draws six “profit and risk lines” (levels) that show the change in percentage from the current price. The values are also shown in a table, to help you get a quick overview of risk before you trade.

ABOUT THE LINES/VALUES
This indicator draws seven percentage-lines, where the dotted line in the middle represents the current price. The other three lines on top of and below the middle line shows the different levels of change in percentage from current price (dotted line). The values are also shown in a table.

DEFAULT VALUES AND SETTINGS
By default the indicator draw lines 0.5%, 1.0%, and 1.5% from current price (step size = 0.5).
The default setting for leverage in this indicator = 1 (i.e. no leverage).
The line closest to dotted line (current price) is calculated by step size (%) * leverage (x) = % from price.
Pay attention to the %-values in the table, they represent the distance from the current price (dotted line) to where the lines are drawn.

* Be aware! If you change the leverage, the distance from the closest lines to the dotted line showing the current price increase.


SETTINGS
1. Leverage: set the leverage for what you are planning to trade on (1 = no leverage, 2 = 2 x leverage, 5 = 5 x leverage...).
2. Stepsize is used to set the distance between the lines and price.


EXAMPLES WITH DIFFERENT SETTINGS
1) Leverage = 1 (no leverage, default setting) and step size 0.5 (%). Lines plotted at (0.5%, 1%, 1.5%, and –0.5%, –1%, –1,5%) from the current price.
2) Leverage = 3 and stepsize 0.5(%). Lines plotted at (1.5%, 3.0%, 4.5%, and –1.5%, –3.0%, –4.5%) from the current price.
3) Leverage = 3 and stepsize 1(%). Lines plotted at (3%, 6%, 9%, and –3%, –6%, –9%) from the current price.

The distance to the nearest line from the current price is always calculated by the formula: Leverage * step size (%) = % to the nearest line from the current price.

Kommentare
GarethSA
Also ....
Sorry just trying to make your script better.

What about an option of Auto that chooses current price as base or a manuel option where we input our buy price then it show us values?
GarethSA
Can you also maybe allow an option to move the table to bottom right?
GarethSA
Great script.
Can you explain this STEP SIZE again please?

he line closest to dotted line (current price) is calculated by step size (%) * leverage (x) = % from price.
TaTaTaCrypto
@GarethSA,
Thanks for your feedback, I will look into option of moving table when I update the script next time.

The idea with step size is to specify a range within you want to trade and to use this range as a visual support. The step size is therefore used to determine the distance from the current price to the different lines in your range. By default the step size is set to 0.5 and the leverage to = 1, which means that the two closest lines to the current price will be at 1.005 x price, and -0.995 x price. The distance from the two closest lines to the current price is therefore +/-0.5%.

If you change the leverage to = 2 the distance to the two lines (above and below price) will be doubled (Note: 2 x leverage = double risk). The distance between the lines will always remain the same in relation to each other.

So for example, if you want to trade during a shorter time frame, you would probably use a lower step size as the changes in price normally wouldn’t be as dramatic. If you use a larger step size the range will be bigger and you wouldn’t see all lines of the 6-line range.

My thinking here is that the majority of trades should take place within these six lines. In addition, the limits for take-profit (TP) and stop-loss (SL) would also be within this range.
So let's say you set the step size = 1 and leverage = 2 you vill have 6 lines at 2%, 4%, 6% above, and -2%, -4%, -6% below. If you for example want to trade with higher risk (3 x leverage) and during a shorter time frame you could for example change the leverage to 3 and step size to 0.5, then the 6 lines will be at 1.5%, 3%, 4.5% above, and -1,5%, -3%, -4.5% below.

Hope this makes sense!
GarethSA
@TaTaTaCrypto,

YES GREAT.

Thanks for your lengthy reply. Appreciate it
Mehr