RedKTrader

Simple Portfolio Tracker

RedKTrader Cập nhật   
This is just a simple portfolio tracker that i started to play around with - i'm sure there are smarter ways to do this, but i chose the simpler way :) -- please feel free to use this, or consider it as a starting point to your own indicator.

i will come back later and add some more stuff once i get time. for example, show the total value, recent change, P&L % ..etc

So the simple idea is to track a portfolio of few positions and watch how the total portfolio and the PnL changes over time as the price of the individual holdings move up and down. it can be added to any chart.

The code is currently set to track 5 positions - settings allow to enter if the positions is used or not, symbol, amount and cost price..

** note: more positions can be added by editing the code and copying and pasting the marked "position block" that contains the input statements and the calculations, then changing/replacing the position identifier (_1, _2, ..etc) in all variables with new number..
--- don't forget to add these extra positions you insert in the code to the formula lines that calculate the totals

i tried to make this as easy as possible in the code. the code includes a sample portfolio as default values just to help "demo" how this works

the input is made easy, thanks to the recent addition of the "inline" feature in the input() statement

i don't know if some traders will find this useful ?? or if more about how to use it is needed.. let me know in the comments.. as i mentioned, i was just playing with the idea over the weekend so didn't really put a lot of work into it.

Credits and thanks to @boji1 for inspiring this :)




Phát hành các Ghi chú:
- Support up to 10 positions per portfolio
- added the Summary (info) box with key portfolio stats all up and for current bar based on the chart timeframe
- some other code clean-ups

Next
- i'd like to include a way to add some "free cash". most position traders will always keep free cash in the account
- change the code to use arrays - will make things a lot easier and cleaner
- refine the infobox and add some more portfolio stats
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?