Create your own indicator


Category:
0
0

Hi, Pete. Have you made any post yet, about how to Create your own indicator (a .TS file)? I watched your one videos on the ttm trend indicator scan, and you just created an alert on your indicator when it went true. I didn’t know if I wrote my own custom program script, if I can make that into a .TS file, or mabye these are for indicators only and you need some other software to do it. But I didn’t know if it was difficult to make my own basic  .TS file? thanks

Marked as spam
Posted by (Questions: 3, Answers: 6)
Asked on March 7, 2018 12:03 pm
1195 views
0
Private answer

.TS file picture icon

Marked as spam
Posted by (Questions: 3, Answers: 6)
Answered on March 7, 2018 12:09 pm
0
Private answer

I suppose  before getting into the solution I should cover some details to be sure you understand what a .ts file in Thinkorswim really is (and is not).

What is your goal for using a .ts file as apposed to using a plain text file? Either one can be read by a plain text editor. So this does not hide the source code, at all.

In Thinkorswim, the file extension is more than the .ts you see after the name. And there are two separate types of these files.

STUDY.ts

STRATEGY.ts

Your computer only recognizes the .ts, while Thinkorswim will only accept it if the file name ends in STUDY.ts or STRATEGY.ts. So for your example, the fail name “new indicator.ts” is invalid and will not be recognized by Thinkorswim. Instead, you would need the file to be named: “new_indicatorSTUDY.ts” or “new_indicatorSTRATEGY.ts”. (notice in addition to adding the full file extension we also had to replace the space with an underscore).

Ok, I think that gets everyone up to speed in order to move to the next step.

Your question about whether these are for indicators only. Yes. The files are only used for importing custom studies or custom strategies. These are chart based indicators with their own specific functions.

The safest way to create your own STUDY.ts or STRATEGY.ts files are to go to your charts. Click the Edit Studies button. Navigate to a study or strategy of your own choosing. Right-click on that study or strategy and select “Export”. NOTE: You will only be able to do this with custom studies and strategies that you have added. You will not be able to do this with built in studies and strategies that come with thinkorswim.

An alternative way of creating your own STUDY.ts or STRATEGY.ts files without using Thinkorswim Export. Open any text editor on your computer. Type up the thinkscript that consists of your custom study or strategy. Then save the text document. When you save it, you must make sure there are no spaces in the file name. (and the file name cannot begin with a number). You must make sure the file name ends in STUDY.ts or STRATEGY.ts. As long as the thinkscript you saved in that file is free of errors, you can then import that file into Thinkorswim.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 7, 2018 12:51 pm
0
Private answer

Thanks Pete, it sounds like it can be done. What intents me, is in your video, You were making/getting alerts.

I read 2 other posts. https://www.hahn-tech.com/ans/how-can-i-get-text-and-email-alerts-based-on-a-custom-study-condition-in-thinkorswim/

https://www.hahn-tech.com/ans/stochastic-1-and-4-hour-scan/

So, without a .ts file, I made my own think script scan criteria, and saw in another 1 of your videos, that from the scan I have 2 options, Save as watchlist and Alert when Scan results change, which I tried that and I am looking at my alert book, and it is not updating when new stocks generate in my scan?

Also, I tried that watchlist widget and loaded it with the same name as my scan. But that does not seem to be updating either? It looks like my scan (and widget) will not refresh by itself, I have to click on the scan button to get new stocks.

So now, I am trying to get alerts from a dynamic scanner. and have them populate in a TOS alert book, or text or email. Is the scanner not suppose to refresh by itself every so many minutes? Or why is my widget not refreshing either, when I hit scan again my lists updates but my widget does not? (it is the same file name).

It looks like these alerts that are being added is going to my messages in the TOS message center. I saw the video on the condition wizard which is just 1 stock at a time, You said in that post “In a future video we will be demonstrating the new method, which enables you to get study based text/email alerts on an entire list of stocks.”is

What is the best way to get alerts on a scan for a entire list of stocks, that keeps refreshing by itself?

thanks

 

 

Marked as spam
Posted by (Questions: 3, Answers: 6)
Answered on March 7, 2018 1:38 pm
0

Wow, we are so far off from the original context of your question that I have whiplash.
Notice my response is being added as a comment to your new answer. Instead of adding a new answer to the topic, your response would best be added as a comment to my original answer. This keeps things nice and tidy and easy for others to follow along.

Having said that. It was tough to following along with all of the thing you tried. So I am responded to your last question:
“…You said in that post “In a future video we will be demonstrating the new method, which enables you to get study based text/email alerts on an entire list of stocks.” What is the best way to get alerts on a scan for a entire list of stocks, that keeps refreshing by itself?”

This is demonstrated in the following video, beginning at the 29:50 mark: https://www.hahn-tech.com/thinkorswim-overnight-range-scan-alert/

If you need further assistance I suggest you start a new thread. This time be sure to ask the question that you are actually trying to resolve. And I can tell you it has nothing whatsoever do with creating .ts files. Wow. Please be sure to include a screenshot showing your custom scan. The time frame you select for the scan will impact the “refresh frequency”. A 5 min time frame will refresh every 5 min, just like a 5 min chart. The time frame of a scan is exactly the same as it is on a chart.

( at March 7, 2018 5:36 pm)
0

Thanks, Yeah, I was watching a few different videos and trying to put it all together. The video on the ttm trend indicator scan, created an alert on your indicator (a .TS file) when it went true. Then I saw that you don’t need a .TS file, you can have a think script program and use “Alert when Scan results change” So, there was 2 parts to this. Now that I know I don’t need a .TS file, I will start a new thread on the second part of the question, if I need some more assistance on getting alerts on a scan for a entire list of stocks, that keeps refreshing by itself .
thanks again

( at March 8, 2018 6:16 am)