an equivalent to TOS ‘WITHIN’ Function?

Optuma Forums Optuma Scripting an equivalent to TOS ‘WITHIN’ Function?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68867
    Krishen
    • Topics: 1
    • Replies: 0
    • Posts: 1

    ThinkorSwim’s Thinkscript has a function, ‘WITHIN’: suppose one wanted to those occasions when 2 or more conditions are all fulfilled within the span of any 2 bars: one might have been fulfilled on the most current bar, one might have been fulfilled on the bar preceding it. WITHIN allow one to do this in ThinkScript. Is there a way to achieve this same effect within Optuma’s Scripting language?

    #68875
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    We don’t have a single function that does this for multiple criteria.  You can use the BarsTrue() function to give a Window for each criteria to pass, so they do not have to trigger at the same time.

    Here’s an example using 2 days, with an MA Cross and a Gap Up.

    Here is how it looks on the chart:

    Ex5

    The MA Cross was 1 day before the gap up, but as both happened within the last 2 days, the script passed.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest