Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Like Tree1Likes
  • 1 Post By MightyMouse

Reply
Old 01-05-2012, 12:20 AM   #1

Join Date: Jul 2011
Posts: 12
Ignore this user

Thanks: 6
Thanked 3 Times in 3 Posts

Methods for Identifying Trends

I'm sure there are many ways that one can identify a trend in code. For example, one way I found as I'm reading the first few chapters of Peter Kaufman's "New Trading System and Methods" is called body momentum. It determines whether black or white bodies have been dominating recent price movement (using only the bodies of the candles themselves):

Body Momentum = number of upBodies / (number of upBodies + number of downBodies)

He recommends using 14 as the number of look back bars.

if body momentum > .70 ->>> it's an up trend
if body momentum < .20 ->>> it's a down trend


This is just one method. I'm interested in other methods/logic/formulas you guys use to identify a trend in code. I guess my goal in this thread is the find the most reliable method for this.

Thank you!
parliament718 is offline  
Reply With Quote
Old 01-11-2012, 03:19 AM   #2

Join Date: Sep 2011
Location: STAMFORD
Posts: 169
Ignore this user

Thanks: 9
Thanked 10 Times in 10 Posts

Re: Methods for Identifying Trends

I did little search about methods for identifying trends and found a good site.

Source: Trend Identification & Trading

There is some methods listed.
henryduncan12 is offline  
Reply With Quote
Old 01-11-2012, 05:07 AM   #3

MightyMouse's Avatar

Join Date: Jan 2008
Location: The Lumber Yard
Posts: 1,271
Ignore this user

Thanks: 59
Thanked 394 Times in 286 Posts

Re: Methods for Identifying Trends

Look at a weekly chart that has at least 150 bars. If it is sloped upward, then it is an uptrend. If it is sloped downward, then it's a down trend. A slope of zero means there is no trend.

Then look at a daily chart with at least 150 bars, if it is sloped upward, it is an uptrend. If it is sloped downward, it is a downtrend. A slope of zero means there is no trend.

If catching a trend, never trade against the weekly trend. When you enter a trade, there is no good reason to assume that the trend is going to cease in its current direction when you enter. If there is no trend in the weekly, then take trend trades long or short on the daily and expect there to be support or resistance at the bottom and top of the weekly range or bracket.


Trend detection is far simpler if done visually. A child can do it.

I call anything below daily time frame an up move or a down move.
TheNegotiator likes this.
MightyMouse is online now  
Reply With Quote
Old 01-11-2012, 08:20 AM   #4

Join Date: Jan 2012
Posts: 3
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Re: Methods for Identifying Trends

Primary method of identifying trend is difference between serial of peaks i.e high and serial of troughs i.e low for taken periods, Period may be upto the trader decision. usually we have take on full period i.e day , week , month ... but weekly and monthly trend analysis will help us trade everyday.
mathematically there is three way analysis.
peaks and troughs in lowering form that is trend goes down - bear
peaks and troughs goes in higher form, that is trend goes up - bull
peaks and troughs are not in uniform that means market is indecision - side way-naroow range
rbwaran is offline  
Reply With Quote
Old 01-12-2012, 11:49 AM   #5

TheNegotiator's Avatar

Status: Super Moderator
Join Date: Mar 2009
Location: London
Posts: 2,279
Ignore this user

Thanks: 207
Thanked 552 Times in 434 Posts

Re: Methods for Identifying Trends

Without meaning to sound facetious, eyes. Like MM said, a good trend is easy to spot. So whatever method you employ in code, it shouldn't be picking up on 'trends' which aren't readily visible to your eye. So I'd look towards bands and even the humble trendline with some sort of volatility slack built into it.
__________________
Cheers,

TheNegotiator.

Day Trading the E-mini Futures
- Discussing and trading the E-minis every day!


Bigger Picture in E-minis Discussion
- Tryin' to see the wood for the trees
TheNegotiator is offline  
Reply With Quote
Old 01-18-2012, 06:49 AM   #6

jswanson's Avatar

Join Date: Sep 2011
Location: Gurnee
Posts: 53
Ignore this user

Thanks: 22
Thanked 75 Times in 25 Posts

Re: Methods for Identifying Trends

Both Frank Hassler and David Varadi create the TSI (Trend Strength Indicator). The TSI, as the name implies, measures the strength of a trend.

