OPEN-SOURCE SCRIPT
Обновлено ﴾҂﴿ Open Positions

OVERVIEW
If you follow the options trading approach similar to Markus Heitkoetter, then
you would usually have a fixed/max number of positions, and for some of those positions, you will have assigned stocks. If you flew any
rescue missions, you might even have more stock positions assigned at different strike prices.
This indicator visualizes for you the different positions that was assigned, your current average price, a possible place for the next
rescue mission and current open trades.
A note on Trading View and indicators and databases. What is not possible (today), is that an indicator can have different values
as you click through the charts. It is also not possible to have a database from where we can read the current positions (although
this would be a nice thing as feature). So, the way to solve the problem today is simply to have the fixed number of
positions as indicator parameters in a nice and easy format. The parameters are parsed and the if the underlying chart
has existing positions, they are visualized.
The down side of this above (supported) approach is that once the indicator is removed and placed back on the chart, all data stored
as parameters are lost :(.
The "simple" workaround is that we "store" our data inside "code" --> let us make you a programmer in 3 simple steps!
1. If you have read up to this point, then you already have the code open in Pine Editor. The first step is to make a copy of the code. Look at
the right of the screen for "○○○" button and then select the option "Make a copy...". Give it a new name, recommended "[YourName] Open Positions".
2. Although it looks like nothing has changed, actually you are now reading the same text, but in your copy of the indicator. See towards the left of
the screen where the name is shown. So let us switch the indicator on the chart from the original to this copy.
(A) Remove the original indicator from the chart with "X"
(B) Towards the right of the screen is "Add to Chart" option to add this indicator to the chart.
3. Last step is to add all your positions in the code. Simply scroll down a few lines and ONLY modify between "↓↓↓" and "↑↑↑". There are very detailed
instructions on exactly what you may do and should do. Don't do anything else :). Each time after you are finished, simply press "Save" on the
right of the screen. You can close the Pine Editor with the "__" button on the right.
*. If one day you have more positions to update, simply use the "{}" option next to your indicator to land again here in the source code, and repeat
step #3 as many times as you wish.
If you follow the options trading approach similar to Markus Heitkoetter, then
you would usually have a fixed/max number of positions, and for some of those positions, you will have assigned stocks. If you flew any
rescue missions, you might even have more stock positions assigned at different strike prices.
This indicator visualizes for you the different positions that was assigned, your current average price, a possible place for the next
rescue mission and current open trades.
A note on Trading View and indicators and databases. What is not possible (today), is that an indicator can have different values
as you click through the charts. It is also not possible to have a database from where we can read the current positions (although
this would be a nice thing as feature). So, the way to solve the problem today is simply to have the fixed number of
positions as indicator parameters in a nice and easy format. The parameters are parsed and the if the underlying chart
has existing positions, they are visualized.
The down side of this above (supported) approach is that once the indicator is removed and placed back on the chart, all data stored
as parameters are lost :(.
The "simple" workaround is that we "store" our data inside "code" --> let us make you a programmer in 3 simple steps!
1. If you have read up to this point, then you already have the code open in Pine Editor. The first step is to make a copy of the code. Look at
the right of the screen for "○○○" button and then select the option "Make a copy...". Give it a new name, recommended "[YourName] Open Positions".
2. Although it looks like nothing has changed, actually you are now reading the same text, but in your copy of the indicator. See towards the left of
the screen where the name is shown. So let us switch the indicator on the chart from the original to this copy.
(A) Remove the original indicator from the chart with "X"
(B) Towards the right of the screen is "Add to Chart" option to add this indicator to the chart.
3. Last step is to add all your positions in the code. Simply scroll down a few lines and ONLY modify between "↓↓↓" and "↑↑↑". There are very detailed
instructions on exactly what you may do and should do. Don't do anything else :). Each time after you are finished, simply press "Save" on the
right of the screen. You can close the Pine Editor with the "__" button on the right.
*. If one day you have more positions to update, simply use the "{}" option next to your indicator to land again here in the source code, and repeat
step #3 as many times as you wish.
Информация о релизе
UPDATES v2- Added the multi-position line concept to paste open trades directly from Excel. --> Please read the text at the top of the code for detail information.
Информация о релизе
UPDATES v3- Fixed a stupid typing mistake! :(
Информация о релизе
UPDATES v4- Fixed small indexing mistake.
Информация о релизе
UPDATES v5- Slightly changed rescue point from 33% to 30%
- Rescue point is only visualized if price is down more than 10% from lowest strike (to reduce clutter on the chart, only show when it becomes a factor)
- Do NOT show the "average cost basis" when only one trade!
- Stripped the -PUT/-CALL syntax (which only Brian likes) from documentation in favour of the standardized CSP/CC and/or SC/SP syntax
- Add a quantity parsing for contracts, for example 2*CSP@130, which would translate to a possible added 200 stocks
- Based on the extra short PUT positions compute a possible new "cost basis" on assignment
- In cases where multiple trades at same strike, merge trades into one label
- Change date string separater to ">", but still keep backwards compatible the "[]" sequence for this release
Информация о релизе
UPDATES v6- Added P&L Label
Информация о релизе
UPDATES v7- Cosmetic changes....
Информация о релизе
UPDATES v8- Stripped out the code modify option. Basically nothing really changed.
- Added a few more slots for people with slightly larger dry docks :)
Информация о релизе
UPDATES v9- Added support for CASH|Premium|Credit
- Changed slightly sequence of code so that the more "important" labels are on-top if there is an overlap.
- Removed "Show Compact Labels" as it did not seem to work -- email me if required back!
Информация о релизе
UPDATES v10- Small cosmetic change in one label.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.