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,546 / 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

Reply
 
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

Hello,

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:
 
Code
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;

ConfirmBar.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar.SetDefaultColor(GetColor(1));
ConfirmBar.SetLineWeight(1);

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):
 
Code
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];

ConfirmBar1.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar1.SetDefaultColor(GetColor(5));
ConfirmBar1.SetLineWeight(1);

ConfirmBar2.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar2.SetDefaultColor(GetColor(5));
ConfirmBar2.SetLineWeight(1);

ConfirmBar3.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar3.SetDefaultColor(GetColor(1));
ConfirmBar3.SetLineWeight(1);

ConfirmBar4.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar4.SetDefaultColor(GetColor(1));
ConfirmBar4.SetLineWeight(1);

ConfirmBar5.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
ConfirmBar5.SetDefaultColor(GetColor(1));
ConfirmBar5.SetLineWeight(1);

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 futures.io 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 05: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, 138 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

 
Code
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);

SetUpBar.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
SetUpBar.SetDefaultColor(color.cyan);
SetUpBar.SetLineWeight(1);

Reply With Quote

Reply



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)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

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 03:20 PM
Possible study with ThinkScript? TonyB ThinkOrSwim 0 March 4th, 2012 11:27 PM
S&P Intraday Price Study Jeff65 Emini Index Futures Trading 7 January 20th, 2012 11:38 PM
EasyLanguage Price Action PaintBar Study Big Mike EasyLanguage Programming 5 April 18th, 2010 01:28 AM


All times are GMT -4. The time now is 08:39 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-13 in 0.09 seconds with 19 queries on phoenix via your IP 54.160.245.121