Divergence detection algorithm - NinjaTrader Programming | futures io social day trading
futures io futures trading


Divergence detection algorithm
Updated: Views / Replies:14,194 / 24
Created: by cunparis Attachments:9

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

Divergence detection algorithm

  #1 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,030 received

Divergence detection algorithm

I've been trying to code a divergence detection but it's really hard. I'm curious if anyone has already tried to do it.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

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


There are two indicators available in the NinjaTrader Forum, which you will find below

- D3Spotter
- DivergenceSpotter

For me the problem would not be coding any such indicator, but what to do with it.

Divergence basically is a sort of first derivative, so it indicates a slowdown of price, when a new high or low is made. The danger with following divergences is that it lures you into early countertrades with a rather bad return-to-risk ratio. A triple divergence is a failed divergence, and this occurs frequently. Actually any trending move that leads into a longer congestion will produce a divergence, and usually congestions that follow trending moves are continuation patterns.

A three-push pattern usually produces a triple divergence, if it is a wedge. If the last high or low overshoots the opposite trendline to stop at one of the fibonacci ratios, you might take that trade without a prior trendline break.

Otherwise, I only use a signal that creates a divergence within a divergence, that means a smaller timeframe divergence within a larger timeframe divergence, if a clear trendline break in the larger timeframe has already occured.

Attached Files
Register to download File Type: zip DivergenceSpotter.zip (28.4 KB, 309 views)
Register to download File Type: zip D3Spotter.zip (18.0 KB, 228 views)

Last edited by Fat Tails; April 28th, 2010 at 05:40 PM. Reason: missing word added
Reply With Quote
The following 8 users say Thank You to Fat Tails for this post:
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,231 received


cunparis View Post
I've been trying to code a divergence detection but it's really hard. I'm curious if anyone has already tried to do it.

You'll need to be more specific.

It can be as simple as:

 
Code
                            


myema 
XAverage(C20);
mycci CCI(14);

if 
myema myema[1] and mycci mycci[1then divergence true
etc. Then just draw the trendline, init it first then track the ID, and then extend it each bar the divergence continues. TL_New_self for tl's in panel 2, or if you want it on price panel just use TL_New.

It will all depend on what you call divergence.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #5 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,030 received


Big Mike View Post
It will all depend on what you call divergence.

YOu're right, I should have been more specific.

I'm looking for one data series to make a HH and another to make a LH. I'd like the HH to be relatively close to the previous H, meaning the HH must be a consecutive peak. I don't want them to have smaller highs in between because that gets really complicated.

I started approaching it just from a pattern perspective. 3 bar pattern, 4 bars, 5 bars but it gets complicated cause there are different possibilities when you get to 5 for the bars in between.

I'm wondering if I should continue that or if there is a better way.

I don't really like the moving average approach, I want the divergence on the raw data and since it can be 3 bars I can't have any lag.

Reply With Quote
 
  #6 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,030 received


Fat Tails View Post
For me the problem would not be coding any such indicator, but what to with it.

Divergence basically is a sort of first derivative, so it indicates a slowdown of price, when a new high or low is made. The danger with following divergences is that it lures you into early countertrades with a rather bad return-to-risk ratio.

Who said anything about price???

I agree entering based on a divergence is not a good idea. For me it's just another piece of the puzzle. Gives me a warm fuzzy.

I'll look at those indicators. now I feel stupid cause I searched the forum discussions but I didn't think of searching the file downloads. it'd be nice if the forum search did both.

Thanks

Reply With Quote
 
  #7 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,231 received


cunparis View Post
I don't really like the moving average approach, I want the divergence on the raw data and since it can be 3 bars I can't have any lag.

Good luck

I would suggest using Alexander ZigZag or similar, but there is always lag in detection of the formation of the new zigzag.

If you are looking for a breakout or breakdown of a prior HH or LL, you'll first have to have a working method for identifying those HH and LL's (ZigZag for instance, or your own).

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #8 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,316 received
Forum Reputation: Legendary

also take a look at ninja candle finder indicator they use a strength value to filter out some weak divergence (weak trend).

ps. if you are in looking for some new idea here is one;

This review is for: Value in Time: Better Trading through Effective Volume (Wiley Trading) (Hardcover)

The author uses inexpensive off-the-shelf software to slice each trading day of a stock into one-minute segments. He finds the average one-minute volume for the day and separates the minutes into those with above or below average volume. In each group, he adds up the volume of minutes with rising prices and subtracts the volume of minutes with falling prices. This gives him two cumulative volume lines: one for the minutes with above average and the other for below average volume. He named them Large and Small Effective Volume.

The minutes with above average volume reflect the impact of the big money and often have predictive value. When you find a condition in which the big money starts pushing up a stock, while the small money remains negative or neutral, an upside reversal is in the cards. When the big money starts pushing the stock down while the small money is flat or buying, a downside reversal is more likely.

Reply With Quote
The following 5 users say Thank You to cory for this post:
 
  #9 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hi cunparis,
i also looked for a good diver-indie some weeks ago.

i found interesting + good working ones for MT4 but havent translated them - thats far below of my skills.
but what they show looks like a clear + sensemaking definition + calculation.

let me know if you are interested that i post / send you / the MT4 scripts to have a look at it.

-

max-td
Reply With Quote
 
  #10 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,030 received



max-td View Post
hi cunparis,
i also looked for a good diver-indie some weeks ago.

i found interesting + good working ones for MT4 but havent translated them - thats far below of my skills.
but what they show looks like a clear + sensemaking definition + calculation.

let me know if you are interested that i post / send you / the MT4 scripts to have a look at it.

-

I haven't seen MT4's code so i don't know what it looks like but if you have a few examples of the indicator on a chart that would help to see how it works and then I could look at the code to see if I can translate it to easylanguage or C#.

Reply With Quote

Reply



futures io > > > > > Divergence detection algorithm

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
Is this Bullish Divergence? prisonbreaker82 Traders Hideout 4 February 10th, 2011 03:02 PM
Range Market Detection sysot1t Traders Hideout 2 October 10th, 2010 07:05 AM
Trading Divergence shodson Traders Hideout 17 May 5th, 2010 09:42 PM
volume divergence Jeff Castille NinjaTrader Programming 4 January 10th, 2010 03:49 AM
Divergence sefstrat The Elite Circle 6 September 21st, 2009 09:37 PM


All times are GMT -4. The time now is 06:19 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.15 seconds with 20 queries on phoenix via your IP 54.160.245.121