I am posting this question again, hopefully this time with additional clarity. I have also attached my .ts file. I will admit that I am a novice at using ToS and programming in general, so regardless of the usefulness of this study/strategy, it has primarily served as a way for me to practice using thinkscript.
I have created a study that is a sort of combination of a pattern, study, and strategy all in one. I hope for it to become useful in the case of a double bottom, that visually would appear as two consecutive right triangles (you can get an idea of what this looks like if you run the study on DCIX looking at a 1Y:1D chart, image attached below). As of now the strategy does not perform exactly as I would like it too, but this is my first rough draft of the code.
I should note that I choose to create my own way of tracking profit/loss because I wanted to be able to execute multiple buy or sell orders in series and was unable to figure out how to do this using the ToS built in strategy methods.
Anyway the issue I am having with this study is at the end of it; I wanted to be able to execute scanning criteria within this study rather than within the stock hacker (mostly for organization, I only wanted to have to edit my code in one file). The output of the scanning criteria would declare a boolean variable that could then be referenced in a scan (searching only for stocks that output a true condition or the inverse). Below is a snippet of my code for quick reference, as well as the custom study filter I am using to call this file. If you have any other questions regarding my code, please ask.
Marked as spam
Something broke when you tried to post your code. Some of the symbols were converted to HTML character references. So your code cannot be copied and pasted for testing. Even if this were not the case, the code you provided is incomplete. You are missing declarations and value assignments for
First item to note. Referencing custom studies in a Study Filter has been shown NOT to work. Perhaps the developers at Thinkorswim have updated their platform to support this. But I thought I would mention that as it’s not so obvious. Always best to use the full code for a Study Filter.
Second, even if you could reference a custom study. The only items you can reference are plot statements. Since
In summary, I really can’t do a thing to help you get this working because I don’t have the full code. I understand you may have reasons to prevent this code from being published in an open forum. In that case you may consider our premium services: https://www.hahn-tech.com/about/
Marked as spam
Please log in to post questions.