How to Build a Custom Scan - ThinkOrSwim Programming | futures.io
futures io futures trading


How to Build a Custom Scan
Started: by mbgaskins Views / Replies:12,865 / 6
Last Reply: Attachments:3

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

How to Build a Custom Scan

  #1 (permalink)
Trading Apprentice
Tulsa, OK
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: Stocks
 
Posts: 2 since Nov 2012
Thanks: 1 given, 1 received

How to Build a Custom Scan

I have been trying to build a custom scan using PPO & ADX.

I can get a label with the PPO and ADX and color the label based upon the PPO and ADX action but cannot get a scan to work.

I want to scan for stocks that have PPO down from 5 days ago and ADX up from 5 days ago.

Following is the code I have. Can someone suggest how to get this to run as a scan?

Thanks!
Brad

#PPO ADX Label

Input PPOShortEMA = 9;
Input PPOLongEMA = 26;
Input ADXLength = 14;

Def PPO = (MovAvgExponential(Close,PPOShortEMA) - MovAvgExponential(Close,PPOLongEMA))/MovAvgExponential(Close,PPOLongEMA);
Def PreviousPPO = (MovAvgExponential(Close,PPOShortEMA)[5] - MovAvgExponential(Close,PPOLongEMA)[5])/MovAvgExponential(Close,PPOLongEMA)[5];
Def CurrentADX = ADX(ADXLength);
Def PreviousADX = ADX(ADXLength)[5];

addlabel(yes,concat("PPO ", ROUND(PPO*100,2)), if PPO < PreviousPPO then color.RED else if PPO > PreviousPPO then color.green else color.gray);
addlabel(yes,concat("ADX ", ROUND(ADX(ADXLength),2)), if CurrentADX > PreviousADX then color.RED else if CurrentADX < PreviousADX then color.green else color.gray);

Reply With Quote
The following user says Thank You to mbgaskins for this post:
 
  #2 (permalink)
Elite Member
desert CA
 
Futures Experience: Intermediate
Platform: NT7, TOS
Broker/Data: AMP/wCQG, TDA
Favorite Futures: CL,YM
 
Posts: 2,018 since Jul 2011
Thanks: 2,206 given, 1,533 received

Hi, unless I'm mistaken, TOS Scan->Stock Hacker seems to have only custom study filters in the form of expressions.

So I made one custom filter for PPO down from 5 days ago & ADX up from 5 days ago, and then another one for the reverse conditions.

Then clicking on scan came up with a result list. Which the results can be saved as a watchlist and then seen in "Marketwatch" -> Quotes


Scripts for custom study filters. (reverse "<" and ">" operators for reverse condition custom study filter)
-------------------------------------------

((MovAvgExponential(Close,9) - (MovAvgExponential(Close,26)/MovAvgExponential(Close,26)))
< (MovAvgExponential(Close,9)[5]- (MovAvgExponential(Close,26)[5])/MovAvgExponential(Close,26)[5]))

and

ADX(14) > ADX(14)[5]



script for column headers:
------------------------------------

# PPO down from 5 days ago

Input PPOShortEMA = 9;
Input PPOLongEMA = 26;
Input ADXLength = 14;

Def PPO = (MovAvgExponential(Close,PPOShortEMA) - MovAvgExponential(Close,PPOLongEMA))/MovAvgExponential(Close,PPOLongEMA);
Def PreviousPPO = (MovAvgExponential(Close,PPOShortEMA)[5] - MovAvgExponential(Close,PPOLongEMA)[5])/MovAvgExponential(Close,PPOLongEMA)[5];
Def CurrentADX = ADX(ADXLength);
Def PreviousADX = ADX(ADXLength)[5];

plot result = PPO;
result.assignValueColor(Color.gray);

assignBackgroundColor(if PPO < PreviousPPO then color.RED else if PPO > PreviousPPO then color.green else color.gray);


-------------------------------------

#ADX up from 5 days ago

Input PPOShortEMA = 9;
Input PPOLongEMA = 26;
Input ADXLength = 14;

Def PPO = (MovAvgExponential(Close,PPOShortEMA) - MovAvgExponential(Close,PPOLongEMA))/MovAvgExponential(Close,PPOLongEMA);
Def PreviousPPO = (MovAvgExponential(Close,PPOShortEMA)[5] - MovAvgExponential(Close,PPOLongEMA)[5])/MovAvgExponential(Close,PPOLongEMA)[5];
Def CurrentADX = ADX(ADXLength);
Def PreviousADX = ADX(ADXLength)[5];

plot result = PPO;
result.assignValueColor(Color.gray);

assignBackgroundColor( if CurrentADX > PreviousADX then color.RED else if CurrentADX < PreviousADX then color.green else color.gray);


