Condition Wizard: Offset and Within settings


Category:
0
0

Please explain the exact use of the “Offset:” and “within” settings when working within the Edit Condition box. I’ve viewed a few videos which demonstrate the Offset number being changed but I have not been able to find the use for the “within” setting. Do both Offset numbers need to be the same and how do those settings relate to the “within” setting ? Thanks for any guidance…..

Marked as spam
Posted by (Questions: 2, Answers: 0)
Asked on October 17, 2022 4:40 pm
333 views
0
Private answer

I have explained and demonstrated both of these in various videos and in the forum it is nearly impossible to describe them any more clearly. The best solution I can provide is to direct you to the language resources published for Thinkorswim.

The "Within" parameter is explained here:

https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/within

And when adjusting the "Offset" parameter in the condition wizard that setting actually gets converted to "bars ago". And the explanation for that is here:

https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/bars

Here are some examples to help explain this within the context of writing custom chart studies and scans...

The "Offset" parameter must be a positive integer value and it works the same way as the index syntax. Such that the following line reads the close value of the previous bar:

def previousClose = close[1];

Which is identical to this:

def previousClose = close from 1 bars ago;

And is the same thing as setting the "Offset" parameter to a value of 1.

The "Within" parameter value must also be a positive integer and its value is used to determine if a true/false condition was true "within" the span of X bars ago. With "X" being the value you enter for the "Within" parameter. For instance the following statement will return true if there was a green candle somewhere within the most recent 5 bars:

def greenCandle = close > open within 5 bars ago;

It is the same thing as building a condition for "close", "greater than", "open" and on the right side of the condition you set the "Within" parameter to  a value of 5.

Here are a list of videos in which I provide real world examples and clear explanations of these parameters:

https://www.hahn-tech.com/thinkorswim-condition-wizard/

https://www.hahn-tech.com/thinkorswim-condition-wizard-watchlist/

https://www.hahn-tech.com/thinkorswim-automated-round-trip-trades/

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 17, 2022 7:06 pm