Price Headley's Percent R Thinkscript study - ThinkOrSwim Programming | futures io social day trading
futures io futures trading

Price Headley's Percent R Thinkscript study
Updated: Views / Replies:2,822 / 1
Created: by ikholobayev 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 90,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

Price Headley's Percent R Thinkscript study

  #1 (permalink)
Trading Apprentice
Durham, NC, USA
Futures Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: Stocks
Posts: 1 since May 2013
Thanks: 0 given, 0 received

Price Headley's Percent R Thinkscript study


I am a new member of this forum. I am trying to create a script based on Price Headley's %R method.

Here is the description of the method:

Williams %R is set to length = 30 days

When %R crosses above -20 that is considered a bullish setup bar.
The closing price of any one of the next five bars must close above the bullish setup bar's high. When that happens it is considered to be a favorable condition for a long entry.

Here is my script:
declare upper;

def WR = WilliamsPercentR("length" = 30);
def SetupBar = if WR crosses above -20 then high else double.NaN;
plot ConfirmBar = close > SetupBar within 5 bars;


The line highlighted in red doesn't work for some reason. I can overcome this with brute force by adding the following statements (but I don't like it very much):
declare upper;

def WR = WilliamsPercentR("length" = 30);
def SetupBar = if WR crosses above -20 then high else double.NaN;
plot ConfirmBar1 = close > SetupBar[1];
plot ConfirmBar2 = close > SetupBar[2];
plot ConfirmBar3 = close > SetupBar[3];
plot ConfirmBar4 = close > SetupBar[4];
plot ConfirmBar5 = close > SetupBar[5];






The brute force code results in multiple arrows appearing each time when a new bar makes a higher close in relation to the setup bar's high. I want the arrow to appear only once when that happens (be it on the 1st, 2nd ... 5th candle).

Please register on to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Could anyone please help me with this? Thanks!

Last edited by ikholobayev; May 16th, 2013 at 04:17 PM.
Reply With Quote
  #2 (permalink)
Knowledge Seeker
Dubai, UAE
Futures 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, 137 received

I would do it like this.. it's not the optimum code but simple.. may inspire a different approach for you.. the entry level will be visually painted for you and you get a single arrow up (but for each new crossing though).
cheers, K

declare upper;

def WR = WilliamsPercentR("length" = 30);
plot SetupBar = WR crosses above -20 ;

plot LongEntry = if SetupBar then high
else if SetupBar[1] then high[1] 
else if SetupBar[2] then high[2] 
else if SetupBar[3] then high[3] 
else if SetupBar[4] then high[4]  else double.NaN;

LongEntry.setpaintingStrategy (paintingstrategy.DASHES);
LongEntry.Setlineweight (2); LongEntry.setdefaultcolor(color.cyan);


Reply With Quote


futures io > > > > > Price Headley's Percent R Thinkscript study

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apple's Stock Price Is Down Nearly 10 Percent—Time to Buy? Quick Summary News and Current Events 0 October 9th, 2012 02:20 PM
Possible study with ThinkScript? TonyB ThinkOrSwim 0 March 4th, 2012 10:27 PM
S&P Intraday Price Study Jeff65 Emini Index Futures Trading 7 January 20th, 2012 10:38 PM
EasyLanguage Price Action PaintBar Study Big Mike EasyLanguage Programming 5 April 18th, 2010 12:28 AM

All times are GMT -4. The time now is 07:28 PM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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 2018-05-20 in 0.08 seconds with 19 queries on phoenix via your IP