♥ 0 |
Hey, Pete, I’ve been trying to script as scan for TOS, to indicate stocks that have just experienced–or maybe within three bars–a crossover of the TOS indicator “cybercycles.” I thought I could work off one of your other videos but I have not been able to quite make it work. The last line of my script is where I’m going wrong. Below is my script, followed by the script for the original study. # declare lower; input alpha = 0.07; assert(alpha > 0 and alpha < 2, “‘alpha’ must be between 0 and 2: ” + alpha); def smooth = (price + 2 * price[1] + 2 * price[2] + price[3]) / 6; #CCO.SetDefaultColor(GetColor(8)); ORIGINAL: # declare lower; input alpha = 0.07; assert(alpha > 0 and alpha < 2, “‘alpha’ must be between 0 and 2: ” + alpha); def smooth = (price + 2 * price[1] + 2 * price[2] + price[3]) / 6; plot CCO = cycle; CCO.SetDefaultColor(GetColor(8));
Can you tell me where I went wrong, or at least point me to a tutorial video where you do something similar? Thanks, David/hm
Marked as spam
|
Private answer
I just saw this question after already shutting down Thinkorswim for the day. But I’ll offer a quick suggestion and check back later to see if this did the trick. You say it is your last line of code that is not correct. Not sure if you mean it causes errors or is simply not producing the expected results. So here is your last line of code:
I am assuming you want to scan for CCO crossing above Signal or Signal crossing above CCO. I see you are using the “crosses” keyword here but you may be lacking a direction. You can read more about that here: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/Crosses.html So here is the way I define the crossing of two plots:
Let me know if this helps. Be sure to up-vote any answers that best solve your question. Marked as spam
|
|
Private answer
You are so awesome! I only had a quick minute, but I replaced my last line with yours and ran a scan that appears to have worked perfectly. I will read your link on direction and may make some changes based on that, though it may not be necessary if I add other parameters to the scan as well. I so appreciate your help. D/hm Marked as spam
|
Please log in to post questions.