Futures only TOS watchlist with custom study


Not a coder, but following your vids.  I am interested in building a custom TOS watchlist for futures only.  I would also like to create a custom study to allow me to see only trades:

  1.  Close is above (or below)  200 period SMA;
  2. Close price is above (or below)a 20 period price channel for at least 2 days.

I have come up with the following script (top the high side only):

close is greater than or equal to SimpleMovingAvg(“length” = 200).”SMA” and close is greater than PriceChannel().”UpperBand” and close from 1 bars ago is greater than PriceChannel().”UpperBand” from 1 bars ago and close from 3 bars ago is less than or equal to PriceChannel().”UpperBand” from 3 bars ago

I am looking to create the watchlist that will only show futures that meet this criteria.  Also, how would I incorperate the low side into a single script or would I need to build a second script for that?

Thank you for the help.


Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on February 13, 2020 10:43 am
Private answer

What you need here is actually a custom scan. The code you place in a custom watchlist column can only display values. It cannot filter the contents of a watchlist. So you will need to take your code and apply it to a Study Filter in a custom scan. Then save that custom scan and use it as the source of your watchlist.

Your code evaluates to a true/false value so it is perfectly suited for running in a Study Filter of a scan. You can add a second Study Filter to the scan for the opposite direction. But you will need to add BOTH of these Study Filters to a new Condition Group set "Any of the following". This will cause the scan to return ticker symbols where either one of those statements is true.

Marked as spam
Posted by (Questions: 36, Answers: 2445)
Answered on February 13, 2020 2:33 pm