ATR Box - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


ATR Box
Updated: Views / Replies:7,045 / 3
Created: by TonyB 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

Reply
 
Thread Tools Search this Thread
 

ATR Box

  #1 (permalink)
Go Bears!
Bay Area, CA - US
 
Futures Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Futures: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 134 received

ATR Box

Anyone aware of a Thinkscript code that would provide the ATR on a chart, within a box? It would seem easy enough, but my first two attempts have failed...

For anyone interested, try this:

declare upper;
input price = close;
input ATR_Length = 14;
input Show_Labels = yes;
def ATR = WildersAverage(TrueRange(high(period = aggregationPeriod.DAY)[1], close(period = aggregationPeriod.DAY)[1], low(period = aggregationPeriod.DAY)[1]), ATR_length);
def r_atr = round(ATR, 2);
#AddChartLabel(show_labels, concat("ATR(14d)=", r_atr), color.white);
AddChartLabel(if r_atr[1] < r_atr then yes else no, concat("ATR(14d)=", r_atr), Color.GREEN);
AddChartLabel(if r_atr[1] > r_atr then yes else no, concat("ATR(14d)=", r_atr), Color.RED);

++++++

Ok, it works great on a daily chart, but it's not working on a hourly or weekly (the other two I've tried thus far). I'll keep playing with it and ask for help on the TOS chat room... Ah, I see it.

Ok, this does the trick:

declare upper;

input ATRLength = 14;

def ATR = Average(TrueRange(high, close, low), ATRLength);
AddChartLabel(yes,concat("ATR(" ,concat(ATRLength, concat(") = ", ATR))),color.YellOW);
+++++

I was playing around with "getAggregationPeriod" as that gets the period on the chart, but I was doing something wrong. I checked the above against TOS's native ATR offering, and it matches-up...

Attached Thumbnails
ATR Box-capture.png  

Last edited by TonyB; April 10th, 2012 at 02:32 AM.
Reply With Quote
The following 5 users say Thank You to TonyB for this post:
 
  #2 (permalink)
Trading Apprentice
Raleigh, NC
 
Futures Experience: None
Platform: thinkorswim
Favorite Futures: Stocks
 
Posts: 1 since Dec 2012
Thanks: 0 given, 1 received

ATR Code - It's a Beautiful Thing

Thanks for the code! This is exactly what I was looking for. I did change the function AddChartLabel to AddLabel. I don't have AddChartLabel in my version of think or swim. That's all I did and it works beautifully. Thanks again!

Reply With Quote
The following user says Thank You to jmhjrh245 for this post:
 
  #3 (permalink)
Elite Member
Minneapolis, MN
 
Futures Experience: Advanced
Platform: Market Delta, Think or Swim
Broker/Data: CQG
Favorite Futures: ES, NQ, 6E, CL, GOOG, AAPL, AMZN, GS
 
Posts: 26 since Sep 2012
Thanks: 1 given, 16 received



TonyB View Post
Anyone aware of a Thinkscript code that would provide the ATR on a chart, within a box? It would seem easy enough, but my first two attempts have failed...

For anyone interested, try this:

declare upper;
input price = close;
input ATR_Length = 14;
input Show_Labels = yes;
def ATR = WildersAverage(TrueRange(high(period = aggregationPeriod.DAY)[1], close(period = aggregationPeriod.DAY)[1], low(period = aggregationPeriod.DAY)[1]), ATR_length);
def r_atr = round(ATR, 2);
#AddChartLabel(show_labels, concat("ATR(14d)=", r_atr), color.white);
AddChartLabel(if r_atr[1] < r_atr then yes else no, concat("ATR(14d)=", r_atr), Color.GREEN);
AddChartLabel(if r_atr[1] > r_atr then yes else no, concat("ATR(14d)=", r_atr), Color.RED);

++++++

Ok, it works great on a daily chart, but it's not working on a hourly or weekly (the other two I've tried thus far). I'll keep playing with it and ask for help on the TOS chat room... Ah, I see it.

Ok, this does the trick:

declare upper;

input ATRLength = 14;

def ATR = Average(TrueRange(high, close, low), ATRLength);
AddChartLabel(yes,concat("ATR(" ,concat(ATRLength, concat(") = ", ATR))),color.YellOW);
+++++

I was playing around with "getAggregationPeriod" as that gets the period on the chart, but I was doing something wrong. I checked the above against TOS's native ATR offering, and it matches-up...


thanks for this info...i was looking for the same thing as well. Since I trade off a small timeframe I would like the have the daily chart ATR value pull up on the smaller timeframe I trade off of in this format. Would you know how to code this? I am too lazy to look at a daily chart... from an organizational standpoint I like to have several equities/futures products up on my screens at once so higher time frame charts just take up space.

Reply With Quote
 
  #4 (permalink)
Go Bears!
Bay Area, CA - US
 
Futures Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Futures: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 134 received

For some reason my futures.io (formerly BMT) emails notification were in my spam folder! Glad the code has served some well...

Honestly, it has been over a month since I've logged into TOS. Between getting on-board with TS in late Jan, two toddlers and being in escrow with a pending move, TOS has not been a priority... I must say that I really like TS. Their options offering, a forte of TOS, has improved and is quite competent actually.

Thankfully, the new house has a dedicated office with an incorporated desk that will support my 4-monitor set-up beautifully. It will also have sufficient space for my gym equipment: weight bench, inversion table, recumbent bike and some other items. The bad news, it will take nearly 2 months before we can move-in as the place will need some TLC. Painted-over wallpaper in almost every room!

To get us back on topic, I'll be keeping TOS for sure. IRA accounts are free there, among other neat offerings...

Reply With Quote

Reply



futures io > > > > > ATR Box

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
ADX and ATR indicator in panel 1 perryg NinjaTrader 29 May 22nd, 2014 07:17 AM
Help for chart based ATR price... wldman NinjaTrader Programming 24 September 8th, 2011 04:14 PM
StopLoss as fraction of ATR FArias NinjaTrader Programming 5 February 23rd, 2011 03:45 PM
ATR Stop Trail need help pls Falco11 NinjaTrader Programming 6 January 20th, 2011 05:53 AM
ATR Bands with 3 modes cclsys The Elite Circle 11 December 29th, 2009 10:05 AM


All times are GMT -4. The time now is 11:37 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-14 in 0.11 seconds with 20 queries on phoenix via your IP 54.227.51.103