2 ATRs in one indicator. Having a problem - ThinkOrSwim | futures io social day trading
futures io futures trading


2 ATRs in one indicator. Having a problem
Updated: Views / Replies:154 / 4
Created: by LittleFinger Attachments:3

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 100,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
 

2 ATRs in one indicator. Having a problem

  #1 (permalink)
Elite Member
Denver Colorado/USA
 
Trading Experience: Intermediate
Platform: Sierra Chart, ThinkorSwim
Favorite Futures: ES,ZN,6E,CL,GC
 
LittleFinger's Avatar
 
Posts: 50 since May 2017
Thanks: 33 given, 33 received

2 ATRs in one indicator. Having a problem

Hello, I am trying to accomplish something that should be easy to do without any code modification.

I simply want 2 ATR lines drawn in one indicator window so that I can compare the behavior of a longer and shorter term reading. The problem is that the scaling of the chart changes the positioning of the lines relative to each other as you scroll forward or backward in time. I need the ATR lines to be static, so a numerical scale might do the trick instead of the default % scale.

Here's what I mean:

the overlapping is done in the edit studies window:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Below is 2 pics of the same data, but in the 2nd one i scrolled forward one day so you can see what I mean about the positioning of the lines changing relative to each other.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

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


I want the lines to remain static, not float up and down to fit to the scaling.

Can anyone help with this?

Thanks

Reply With Quote
 
  #2 (permalink)
Elite Member
Boston MA USA
 
Trading Experience: Beginner
Platform: None
Favorite Futures: ES, Stocks, ETFs
 
Posts: 63 since Jan 2015
Thanks: 43 given, 56 received

It looks like in order to display two plots that properly maintain their relative y-scaling, they must be in the same study.

In TOS, the ATR is done in a built-in "TrueRange" function, so the study is one line of code, at the top level.
So here's a dual ATR for you . Not a general solution or setting, but I think it will work the way you want, in this case.

(In Edit Studies, click Create, paste in this code, give it a name and click OK.)

 
Code
declare lower;

input length1 = 14;
input length2 = 50;
input averageType = AverageType.WILDERS;

plot ATR1 = MovingAverage(averageType, TrueRange(high, close, low), length1);
ATR1.SetDefaultColor(GetColor(8));

plot ATR2 = MovingAverage(averageType, TrueRange(high, close, low), length2);
ATR2.SetDefaultColor(GetColor(1));

Reply With Quote
The following user says Thank You to ocpb for this post:
 
  #3 (permalink)
Elite Member
Denver Colorado/USA
 
Trading Experience: Intermediate
Platform: Sierra Chart, ThinkorSwim
Favorite Futures: ES,ZN,6E,CL,GC
 
LittleFinger's Avatar
 
Posts: 50 since May 2017
Thanks: 33 given, 33 received

ok maybe it did need some scripting


Hey that works great! Seeing how simple that scripting was I think it might be worth it for me to finally dig into this stuff. I have other indicator ideas I wanted to implement like cumulative volume for zig zags and volume profile broken up into multiple time periods.

You win the award for the coolest person I interacted with today!


Reply With Quote
The following user says Thank You to LittleFinger for this post:
 
  #4 (permalink)
Elite Member
Boston MA USA
 
Trading Experience: Beginner
Platform: None
Favorite Futures: ES, Stocks, ETFs
 
Posts: 63 since Jan 2015
Thanks: 43 given, 56 received


LittleFinger View Post
Hey that works great! Seeing how simple that scripting was I think it might be worth it for me to finally dig into this stuff. I have other indicator ideas I wanted to implement like cumulative volume for zig zags and volume profile broken up into multiple time periods.

You win the award for the coolest person I interacted with today!


Thanks! I accept this award, and I'd like to thank the Academy.

The learning curve for thinkscript is probably the easiest. The error messages that you get in the code editor can be cryptic sometimes, but the thinkscript online docs have gotten a lot better recently.

Maybe this would help with the volume studies you are working on.
It's from a well known ThinkScript blog.

https://readtheprospectus.wordpress.com/2010/02/15/cumulative-volume-by-time-indicator-for-think-or-swim/

The code is all listed somewhere here: https://sites.google.com/site/prospectus/welcome/released-thinkscript-studies

I believe there are ways within a script to access multiple time period data, if you use minute data only and are accessing higher timeframes.

Also, you may know, you can examine and copy thinkscript code from any of the built-in indicators, such as the code for Zig-Zag. Good luck!

Reply With Quote
The following user says Thank You to ocpb for this post:
 
  #5 (permalink)
Elite Member
Denver Colorado/USA
 
Trading Experience: Intermediate
Platform: Sierra Chart, ThinkorSwim
Favorite Futures: ES,ZN,6E,CL,GC
 
LittleFinger's Avatar
 
Posts: 50 since May 2017
Thanks: 33 given, 33 received

yes! that looks like about 3/4 of the puzzle for the zig zag thing. I'll definitely be perusing these. That RSI divergence indicator would be handy too.

Great stuff, thanks again

Reply With Quote
The following user says Thank You to LittleFinger for this post:

Reply



futures io > > > > 2 ATRs in one indicator. Having a problem




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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone having a whitescreen problem with Ninja/Zenfire update 7.14 or recent updates? dnkhoward2 NinjaTrader 11 July 8th, 2013 05:00 PM
volume indicator which one is the accurate one? timo77 NinjaTrader 2 February 16th, 2013 09:25 AM
having trouble restricting to one trade per session gonzofist EasyLanguage Programming 8 January 18th, 2013 11:16 AM
Does having some trading knowledge get in the way? shodson Psychology and Money Management 4 March 9th, 2010 03:27 PM
Having some issues with this code. Please help. kaywai NinjaTrader Programming 3 March 4th, 2010 10:33 AM


Tags
atr, average, code, data, divergence, dow, error, es, futures, indicator, indicators, minute data, modification, rsi, scaling, scripting, think or swim, thinkorswim, thinkscript, top, tos, volume, volume profile, zig-zag

All times are GMT -4. The time now is 04:05 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2019-05-17 in 0.22 seconds with 16 queries on phoenix