Price within X percent of high within Y days - ThinkOrSwim | futures io social day trading
futures io futures trading

Price within X percent of high within Y days
Updated: Views / Replies:3,108 / 2
Created: by eddieo Attachments:1

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 within X percent of high within Y days

  #1 (permalink)
Trading Apprentice
New York, NY
Futures Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: Options
Posts: 4 since Feb 2015
Thanks: 1 given, 0 received

Price within X percent of high within Y days

TOS offers a "Near_High_Lows" study for its scans, image attached.

Parameters on the built in version of this are "Current price is within [X] percent of the [252] period [High/Low]"

I'm looking to customize this to add a "within n bars" parameter. Could anyone give me a thinkscript tip on how to do this?


P.S. The ThinkScript behind the default study is:

#Wizard text: The current price
##Wizard input: price
#Wizard text: is within
#Wizard input: choice1
#Wizard text: % of the
#Wizard input: period
#Wizard text: period
#Wizard input: choice

def price = close;
input period = 252;
input choice = {default High, Low};
input choice1 = 3;

def hi = high;
def lo = low;

plot scan;
switch (choice) {
case High:
scan = price >= highest(hi,period)* ((100 - choice1) /100);
case Low:
scan = price <= lowest(lo,period)* ((100 + choice1) /100);;

Attached Thumbnails
Price within X percent of high within Y days-capture.png  
Reply With Quote
  #2 (permalink)
Trading Apprentice
Los Angeles,CA USA
Futures Experience: None
Platform: MT4 TOS
Favorite Futures: Anything Profitable
Posts: 8 since Mar 2017
Thanks: 0 given, 0 received

I figured ide add this for people that like your thinkscript code for thinkorswim ( TOS ), the code below is to add a COLUMN in the COLUMNS that will display the how far the current price is from the days HIGH in percentage format.

plot x=round(100*((close/high)-1),1);

Reply With Quote
  #3 (permalink)
Trading Apprentice
Los Angeles,CA USA
Futures Experience: None
Platform: MT4 TOS
Favorite Futures: Anything Profitable
Posts: 8 since Mar 2017
Thanks: 0 given, 0 received

If you want it charted, here is a STUDY that will allow u to chart it in the top left corner. Of the TOS chart.


#HINT: This chart label shows the percent change down from the high.above \n\n IMPORTANT: If a new IPO you need to change the length to max of number of days since IPO release.

input length = 252;  #HINT length: There are 252 trading days in a year or change to 1 for DAYS high or 5 for weekly high
input show_label = yes;
input Label_Color_Choice = {"magenta", "green", "pink", "cyan", "orange", default "red", "blue", "gray", "violet"};

def top = highest(high(period = AggregationPeriod.DAY), length);
def prctDrop = ((close(period = AggregationPeriod.DAY)/top)-1);

def NewHigh = high == top;

AddLabel(show_label and !NewHigh, "Percent down off high: ( " +  AsPercent(prctDrop) + " )  ", GetColor(Label_Color_Choice));

AddLabel(show_label and NewHigh, "new 52-week high TODAY", (CreateColor(51, 204, 0)));

Reply With Quote


futures io > > > > Price within X percent of high within Y days

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
close of previous bar less than twenty five percent from the high or low The Gurok ThinkOrSwim 2 August 18th, 2014 04:15 PM
Price Headley's Percent R Thinkscript study ikholobayev ThinkOrSwim Programming 1 May 22nd, 2013 05:21 PM
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
I need a programmer to code previous 4 days high and low. mrphr NinjaTrader Programming 10 November 15th, 2011 02:46 PM
US poverty at new high: 16 percent, or 49.1M kbit News and Current Events 0 November 7th, 2011 02:53 PM

All times are GMT -4. The time now is 10:24 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-25 in 0.08 seconds with 20 queries on phoenix via your IP