TradingView
bunulu
15 Th05 2021 19:15

Position calc 

MATIC Network / TetherUSBinance

Mô tả

Current script was created to help faster calculate possible gain or loss from a furure trade. Making money management a bit simpler, by changing values you can adjust proper trade leverage and see possible target values

Phát hành các Ghi chú

Changed shares precision, updated interface

Phát hành các Ghi chú

Added Entry price display and adjusted display layout

Phát hành các Ghi chú

emoji updated for position size field

Phát hành các Ghi chú

Added volatility indicator, giving credits to @HomelessLemon for this part from his script.
Added shares input, in case you want to type specific amount of shares for your position, and adjusted calculations accordingly.

Phát hành các Ghi chú

Adjusted stop loss text based on short/long positions

Phát hành các Ghi chú

Added stop loss field and created optional section for all optional fields. Tooltip info updated as well

Phát hành các Ghi chú

- Converted label to table view, for better alignment options.
- Fixed some decimimal calculation

Phát hành các Ghi chú

- Added ATR option, changed some fields

How to use this indicator
By default 10k is hardcoded for future trade position. This field can be ignored if you want to open position based on shares or coins amount. Proper position size will be visible in the table. Same rule applied with risk percent which is set by default to 2% and it shows stop loss values for both long and short position. But if it's needed you can put custom stop loss, target values and risk will be calculated accordingly. Keep in mind what current price is used by default to calculate future trade, you can change this in 'Entry price' field.

I also added ATR indicator which can help you to decide which stop/profit values to put for current timeframe. It also has multiplier and other adjustable fields.

There is also sentiment column which can be hidded to save amount of space.
Table position and size can be changed as well.

Enjoy.


Phát hành các Ghi chú

- Changed atr logic.
- Added atr loopback period parameter to see how many times for given period atr was crossed.

Phát hành các Ghi chú

Added ATR based stop loss amount which is visible on the label

Phát hành các Ghi chú

Added posibility to hide table.
Added another type of stop label, now it's a bit smart and tries to adapt direction based on current price and to which part of the atr band it's closer.

Future plans:
Add smart target label
Adjust visual settings

Phát hành các Ghi chú

You can use position size calculator in a 2 ways, either rely on the table and you can adjust all values, either you can adjust atr band and rely on the price labels. Soon i will update the readme with more examples

Phát hành các Ghi chú

Added small visual adjustments

Phát hành các Ghi chú

now manual position reflected on the label as well

Phát hành các Ghi chú

bug fixing

Phát hành các Ghi chú

bugfixes and cleanup

Phát hành các Ghi chú

label text changes

Phát hành các Ghi chú

fixed risk reward label value

Phát hành các Ghi chú

Label size change added

Phát hành các Ghi chú

Converted to v5
Alert added if price touches atr level
Bình luận
NAK1987
Best one on trading view , amazing job . Thanks :)
bunulu
@NAK1987, thank you!
NAK1987
@bunulu, Your welcome, love your code , so clean . I learned a few things reading it over :) The finished product looks like an RPG games health and status box too btw.
bunulu
@NAK1987, that's great, please let me know if you still think what something is missing, or what can make this script more simple or useful
NAK1987
@bunulu, Nope , you nailed it , its perfect :) I am using it for especially for day trading higher volatility breakout plays ( daytrades ) . Really helpful ...
xmd1979
great script, thank you )
cryptomir27
Hello. I desperately try to find a simple script for displaying only the following things on my chart and nothing else: 1) The amount of token I have 2) The entry price 3) The actual value of my token based on the current price 4) The percentage of Profit or Loss with his value. 5) Actual value of position. So in practice let's say I bought 1 Bitcoin at the price of 20k and today his price is 40k the display will be= Position size: 20k - Entry: 20k - Profit or Loss: 20k / +100% - Total value: 40k. All other infos (such stop price, risk, take profit and more) are not relevant for me and could be hidden. Your script make almost all I need, do you think it is possible to make a little update by adding what I describe on point 3, 4 and 5 please ? Making also optional the display of the "Stop" column and of littles icons (such $ bag, finger up/down and more) would be wonderful for keeping my charts clean and light. In any case, thank you for your nice script :-)
bunulu
@cryptomir27, did you check my other implementation, maybe it will fit better your needs tradingview.com/script/9WB0o5of-Signals/
cryptomir27
@bunulu, Cool your other Signals script is exactly what I was looking for. However I'm unclear about how to do for introduce the amount of token share I have for each asset/chart and to save the result. I miss something ?? Because actually the introduced value remain always the same...
dellteixeira
TKS man. :)
Thêm nữa