♥ 0 |
Hi Pete; First of all, How are you feeling, I heard you were ill. I hope you are OK now. I am still new to this coding & testing environment. I am trying to test 2 new concepts I never used before, learning on the fly, little by little. I tried to find my answers on the internet, but I am still confused. I am trying to replace an arrow with a number in a bubble. Plus I am trying to utilize the REC code to make this thing work. Enclosed below is the code I am trying to utilize and an attachment to illustrate what I am trying to accomplish. The arrows are suppose to point to a valley, I am trying to use the bubble with a successive number as a replacement.
Marked as spam
|
Private answer
Yes, I am doing much better. Thanks for asking. Here is the code you provided in the attachment:
ReviewLet me review this for you since you stated that you are trying to learn. First of all, please be sure not to use any reserved words as variable names. " http://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/rec.html So instead of using
You should be using something like this:
Recursive Variable DeclarationsNotice from the link I provided above this type of variable assignment has been obsoleted. However it is still supported and is very useful for making your code easier to read. When you define a recursive variable it helps make it more readable to make that assignment using Back to Your CodeNext thing I will mention is that none of this code you provided will work. There are many things wrong with this code and some of those problems are syntax errors. It looks like you tried to employ an if/then/else statement but you are missing the I am taking a wild guess. But it seems you wanted to create a recursive variable and each time the variable named "Valley" was true you wanted to add a 1 to the current value of the recursive variable. If so, then I would suggest the following:
Search for RecursionThere are many examples of recursive variables in this forum. So if you want to learn how to use this then just enter "recursion" in the search box at the top of the topic. This link shows the results of searching the "Chart Studies" topic: https://www.hahn-tech.com/ans/cat/studies/?question_type=all&search=recursion The Chart BubbleNow let's take a look at the section of code where you are trying to create those chart bubbles.
It is important to note that you can never insert the AddChartBubble() function into the middle of an if/then/else statement. So this section of code will also fail. Since the AddChartBubble() function always stands along we need to apply it just like the example shown in the Thinkorswim language reference: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble.html Before I provide a line of code to replace this, I need to mention one other mistake. You see where you have added an if/then/else statement to set the color of the chart bubble? Well the Properly Structure Chart BubbleHere is what you might use for the chart bubble:
This statement checks if SummaryI have gone through all of this without checking any of this code in the platform. So this is just going from memory and my understanding of how the Thinkorswim language works. If you find any of my suggestions do not work just leave me a note in the comments section and I will make any required adjustments. Marked as spam
|
Please log in to post questions.