♥ 0 |
This is the code for bubblebuddy. I’m trying to get an alert for every time a bubble appears. Attached is what the indicator looks like. Thanks in advance.
Marked as spam
|
Private answer
For some reason when I try to edit this post this site redirects me to a blank page. Just clarify the sound on this indicator does not work not sure if I did something wrong need some assistance if you can. Marked as spam
|
|||||||||||
Private answer
When posting code of this length, it is often best to provide the code as an attached txt document. I’m not sure this code can be easily copy/pasted from the website into a Thinkorswim study. So I have attached a txt doc version to this response in case anyone has issues. Now on to the solution. I see that you have added a few lines to the very bottom.
Just delete those. Completely useless. The chart bubbles are being generated from the variable named “data”. So if you are going to get any alerts working on this, you will have to use that variable name. The value of “data” is either Double.NaN or a positive numeric value. Double.NaN means “Double Not a Number”. And we can test for this: So when It is very important you understand what I just explained so that you can grasp the next concept. Notice the indicator has a user adjustable input named: “length”. This controls the number of bars to the left and to the right of the bubble. When set to 2, the code checks two bars behind, then two bars in front to check if the current bar is the highest high or the lowest low. When set to 3, the code checks 3 three bars behind and 3 bars in front. This means a signal can NEVER be plotted on the current bar of any live chart. In fact it can NEVER be plotted on the second bar back either. The third bar to the left of the last bar on the chart, is when a bubble may be plotted when the length is set to 2. If the length is set to 3, then the soonest you will see a bubble plotted is the fourth bar to the left of the last bar on the chart. I know, you are struggling to get a handle on this. Your next question is Why? Let’s take a look at a small section of the code used to plot these bubbles:
Translated: “The current low is less than the low of two bars into the future AND the current low is less than the low of 3 bars in the past AND the current low is less than the low of 3 bars into the future” So in order for a bubble to plot, we must be able to read bars in the future. On a live chart, this is impossible to do from the last bar on the far right side of the chart. If we could, we would be rich beyond our wildest dreams. I already feel like I have gone into far too much detail explaining this. However I see this so many times. Someone finds a slick looking indicator (like the TTM Scalper) and they think to themselves: “If only I could find a way trigger an alert when that thing shows up on the chart”. Not happening. No, it is not possible and stop trying. Best we can do with this indicator to create alerts you have is to look back 2 or 3 bars into the past to see if a bubble was plotted 2 or 3 bars ago. We look back 2 bars if length is set to 2, and we look back 3 bars if length is set to 3. So we might as well use the length input so that it will adjust when the user changes the settings.
So we are checking if bubbles are on and we are checking if data from ‘length’ bars ago is some positive numeric value. Which means a bubble was plotted there. So if you have fully grasped everything to this point. You have come to realize this indicator is absolutely worthless for trading. Worthless, because we don’t have a time machine and we cannot read bars into the future on a live chart. The TTM Scalper is even worse, read more here: https://www.hahn-tech.com/ans/assignbackgroundcolor-not-working-as-expected/ If you understand this, and it was somewhat of a revelation. You know what I mean by, that palm-to-face sort of ‘ah-hah’ moment…. SHARE this everywhere you can. Spread the word and save others. Marked as spam
|
|||||||||||
Private answer
Sorry about that but in my previous answer I missed the fact that the input named ‘length’ is actually a text value and cannot be used to adjust the Alert condition. So the solution requires the addition of a a variable named ‘index’, added to the original code below The full code with the applied fixes is attached as a txt file below this answer. The file name is BubbleBuddy_Alert.txt Marked as spam
|
|||||||||||
Private answer
Yeah this indicator is useless with sound its still lagging now I see what your saying about seeing into the future. “THUD” upside my head should of drank a V8 Marked as spam
|
Please log in to post questions.
Before responding, I need you to confirm this indicator is open-source, free of copy-right claims.
Next:
I will need to fix the title and URL. I need to fix the typo, but more importantly I need to restructure the title so it is clear what you are requesting. This will assist other viewers to search for and find this solution.
The original title “I have a custome alert called bubble buddy and the sound ?”
Will become “Add sound alert to BubbleBuddy indicator”
After these changes are made, the original URL will no longer work. You will need to go to your profile and view the list of your questions in order to find the link to this question.
Your profile is automatically created when you login. from the upper left of the screen you will find a menu titled: “User Settings”. The menu contains three items: 1. Profile 2. Questions 3. Log Out
When posting open source code you get from someone else, it is customary to include details showing the original author, or at least a link where you found the code.
The gentlemen I got it from I no longer have contact with where he got it from not sure but I’ve been adding other codes from different resources this is not the original its been through many changes since I got it a year ago.
Ok, I’ll post a response to this request later this afternoon, after I fix the title and URL. Thanks for providing those additional details.
Yes sir your welcome and thank you for your service.