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

Price within X percent of high within Y days
 Updated: March 30th, 2017 (10:50 PM) Views / Replies: 1,314 / 2 Created: April 7th, 2015 (04:26 PM) by eddieo Attachments: 1

 Welcome to futures io.

# Price within X percent of high within Y days

 April 7th, 2015, 04:26 PM #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? Thanks, EddieO 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

Los Angeles,CA USA

Futures Experience: None
Platform: MT4 TOS
Favorite Futures: Anything Profitable

Posts: 4 since Mar 2017

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.

COLUMN CODE BELOW: PERCENT FROM CURRENT DAYS HIGH

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

Los Angeles,CA USA

Futures Experience: None
Platform: MT4 TOS
Favorite Futures: Anything Profitable

Posts: 4 since Mar 2017

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.

CHART THE PERCENT FROM HIGH IN CORNER (customizable)
Thinkscript STUDY CODE BELOW:

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

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

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

Elite only

Elite only

Jan 18

Jan 23

Elite only

Elite only

## Ran Aroussi: TBA

Elite only

 Similar Threads Thread Thread Starter Forum Replies Last Post The Gurok ThinkOrSwim 2 August 18th, 2014 05:15 PM ikholobayev ThinkOrSwim Programming 1 May 22nd, 2013 06:21 PM Quick Summary News and Current Events 0 October 9th, 2012 03:20 PM mrphr NinjaTrader Programming 10 November 15th, 2011 03:46 PM kbit News and Current Events 0 November 7th, 2011 03:53 PM

All times are GMT -4. The time now is 02:40 AM.

 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-17 in 0.07 seconds with 20 queries on phoenix via your IP 54.82.56.95