![]() Using variables reduces calls to TOS iData server. # Comment out unnecessary portions to preserve TOS memory and enhance speed # Author: Kory Gill, VERSION HISTORY (sortable date and time (your local time is fine), and your initials # Study to indicate count consecutive up/down bars. Perhaps this technique can be applied to other studies and strategies. This image should give you a clear idea of what we're doing. Search other articles and the documentation for other usages like how to carry a previous value/condition forward until it changes.įor this example, we will count the number of consecutive up and down bars (based on close) on a chart. You can also reference the values of your own variables!ĬompoundValue is a powerful function, and one you can use to in a couple ways. If you are new to thinkscript, remember that your code runs on each bar and calculates everything based on that bar and any forward or backward looking values (like close being the close 1 bar in the past). This is also an example of how to count things in thinkscript. Like roulette in Vegas, the longer the ball keeps landing on Red, the more likely it is to land on Black the next turn, right? Well, in roulette, the odds are the same each turn, but perhaps in the stock market, all trends change at some point.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |