Can someone help creating scan code in ThinkorSwim? - ThinkOrSwim Programming | futures io social day trading
futures io futures trading

Can someone help creating scan code in ThinkorSwim?
Updated: Views / Replies:7,199 / 2
Created: by dlisenko Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Can someone help creating scan code in ThinkorSwim?

  #1 (permalink)
Trading Apprentice
Chicago IL
Trading Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Stocks
Posts: 1 since Feb 2013
Thanks: 0 given, 0 received

Can someone help creating scan code in ThinkorSwim?

Scan stocks on the short side

[type = stock] and [country = us] and[daily ema(60,daily volume) > 300000] and
[daily low > yesterday's daily low] and
[yesterday's daily low > 2 days ago daily low] and
[SMA(10, close) < EMA(30, close)]and
[daily close > daily SMA(10,daily close)]and
[daily close < daily EMA(30,daily close)]and
[weekly sma(10,weekly close) < weekly ema(30,weekly close)]and
[ADX Line(10) > 20.0]and
[close >= 10]

Scan stocks on the Long side

[type = stock] and [country = us] and[daily ema(60,daily volume) > 300000] and
[daily high < yesterday's daily high] and
[yesterday's daily high < 2 days ago daily high] and
[sma(10, close) > ema(30, close)]and
[daily close > daily ema(30,daily close)]and
[daily close < daily sma(10,daily close)]and
[daily close > daily sma(200,daily close)]and
[weekly sma(10,weekly close) > weekly ema(30,weekly close)]and
[ADX Line(10) > 20.0]and
[close >= 5]

Reply With Quote
  #2 (permalink)
Knowledge Seeker
Dubai, UAE
Trading Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
RedK's Avatar
Posts: 171 since May 2012
Thanks: 44 given, 140 received

here's how I would do this... for example your SHORT scan would look like this

def Vol = if ExpAverage (volume, 60 ) > 300000 then 1 else 0;
def daily = if low > low[1] and low[1] > low [2] then 1 else 0 ;
def SMA10vsEMA30 = if Average(close, 10) < ExpAverage(close, 30) then 1 else 0;
def ClosevsSMA10 = if close > Average(close, 10)  then 1 else 0;
def ClosevsEMA30 = if close < ExpAverage(close, 30)  then 1 else 0;
def wkSMA10vswkEMA30 = if Average(close(period = AggregationPeriod.WEEK), 10) < ExpAverage(close(period = AggregationPeriod.WEEK), 30) then 1 else 0;def ADX = if DMI(10).ADX > 20 then 1 else 0;
def Price = if close >= 10 then 1 else 0;

Plot Short = Vol * (Daily + SMA10vsEMA30 + ClosevsSMA10 + ClosevsEMA30 + WkSMA10vswkEMA30 + ADX + Price);
I didn't test this as a scan, only as a normal study .. and AFAIK, TOS scans don't allow calling a secondary aggregation, so although the bold line would work in a plot study, it may/should not work in a scan.. so it may need to be separated in a different scan "column"

the successful short candidates will show max score in the scan (in this case a 7), the non-candidates will have lower values, including a 0 if they fail the volume condition .. but that last "plot" line can be changed to show only these ones with a full score and ignore all others, with an IF statement (if the sum is 7 show a "SHORT!" otherwise a blank.

the Long scan would be similar after changing the logical operators ">" and "<"

an interesting exercise thanks for sharing, and hope this helps,


Reply With Quote
The following user says Thank You to RedK for this post:
  #3 (permalink)
Trading Apprentice
Carteret NJ
Trading Experience: Intermediate
Platform: TOS & OX
Favorite Futures: Stocks and Options
Posts: 7 since Oct 2014
Thanks: 3 given, 0 received

Need some help creating Scan code for TOS

I know how to insert the scans into TOS platform,
I,m just not savvy enough to know how to create the thinkscripts.

The filter scan i'm looking for are.

#1 50 sma must be angling or moving up

#2 slow stochastic with sma % D period 3 crosses oversold 15

#3 momentum lenght 9,price close, turning up and crossing -5

#4 MACD with sma,fast lenght 5,slow lenght 15,macd lenght 20 and crossing above -2.00

Thanks in advance
Dedicated To Your Success!

Reply With Quote


futures io > > > > > Can someone help creating scan code in ThinkorSwim?

Upcoming Webinars and Events (4:30PM ET unless noted)

Donít Let One Bad Trade Wipe Out Your Entire Account w/GFF Brokers

Apr 23

New CME Micro Indices: New Trading Opportunities w/FuturesTrader71

Elite only

Benefits of Trading the Micro E-Minis w/Stage 5 & CME Group

Apr 30

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming TTM_squeeze into a scan wireyear ThinkOrSwim Programming 6 September 2nd, 2013 10:56 PM
Average Volume Scan / Scan Results TonyB ThinkOrSwim 5 March 23rd, 2013 02:20 PM
Interval Property in a scan moonshadow ThinkOrSwim 0 July 10th, 2012 07:29 PM
How to install Range Bar code in Thinkorswim rcs9234 ThinkOrSwim 5 July 7th, 2011 02:12 PM
Creating a function to condense code brightredmegaphone NinjaTrader Programming 10 December 16th, 2010 11:27 PM

adx, code, ema, es, est, how to, macd, momentum, platform, scan, short, sma, stochastics, stocks, think or swim, thinkorswim, thinkscript, tos, type, values, volume

All times are GMT -4. The time now is 03:39 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2019-04-22 in 0.21 seconds with 14 queries on phoenix