Attached Thumbnails
How to Build a Custom Scan-ppo_dn5_adx_up5.jpg   How to Build a Custom Scan-marketwatch.jpg   How to Build a Custom Scan-ppo_up5_adx_dn5.jpg  

Last edited by Cloudy; April 12th, 2013 at 12:26 PM.
Reply With Quote
The following 3 users say Thank You to Cloudy for this post:
 
  #3 (permalink)
Trading Apprentice
Tulsa, OK
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: Stocks
 
Posts: 2 since Nov 2012
Thanks: 1 given, 1 received


Thanks. This gives me what I asked for but not what I wanted. Back to the drawing board to refine my parameters.

This will allow me to get the scan I want as soon as I get the parameters correct.

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Buenos Aires, Argentina
 
Futures Experience: Intermediate
Platform: NinjaTrader, TOS
Favorite Futures: ES
 
Posts: 47 since Jun 2013
Thanks: 39 given, 4 received

I am always getting an "RESULT_ERROR Script execution timeout" when I try to scan many of my custom filters.

Some work, but many (like the following) will fail. Do you think its a temporary error by TOS or I am doing something wrong?

 
Code
close("period" = AggregationPeriod.DAY) is greater than DarvasBox()."Upper Band" from 1 bars ago
Any tip will be much appreciated! Thanks

Reply With Quote
 
  #5 (permalink)
Elite Member
Newbury Park , California/United States
 
Futures Experience: Intermediate
Platform: ToS, Tradestation
Favorite Futures: Futures
 
Posts: 3 since Oct 2013
Thanks: 5 given, 1 received

PPO & ADX

Futures Edge on FIO
Hi,

I was wondering if you were able to come up for a scan or have seen an indicator for the PPO & ADX scan you were working on. Were you looking for candidates for the PPO/ADX "squeeze'? ( I'm not sure what else to call it)
I am working on a couple things for that trade. Let me know you if that is a trade you do. I have seen a good webinar by Wendy Kirkland discussing how she trades that in her portfolio. Thanks!

Josh

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Carteret NJ
 
Futures Experience: Intermediate
Platform: TOS & OX
Favorite Futures: Stocks and Options
 
Posts: 7 since Oct 2014
Thanks: 3 given, 0 received

In reference to this post,
does anyone have the think-script to place in TOS to scan for these PPO pinch as a scan setup
or any PPO scan.

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Phoenix, AZ
 
Futures Experience: Intermediate
Platform: Nijatrader
Broker/Data: Interactive Brokers
Favorite Futures: Stocks, Options
 
Posts: 8 since Oct 2014
Thanks: 4 given, 0 received

The P3 Squeeze in Ninjatrader

I have been working on Kirkland's squeeze in Ninjatrader as a system and not just a scanner. I have tried a number of ways with comparing a bunch of adx(n)s and ppo(n)s and setting a flag for each and when both hit within some spread buying. Sometimes the "squeeze" doesn't come at the same precise time. I have also tried the Ninjatrader Slope function for adx() and ppo() and setting buy signals based on that. It does work, but usually on all squeezes and not just the major ones. I am looking to do a ratio so I can get the really close squeezes. Maybe by normalizing the adx/ppo ratio. Any ideas?

http://gfullmer.atwebpages.com/screen.html


Last edited by gfullmer; October 6th, 2016 at 11:28 PM. Reason: Invalid image
Reply With Quote

Reply



futures io > > > > > How to Build a Custom Scan

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Mastering Trading Pysychology w/Brett Steenbarger & Trading Technologies

Elite only

PTMC Protrader Platform First Look w/Sergey Sokolov

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only

FIO Video Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

April

Process above all else w/Anthony Crudele @ Futures Radio Show

Elite only

Machine Learning - Quantitative Trading w/Martin Froehler @ Quantiacs

Elite only

Market Dynamics w/Peter Davies @ Jigsaw Trading

Elite only

Ask Me Anything w/Patrick Rooney @ Trading Technologies

Apr 18

Ask Me Anything w/FuturesTrader71

Apr 19

Machine Learning w/Kris Longmore

Elite only

Market Analysis w/Dave Forss

Apr 25

Introducing iSystems with Stage 5 Trading

Apr 27
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone help creating scan code in ThinkorSwim? dlisenko ThinkOrSwim Programming 2 October 13th, 2014 08:23 PM
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
looking to modify vroc and use in a scan. adross1 ThinkOrSwim Programming 2 February 25th, 2012 04:17 PM


All times are GMT -4. The time now is 06:18 AM.

no new posts
Page generated 2017-03-24 in 0.11 seconds with 20 queries on phoenix via your IP 54.204.194.23