♥ 0 |
Please advise. Thank you. Kim
Marked as spam
|
Private answer
Let’s make it easier on future visitors to this site by showing the code you attached in a separate text file:
So the first line states. Plot when FullK crosses from Above the FullD on the first bar and ends up with FullK below the FullD on the second bar. Then to this you have added a strange bit of code. The code is saying, (excluding the current value of FullK) the highest value of FullK from the last three bars crosses below 80. I cannot imagine that last section of code doing anything at all.
And it is certainly not going to do anything when used as a condition for an alert. Now let’s see how we patch this up and get it working. In your description you stated only that you wanted the signal and alert when the FullK crossed from above 80 to below 80. However your code includes an extra rule. And that is that the FullK should be crossing below the FullD. What we don’t know from both sources is whether you want to test when both rules occur at the same time of if you want to allow for some number of bars to pass before FullK dives back below 80. In the code I provide, I am going to break things down into pieces to make it easier to read the code and understand what each part is doing. You can read more about the Alert() function here: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Others/Alert.html My example shows you how to define the text that displays with your alert. You can find a list of the available sounds here: http://toslc.thinkorswim.com/center/reference/thinkScript/Constants/Sound.html And don’t forget that once you have added an Alert() statement to a study, the settings for that alert can be adjusted from the “Edit Studies” window. Marked as spam
|
|||
Private answer
Hi Pete, Thank you! That’s very helpful. Follow up questions: If I want to add the logic for Overbought, all I need to change in the code is just to change from “Oversold” to “Overbought” and change “80” to “20” and “Below” to “Above”? Please advise. Thanks! Marked as spam
|
|||
Private answer
Hi Pete, It’s working nicely. Thanks! Follow up questions:
Marked as spam
|
|||
Private answer
Hi Pete, Do I need this line of code in the scanner: Plot signal = fullKCrossesFromOverbought and fullKCrossesBelowFullD; Or I just have your line of code: def signal = fullKCrossesFromOverbought and fullKCrossesAboveFullD; ? And the scanner will scan correctly with that? Please advise. Thanks! Marked as spam
|
Please log in to post questions.
Editors’s note. I have changed both the title of the question as well as the URL to more accurately reflect the context of this entire post. This will assist others how are seeking a similar solution to find this post.