TradingView
p2pasta
5 cze 2021 09:51

High Timeframe POC 

Bitcoin / TetherUSBinance

Opis

Because the big Bitcoin crash I have been looking a lot at high timeframe metrics. I never spent much time learning POC so I decided to create a little script for determining these on higher timeframes.

Currently included: Monthly, 3 months and 6 months.

/* DEFINITION */
Point Of Control (= POC) is a price level at which the heaviest volumes were traded.
Value Area High/Low (=VAH/VAL) is a range of prices where the majority of trading volume took place. Naturally, Value Area High being the top price level and Value Area Low being the lowest. POC always is between the two.

/* HOW TO TRADE WITH THIS INDICATOR */
The basis for POC is determining bias on whichever timeframe you choose.

1. Identify a POC on the timeframe of your choosing.
/* If you choose a "low" timeframe (monthly here) then make sure to look at the higher timeframes to see how it is playing against a higher timeframe POC.
2. When the price is moving away from the POC (either to the upside or downside) this will confirm or invalidate the trade.
3. You can now enter the trade on bias or wait for a retest of the same POC.

/* EXAMPLE TRADES /*
Here is a screenshot of some of the trades that are possible solely using the POC and some common sense.

s3.tradingview.com/snapshots/s/slOJhCAZ.png

Informacje o Wersji

Fixed: Text labels visible when POC disabled

Informacje o Wersji

Added three color inputs (1M, 3M & 6M) to change the POC, VA and label colors visible on the chart.

Informacje o Wersji

Updated the code so that the screenshot of the indicator above was showing the monthly POC properly

Informacje o Wersji

Added an input to only calculate from a number of months back
~ default value = 6 (minimal value = 1, maximal value = 12) ~
This is done to fix the overlapping of lines/labels and reduce loading time of the indicator.

Informacje o Wersji

Merged the "Value High" and "Value Low" input into one "Enable" input since the option to enable/disable just one of them won't be used in my opinion.

Informacje o Wersji

Added comments/structure to the source code for readability/reusability and removed unnecessary code

Informacje o Wersji

Added credit
Added user inputs for "Labels" to enable/disable visibility (default=True) and choose the location of the label ('Right', 'Center' or 'Left' on the POC line ~ default = 'Right')

Informacje o Wersji

VERSION 1.1

- Added the weekly POC which is labeled by the week number.
Default = true, Weeks back default = 4, Default color = #9C27B0
- Added the custom POC
Default = 6M, Months back default = 12, Default color = #2A2E39
Supports '3M' and '6M' at the moment. Unfortunately, you can't show the 3M and 6M at the same time anymore, I did this for organizing purposes.
If there is need and requests to make sure both can be seen together again I will probably add a 2nd custom POC from which you can choose the second custom timeframe.
To disable the custom POC you need to select 'Disabled' under the options list from the Custom -> Timeframe input.
- Reorganized user input making this indicator solely used around the weekly, monthly and custom POC.
- Merged the 'Enable labels' input into the 'Labels location' input.
Now, you can select 'disable' from the options list to make sure no labels are rendered.
- Differentiated the 'Months back' input/function to work different
(this function handles effiency in rendering making sure to only render from a certain amount of months back).
Before this version, this input applied to all POC's that were being rendered. Now, you can set 'Weeks back' on the weekly POC and 'Months back' on the monthly POC. This results in different use cases i.e only rendering the last 4 weekly POC's but show the last 6 monthly POC's (as seen on the screenshot)

Informacje o Wersji

Added the option to enable/disable the 'POC' part from the labels. I wanted to add enabling/disabling this option because displaying the full label is unnecessary if only this indicator is used on a chart. If you are using other indicators to display lines you might consider enabling this option for better overview on which lines the POC's are.

Informacje o Wersji

Fixed proper label placement on the custom POC

Informacje o Wersji

Added 'readable' input (boolean) under 'Options'. Default is set to false. Enabling this makes sure that the lines are being rendered from the current bar therefore only showing lines where no candle has been.

Informacje o Wersji

Default was not set to false (inconsistent with the release notes above)

Informacje o Wersji

VERSION 1.2

Added a to-do list
Feel free to suggest functionality and raise issues through the comments or dm
Added label size
Small, normal, large currently supported. Default is set to 'Small'
Fixed label placement issues
I used a certain percentage to display the text above the label but this does not work on every chart.
Now, I place the label on top of the POC to make sure it is always sized properly however this gave another issue; not being able to read the label. The background color of the label is now the same color that is being used for the POC.
Added label text color
To make sure label text can remain visible and customized to your liking.
Added 'current bar' option to 'Labels' input
Many requests stated that there also should be an option for the labels to display next to the current bar so I have added this option as well.

Informacje o Wersji

Checked off three items on the to-do list

Informacje o Wersji

Fixed label placement if 'readable' mode is turned on (left and center did not work properly)

Informacje o Wersji

BIG UPDATE

Hi guys! Thanks for all the likes the past months. While I have been quiet, I have silently been building a market profile script that combines both high and low timeframe POC's (and more) into one indicator. The indicator is currently still private but you can have access with this link: tradingview.com/script/lNnRGRIZ-Market-Profile-p2pasta/

I will still be updating the HTF and LTF POC scripts but mainly focused on the Market Profile script.

In this update:
+ BIG CALCULATION CHANGE. Thanks to @LonesomeTheBlue the indicator now works better than before.
+ Added the option to enable developing POC
+ Fixed proper label placement if 'readability mode' was turned on.

Informacje o Wersji


  • Introduced user input groups to better categorize and manage settings, namely "POC", "VA", "Weekly", "Monthly", "Custom", and "Options".
  • Added a 'Developing POC' toggle under the "POC" group to optionally display the developing Point of Control.
  • Introduced a 'Weekly' group to manage settings related to weekly time frames including enabling/disabling, setting the number of weeks back, color, label location and size, and text color.
  • Similar settings grouping was done for 'Monthly' and 'Custom' time frames.
  • Added a 'Custom Timeframe' setting under 'Custom' to allow selection between Disabled, 3 Months, and 6 Months.
  • Introduced a 'Readable' toggle under 'Options' for better readability.
  • Incorporated an 'Options' group to house additional settings like 'POC Inside Label' and 'Bar Colouring'.
  • Refactored the calculation and plotting sections for better organization and code readability.
  • Implemented various helper functions to simplify and modularize the code, e.g., f_resInMinutes, f_timeFrom, getLabelLocation, getLabelSize, getMonthName, and plot_customTimeFrame.
  • Enhanced Monthly plotting with the addition of monthly channel and R1, R2, R3, S1, S2, S3 calculation and plotting.
  • Implemented a new function plot_customTimeFrame to handle custom time frame plotting, to reduce code redundancy.


The code is now more organized and easier to manage with logical separation of constants, inputs, functions, calculations, and plotting operations.
Komentarze
marcosperez85
Thank you so much for sharing this code with the trading community p2pasta!! I will include it in my chart and start experimenting with it!! cheers!!
p2pasta
@marcosdelsur05, You are welcome! Let me know if there is anything you are missing :)
HomieSingh
Why does POC change its place when moving to a different TF?
lawfuller
Could you help me understand how you calculate each POC? I've tried to validate your POCs by drawing my own TV-native VPFRs month by month. But those POCs are at significantly different locations to your monthly POCs. And your DPOCs are at significantly different locations to those drawn by the TV-native VPSV HD.
lawfuller
Bug report: looks like the dark-grey monthly POCs display duplicate Decembers instead of one December and one November. Love the indicator, though. Thank you!
clandestino-
Hi Pasta, firstly thanks for this great indicator. I was reading the comments and found something similar to what I want to do with the indicator. I guess what some users meant is when we choose the weekly period. It shows us all the pocs starting from the beginning of the week until now. That's why you can't see the poc for let's say for the first week of september because volume profile starts from this week until now. Is there a way to fix this in the settings? I couldn't find it. If not are you planning to add it? Cheers!

Edit: Basically, can we apply the fixed range with this indicator by changing the ending time frame? Thanks!
barniy
Hello and thanks for this amazing tool, the result of this is not equal to tradingview built-in volumeprofile when i test it with fixed range for a month or week, is there anyway to fix it ?
WOLFSTEN
How do I fix this to a specific timeframe?
p2pasta
@WOLFSTEN, What do you mean? In the settings you are able to select for which high timeframes the POC will be show. If enabled, you can further customize how it is being shown on your chart. You can also also copy the source code into your own indicator and make some changes to it. DM for further questions.
Więcej