In general, a higher TSI value means greater likelihood of continued trending behavior in the short term. On the other hand, a lower TSI indicates a greater possibility of mean reversion type behavior. Frank has used a TSI value of 1.65 or larger as the threshold for trending stocks.

The formula for TSI is:
TSI = Average( Average(Ratio,10), 100 )
Where:
Ratio = Abs( Today’s Close – Close 10 Days Ago ) / 10-Day Average True Range
Code:
{== START OF HEADER ==========================================================================

Program:  TSI Function
Date:     October 2011
Platform: EasyLanguage v9.0

DESCRIPTION:

Ths function compute the Trend Strength (TSI) based upon a given Short lookback period
and a long lookback period. A TSI score above 1.60 is often considered a strong trend.

For more information see: http://www.systemtradersuccess.com

== END OF HEADER =============================================================================

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright © 2009. Capital Evolution, LLC. All Rights Reserved.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

== DEFINE ALL INPUTS AND VARIABLES ==========================================================}

Input:
ShortLookback( NumericSimple  ),
LongLookback( NumericSimple  );
   
Variables: 
Ratio(0);

Ratio = AbsValue((close - close[ShortLookback])) / AvgTrueRange( ShortLookback );
TSI = Average(Average(Ratio,ShortLookback),LongLookback);

{== END OF MAIN PROGRAM =====================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright © 2009-2011. Capital Evolution, LLC. All Rights Reserved.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
jswanson is offline  
Reply With Quote
The Following User Says Thank You to jswanson For This Useful Post:
parliament718 (03-28-2012)
Old 01-18-2012, 08:42 AM   #7

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,777
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Methods for Identifying Trends

an UPTREND is when the price is higher than your entry price,

a DOWNTREND is when the price is lower than your entry price.

All the other complicated theories and magical projections and esoteric calculations are moot.
Nobody can argue that.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
jswanson (01-18-2012)
Old 01-18-2012, 04:06 PM   #8

Join Date: Jan 2012
Posts: 361
Ignore this user

Thanks: 51
Thanked 71 Times in 55 Posts

Re: Methods for Identifying Trends

Quote:
Originally Posted by parliament718 »
Body Momentum = number of upBodies / (number of upBodies + number of downBodies)

He recommends using 14 as the number of look back bars.

if body momentum > .70 ->>> it's an up trend
if body momentum < .20 ->>> it's a down trend
Here are three suggestions that I hope will be useful:

1) You might find it useful to take a look at the formula for Larry William's 'Greatest Swing Value' indicator. This is based upon a very similar concept to the Kaufmann one you discuss, though interestingly Williams recommends a very short lookback setting of just three or four periods.

2) Another thing to investigate would be 'Heikin-Ashi' candlesticks. One of the main advantages of these are that they don't contain an variable look-back parameter, so the possibility of curve fitting or over optimisation is removed - handy! A variant of the Heikin-Ashi formula was popularised by the Trade the Markets bunch - it's basically intended to produce a 'less choppy' signal series. Like all such things, it's swings and roundabouts: sometimes it filters false signals, and sometimes it gives delayed signals for true trend changes. I haven't made any direct performance comparisson between traditional Heikin-Ashi and this modified version, so I can't make any authoritative statement about which is the better tool.

3) As I'm sure you've heard many times elsewhere, in trading 'simple' is normally 'best'. The best definition of trend you're likely to achieve is with a (correctly) optimised Simple Moving Average.

Hope that's useful - has anyone else got any other suggestions on this?
BlueHorseshoe is offline  
Reply With Quote
The Following User Says Thank You to BlueHorseshoe For This Useful Post:
parliament718 (03-28-2012)

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
5 Methods for Identifying and Entering the Trend TimRacette Trading 3 10-10-2011 11:25 AM
Recognizing Trends agiletrader2000 Beginners Forum 4 02-09-2010 03:32 PM
Identifying Weakness and Strength Soultrader Trading and the Markets 3 07-24-2008 01:43 AM
Technical Analysis of Stock Trends, 8th Edition torero Books 1 01-29-2008 07:07 PM
[Trends, Balance Areas, and Stop Placements] Soultrader Trading Videos 21 04-11-2007 08:25 PM

All times are GMT -4. The time now is 05:28 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.