Adjusting enumerated inputs in custom scans


Category:
0
0

Many custom scripts have input statements like:
input intraDaySpan = {Default “SameDay” , “OverNight”};

I understand that built-in scripts have drop-downs to select one of these values. How is one value specified in a custom script? You said, in one of the videos, that drop-downs are not yet possible for custom scripts. Examples and references would be very helpful. My searches did not answer this question.

Thank you.

RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 2)
Asked on June 12, 2021 8:20 pm
19 views
0
Private answer

I had to update the title of your question to make sure it correctly describes the context of your request. This will make sure anyone else trying to search for a solution to this question will be able to quickly locate it using the search function.

This applies to Study Filters within custom scans. When you select any of the built-in study filters the user interface displays the user inputs as clickable objects that allow us to change the parameters without modifying the code. Just as you stated, our custom Study Filters do not provide this functionality. I sure hope at some point in the future they add this feature. But unless the users of Thinkorswim take the time to submit this as a feature request to TD Ameritrade support it will have zero chance of ever being added.

So the point of your question is this. When you have a custom Study Filter that uses Enumerated input parameters, how do we adjust those user inputs if we do not have clickable objects that allow users to select from one of the options in the enumerated list?

Taking your example:

input intraDaySpan = {Default “SameDay” , “OverNight”};

There are two options in this enumerated input. The first one is "SameDay" and the second option is "OverNight". Because the word "default" appears immediately before the first option, this enumerated input is currently set to "SameDay". So how do we change this to use a value of "OverNight"? We simply move the word "default" to in front of the second item in the enumerated list:

input intraDaySpan = { “SameDay” , Default “OverNight”};

Yes, that's all there is. Nothing more to it than that.

Marked as spam
Posted by (Questions: 39, Answers: 3713)
Answered on June 12, 2021 9:06 pm
Perfect! Thank you.
( at June 13, 2021 8:06 am)