Help for chart based ATR price... - NinjaTrader Programming | futures io social day trading
futures io futures trading


Help for chart based ATR price...
Updated: Views / Replies:4,006 / 24
Created: by wldman Attachments:4

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
 4  
 
Thread Tools Search this Thread
 

Help for chart based ATR price...

  #11 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


wldman View Post
I am going to work on that a bit and study what you are telling me Fat Tails. The display does not have the same look so I'll review the math. The lines in your example ate 3 times and 2.618 times the 34 period average true range. That script I posted defines Keltner Channel?

Thanks for your help and suggestions. DB

Keltner Channels are built from a SMA and the average true range. Your channels are built from an EMA and the average true range. They are modified Keltner Channels, as Linda Raschke intorduced them. The multipliers of 2.62 and 3 are close together so on the chart the two upper bands will be as close as shown.

Reply With Quote
 
  #12 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

Tails..

I hate to be "that guy" about this but the Keltner calculation just doesnt look right to me. The display seems off a bit as well.

The Keltner calculation from the NT indie, If I am correct, is missing part of the ATR calculation.

This is from the ATR indicator in NT:

if (CurrentBar == 0)
Value.Set(High[
0] - Low[0]);
else
{
double trueRange = High[0] - Low[0];
trueRange = Math.Max(Math.Abs(Low[
0] - Close[1]), Math.Max(trueRange, Math.Abs(High[0] - Close[1])));
Value.Set(((Math.Min(CurrentBar +
1, Period) - 1 ) * Value[1] + trueRange) / Math.Min(CurrentBar + 1, Period));

So, that is what I'm looking for in the Keltner indie calc, right?

But this is what I find there in Keltner:

Described as...
the difference between the high and low of the previous bars

and in the code as...
diff.Set(High[0] - Low[0]);

So I must be missing something or the canned Keltner is not actually using the correct ATR calculation.

The other differences that you noted sma or ema seem to be minor relative to that calc difference. Unless I just don't see it.

The Keltner Channel in terms of display on NT contracts too much during low vola and perhaps expands too much during high vola...at least based on a first view. I conclude that I am missing something or the two Keltner Channel and what I was seeking help to code are not the same. I think Im back to square one or slightly advanced from it.

I am going to keep trying to get that code that I posted above converted into C# and displayed on NT7. I have another version of the code that produces the same result. Would it be helpful to post that as well? What am I missing?

Thanks for your help.

DB

Reply With Quote
 
  #13 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

BTW..


this has nothing to do with anyone named Linda Raschke. I have no idea who she is or how what I am doing is related to her. I realize that there is nothing new under the sun when it comes to math...an exact science. In that, we do not necessarily rely on the work of others, but we may from time to time , knowingly or unknowingly employ the same princilpes. When that occurs I get excited because when smart people are led to the same place independently of one another the destination tends to validte the thought process and the work.

Linda, does she bank cash? Should I know her or care to find out who she is.

My insecurity leads me to feel like you are trying to expose me or decloak me by saying that is Keltner or the work of someone named Linda that I'm trying to build on and claim as my own. I know that is not true that you have a nefarious purpose so I'm not posting to defend or attack, rather to express my frustration at my inability to code independently of help from guys like you that have that skill.

That little piece of code was the result of looking for a primary price target that would consider volatility and adjust in step with it to maximize first target. Data from different about price movement within different timeframes was exported to excell and then evaluated for specific outcome. It is somewhat interesting that the data set that produced the best result was all Fib related or "9" related...coincidence or some mystical metaphysical BS, honeybadger and wildman don't care none if it banks cash.

Thanks again for your help and direction on this. I hope that you will continue to push me along. DB

Reply With Quote
 
  #14 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received

Feel free to ignore me if I am just getting in the way......

I read the thread twice so far and I'm a bit confused.

I am guessing you are trying to replicate what you have on another platform and get it into NT7? If so is that the chart you are wanting to reproduce?

So those Bands, you want to replicate the green/purple MAs right?

And am I correct in saying that @Fat Tails is suggesting you can possibly use the Keltners as a possible way to get the desired output?

Just curious.

Reply With Quote
 
  #15 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


wldman View Post
I hate to be "that guy" about this but the Keltner calculation just doesnt look right to me. The display seems off a bit as well.

The Keltner calculation from the NT indie, If I am correct, is missing part of the ATR calculation.

This is from the ATR indicator in NT:

if (CurrentBar == 0)
Value.Set(High[
0] - Low[0]);
else
{
double trueRange = High[0] - Low[0];
trueRange = Math.Max(Math.Abs(Low[
0] - Close[1]), Math.Max(trueRange, Math.Abs(High[0] - Close[1])));
Value.Set(((Math.Min(CurrentBar +
1, Period) - 1 ) * Value[1] + trueRange) / Math.Min(CurrentBar + 1, Period));

So, that is what I'm looking for in the Keltner indie calc, right?

But this is what I find there in Keltner:

Described as...
the difference between the high and low of the previous bars

and in the code as...
diff.Set(High[0] - Low[0]);

So I must be missing something or the canned Keltner is not actually using the correct ATR calculation.

The other differences that you noted sma or ema seem to be minor relative to that calc difference. Unless I just don't see it.

The Keltner Channel in terms of display on NT contracts too much during low vola and perhaps expands too much during high vola...at least based on a first view. I conclude that I am missing something or the two Keltner Channel and what I was seeking help to code are not the same. I think Im back to square one or slightly advanced from it.

I am going to keep trying to get that code that I posted above converted into C# and displayed on NT7. I have another version of the code that produces the same result. Would it be helpful to post that as well? What am I missing?

Thanks for your help.

DB

You are right. The original Keltner Channels just use the range of the bars, not the true range. That is another reason that I used the Universal Keltner Channel

-> it allows you to select a different period for moving average and true range
-> it allows you to select the type of the average, that is EMA, SMA, etc.
-> it allows you to choose from the simple range and the true range

For the chart that I have posted the true range was used, as in the trade station formula.The chart shows bands at a distance of 2.618 and 3.0 ATRs.

The first screenshot which you have posted has nothing to do with the tradestation code, as it uses different settings. Your bands on the chart do not use offsets of 2.618 and 3.0, this can be easily seen without measuring anything.


Last edited by Fat Tails; September 8th, 2011 at 06:46 AM.
Reply With Quote
 
  #16 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

So we agree that ...

something does not look right.

Fat Tails, you are the one that suggested Keltner either universal or simple, not me. I went to look at that suggestion because I asked for help with programing the piece of code that I posted for use in NT7.

My display on the chart I posted is what I want to display on mt NT charts. I assure you it is generated by the code I posted and the settings are 3* and 4.23* the 34 period atr. So you are telling me that what I am asking for help with is not what Im asking for help with and that my display is wrong? How can that be?

What I would like to do is post two variable atr lines above the period ema and two variable atr's below the period ema as referenced in the code I posted.

Reply With Quote
 
  #17 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

Yes forrestang...


forrestang View Post
I read the thread twice so far and I'm a bit confused.

I am guessing you are trying to replicate what you have on another platform and get it into NT7? If so is that the chart you are wanting to reproduce?

So those Bands, you want to replicate the green/purple MAs right?

And am I correct in saying that @Fat Tails is suggesting you can possibly use the Keltners as a possible way to get the desired output?

Just curious.

that is correct. I'm trying to recover/import indicators for use in NT7. That is the first chart, yes. Chosen because it should be the easiest to replicate IMO.

Yes the green and purple are primary, the two outer gray are secondary. The colored lines are plotted as the 34 period xma + 3*travg where travg = xaverage(range,trlength)....just like it shows in the posted code. I'll post different code that generates the same view and another chart or two. This is the simple one I have no idea how to handle adaptive or cycle period adjusted cci or Heiken Ashi.

Reply With Quote
 
  #18 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

OK different code same result.

This version was done by a prolific guy both coding and trading. He created this one so that he could change the number of decimals and he prefered to round his number.

input:
price (c), length(36), deci(4),
4xu_color(gray), 4xd_color(gray),
3xu_color(fuchsia),3xd_color(lime),
4x_style(ps_solid),3x_style(ps_dot);

av=xaverage(price,length);
atr=xaverage(truerange(),length);

atr_ 423u=round((av+(atr*4.23)),deci);
atr_3u+round((av+(atr*3)),deci);

atr_ 423d=round((av-(atr*4.23)),deci);
atr_3d+round((av-(atr*3)),deci);

plot1=atr_423u; color1=4xu_color; style1=4x_style;
plot2=atr_3u; color2=3xu_color; style2=3x_style;
plot3=atr_3d; color3=3xd_color; style3=3x_style;
plot4=atr_423d; color4=4xd_color; style4=4x_style;

2011-07-01_1850 - wilddan's library

2011-06-17_1355 - wilddan's library

Thanks to anyone who might decide to help. DB

Reply With Quote
 
  #19 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


wldman View Post
something does not look right.

Fat Tails, you are the one that suggested Keltner either universal or simple, not me. I went to look at that suggestion because I asked for help with programing the piece of code that I posted for use in NT7.

My display on the chart I posted is what I want to display on mt NT charts. I assure you it is generated by the code I posted and the settings are 3* and 4.23* the 34 period atr. So you are telling me that what I am asking for help with is not what Im asking for help with and that my display is wrong? How can that be?

What I would like to do is post two variable atr lines above the period ema and two variable atr's below the period ema as referenced in the code I posted.

That is what I meant: On your charts the settings were 3.0 and 4.23. The TradeStation code showed 2.618 and 3.0.

You can just download the Universal Keltner Channel, as I suggested and it will exactly display those lines. Settings are
(EMA, EMA, 3.0, 34, 34, TrueRange, false) for the first one and (EMA, EMA, 4.23, 34, 34, TrueRange, false) for the seceond one. Set the opacity to 0 for better display.

If you like smoothing you can set "Smoothed Channels" to "true", this will get you smoother channels, see chart attached.

Attached Thumbnails
Help for chart based ATR price...-6e-09-11-60-min-08_09_2011.jpg  
Reply With Quote
 
  #20 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,069 since Aug 2011
Thanks: 967 given, 2,624 received

Fat...


that is not easy language, it is qscript. The Wave59 "language".

I don't want to come across the wrong way or sound disrespectful but I have to say that if I wanted Keltner Channel I would have used Keltner channel. The search for that which I am trynig to display in NT would have included Keltner, Hurst, Kirschenbaum, Bollinger and anything applied by Wilder or Ehlers. I will do what you have suggested and I appreciate the suggestions. In the mean time maybe someone that knows C# will view the thread and create the appropriate code.

The discussion here though does give me an idea to overlay this universal keltner or kirshenbaum and a modified bollinger on the same chart because they handle volatility differently. Say an upper band cross of an upperband consistent with some element of price action, like a close above or below some mid line might be the basis for something interesting.

I do not typically download indicators but I will search BMP for universal keltner. DB

Reply With Quote

Reply



futures io > > > > > Help for chart based ATR price...

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price By Volume Chart - PBV trendisyourfriend NinjaTrader 7 December 7th, 2012 03:50 PM
Chart-based trading behind big market swings kbit News and Current Events 1 August 10th, 2011 10:03 PM
Possible to prog indicator to display based on a diff timeframe than current chart? Curbfeeler The Elite Circle 3 April 5th, 2010 11:12 AM
Alarming a price on a chart Todd The Elite Circle 13 February 16th, 2010 09:57 AM
Buy Sell indicator based on traded volume, not price kronie The Elite Circle 6 November 21st, 2009 10:14 AM


All times are GMT -4. The time now is 09:56 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-12 in 0.22 seconds with 20 queries on phoenix via your IP 54.221.93.187