TradingView
TradingWolf
٢٥ كانون الثاني يناير ٢٠٢٣ ١٣:٤٧

Golden Pocket 

Bitcoin / U.S. dollarBitstamp

الوصف

Golden Pocket
This marks up the fibonacci retracement levels of 0.65 and 0.618 by default, these levels are often referred to as the golden pocket.
They are known by this because when price has an impulse either to the up or downside, price will end up retracing at some point. This Golden pocket often lines up with other means of confluence where it's considered a good entry price from the retrace.

Unlike standard fib retracement indicators, these boxes will extend with current price until they are hit. As well as this, there is a moving average filter which you can set to higher timeframes meaning that you can choose to only look for golden pockets which are following the higher time frame trend. You can easily monitor all of your settings by setting up just 1 alert.

Settings
You have the option to enable/disable the line which marks out the pivot points the fib is being calculated from, you can also change the colour and style of the line.
Below this you have the option to choose what colour the fib boxes are and what colour they change to once price hits it. If you want them to disappear change the colours opacity to 0%.
If you want to change the golden pocket levels you can do that by changing the 0.618 or 0.65 levels in the settings.
The pivot distance controls what part defines a pivot high or low, it must be the highest/lowest to the left/right of the pivot candle count.
MA filter will only accept golden pockets which are trending with the Moving average.
You can change all the settings of the Moving average which acts as a filter including which timeframe it is calculated on.

Alerts
Simply toggle this on int the settings and then click on the 3 dots next to the indicators name, 'add alert', leave the top boxes as they are, you can name the alert anything you like but once you confirm this, it will monitor all golden pockets on the particular asset and timeframe you are looking at. The alerts are set up to trigger as soon as price touches one of the boxes.

Use Cases
We like setting are moving average up on the daily timeframe and using the Moving average filter so we know we are only trading with the higher timeframe trend. From there we can set up alerts on any lower timeframe.

Feel free to use any part of this script in your own code, please just give us a mention so we can check out your contributions to the community as well!
Happy to take in any suggestions or ways of improving

ملاحظات الأخبار

After recommendations I have updated the alert set up to use HeWhoMustNotBeNamed library for alerts which loop through array.
Feel free to offer any other suggestions

ملاحظات الأخبار

New Moving Average added
Filter options to choose whether you need both Moving average trend lines as a filter or just the fast one.
A new setting to remove boxes if price reaches x(%) away to help keep a cleaner chart
التعليقات
PineCoders
Trendoscope
Good job. One issue I can see though. You are trying to call alert in loop but your alert frequency is set to once per bar. Hence, it will only alert for first item in the loop and then stop.

You may not be able to use freq_all as well - it might lead to continuous alerts on every tick. There is a way to overcome that. Think about it. Good luck.
TradingWolf
@HeWhoMustNotBeNamed, Thanks! means a lot coming from you. Great point, I will switch it to freq_all then put in some measures to stop duplicate signals in the same candle
intelligentBoa1976
This doesn't work for me doesn't draw box only shows MA .
TradingWolf
@intelligentBoa1976, What ticker/timeframe are you finding this issue on?
MasBart
@TradingWolf, this happened to me as well, only after unselecting the MA Filter the box appeared.
TradingWolf
@MasBart, @intelligentBoa1976 , The MA filter will only allow boxes to appear if both the pivot High & Low are on the trend side of the MA. if you have the MA Filter on at it set to the same timeframe you are on, you are not likely to see any signals. It is made so say you are on the hourly timeframe or lower, you can set the MA to be looking at the Daily timeframe or any other higher time frame. You do this so you know your MA is following the higher time frame trend whilst you can still be looking for entries on lower time frames. Let me know if that doesn't make sense, I have also made a video on youtube explaining this.
MasBart
@TradingWolf, thanks for your explanation. Will watch your video.
skarborus
Amazing script! your work is greatly appreciated.

Is it possible to filter out boxes if they are X% away from the price? and redraw them once price is back within range. getting too many boxes on some timeframes (not scaling price chart only)

Thanks!
TradingWolf
@skarborus, Interesting Idea, I will look into it.
المزيد