Persistency of X

Optuma Forums Optuma Scripting Persistency of X

  • This topic has 2 replies, 2 voices, and was last updated 1 year ago by Jon.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #67635
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    Hello,

    I’m looking to establish Persistency (PS) of certain criteria over a set amount of time, for example 20 day PS of Money Flow Index > 50 would indicate that the MFI has been over 50 for more than 20 days or essentially any indicator you’re looking at above or below whatever threshold for more than whatever period. I’ve tried TIMESINCESIGNAL using the reverse thinking but not sure what to do with the repeats after the initial trigger.

    #67636
    Matthew
    • Topics: 5
    • Replies: 677
    • Posts: 682

    Hi,

    I would use the BarsTrue() function to find the point where MFI has been above 50 for 20 bars, then use switch to keep the value true until the MFI crosses below 50.

    Chart example:

    Ex6

    #67637
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    This is excellent, thanks a lot

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

Pin It on Pinterest