Welcome to the Traders Laboratory.

Coding Forum Collaborate, receive help, or discuss indicators and other coding-related topics

Reply
Old 03-26-2008, 10:51 AM   #1
J-S

Join Date: Mar 2008
Posts: 8
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Trend Indicator for TS?

Hi! First time poster here. I'm looking for something for tradestation in which I can define a trend and have it tell me when one is in place. For example, let's say 4 full points in the ES (16 ticks) WITHOUT a 6-tick retracement. Does anything like that exist? Thanks.
J-S is offline  
Reply With Quote
Old 03-26-2008, 11:11 AM   #2

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 509
Ignore this user

Thanks: 164
Thanked 327 Times in 109 Posts

Re: Trend Indicator for TS?

Hi J-S

Could you post some pics of what you're referring to. ( a picture can speak a thousand words )

Cheers

Blu-Ray
__________________

Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 03-26-2008, 11:57 AM   #3
J-S

Join Date: Mar 2008
Posts: 8
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Trend Indicator for TS?

Hi Blu-Ray,

Agreed, but I don't really know what to take a picture of here. Really, any strong trend would do it. You know, just a trend not really broken up by any substantial retracements.
J-S is offline  
Reply With Quote
Old 03-26-2008, 12:08 PM   #4

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 509
Ignore this user

Thanks: 164
Thanked 327 Times in 109 Posts

Re: Trend Indicator for TS?

J-S

I think the main question would be what criteria you are after to define an uptrend, eg higher highs and higher lows, higher highs only, or consecutive higher closes etc........ if so how many bars..........

This would need to be worked out for it to be put into a TS code and that was the reason I was asking for a couple of pics to see what you mean.

Hope this helps

Blu-Ray
__________________

Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 03-26-2008, 12:21 PM   #5
J-S

Join Date: Mar 2008
Posts: 8
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Trend Indicator for TS?

Ah, okay. Well, how about this. Simply the distance between the lowest low of a trend (uptrend, obviously) to the highest high. That is, let's say the ES goes from a low point of 1400.00 to a high point of 1404.00 WITHOUT ever retracing 6 ticks (say, from 1403.00 down to 1401.50, and then back up again to 1404.00). Does that help? Thanks again.
J-S is offline  
Reply With Quote
Old 03-26-2008, 01:04 PM   #6

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 509
Ignore this user

Thanks: 164
Thanked 327 Times in 109 Posts

Re: Trend Indicator for TS?

Quote:
Originally Posted by J-S »
Ah, okay. Well, how about this. Simply the distance between the lowest low of a trend (uptrend, obviously) to the highest high. That is, let's say the ES goes from a low point of 1400.00 to a high point of 1404.00 WITHOUT ever retracing 6 ticks (say, from 1403.00 down to 1401.50, and then back up again to 1404.00). Does that help? Thanks again.
Apologies in advance, but how are you defining an uptrend ?

I'll have a look into after hours, but if you can post a pic it would really help.

In the meantime if anyone else comes forward............

Cheers

Blu-Ray
__________________

Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 03-26-2008, 01:27 PM   #7
J-S

Join Date: Mar 2008
Posts: 8
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Trend Indicator for TS?

Hi. Well, I define an uptrend, for the sake of this conversation anyway (and what I'm looking for from a code), just as I described it in that last post. I just used the word uptrend to distinguish it from the opposite -- obviously a downtrend. For that, everything would simply be the opposite -- from 1404 down to 1400. Thanks.
J-S is offline  
Reply With Quote
Old 03-26-2008, 02:32 PM   #8

Join Date: Feb 2007
Location: US
Posts: 312
Ignore this user

Thanks: 86
Thanked 212 Times in 89 Posts

Re: Trend Indicator for TS?

Here are some trend threads on TS to get a better idea of how to define a trend : https://www.tradestation.com/Discuss...Topic_ID=30732
https://www.tradestation.com/discuss...topic_id=30775

A lot of smarter traders than you and I have tried to define it and in the above threads you have mmillar, Bamboo, ghkramer, waynechem and others trying to do so. There is really no need to start your own new definition of trend when the market is full of traders following each other in these definitions.

If you want a short summary, here it is:
1. about half the market is looking at a moving average trend
2. the other half may be looking at some trend lines (or zigzags, similar idea).
3. the calculation of trends can be made more precise by using the average true range function (ATR). The market often trades with an ATR stop. In practice, a trend would often stall or ends once the ATR trailing stop is hit.

If you like the idea of following a moving average trend, the following waynechem indicator based on calculating the area under the trending moving averages may be a start:
Code:
{ TrendArea Indicator  WAV 9/15/04 } 
 
inputs: ThresholdArea(1500); 
 
vars: BarCount(0),SlowMA(0),FastMA(0), 
	color(0),area(0); 
 
SlowMA = average(close,15); 
FastMA = average(close,5); 
 
{ see if we have a new possible trend starting } 
if FastMA crosses above SlowMA or 
   FastMA crosses below SlowMA then 
begin 
   BarCount = 0; 
   area = 0; 
end; 
 
{ increment BarCount +1 if FastMA above SlowMA... 
  decrement BarCount -1 if FastMA below SlowMA} 
BarCount = IFF(FastMA > SlowMA,BarCount + 1,BarCount); 
BarCount = IFF(FastMA < SlowMA,BarCount - 1,BarCount); 
 
{ multiply each individual area by its barcount } 
area = area +  AbsValue(BarCount) * (FastMA - SlowMA); 
 
color = IFF(BarCount > 0,green,cyan); 
color = IFF(BarCount < 0,red,color); 
 
plot1(area,"Area",color); 
plot2(0,"zero line"); 
plot3(ThresholdArea,"+Thresh"); 
plot4(-ThresholdArea,"-Thresh");
thrunner is offline  
Reply With Quote

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
Heikin Ashi Trend Indicator Soultrader Trading Indicators 38 05-26-2013 08:16 AM
Trend lines on an indicator zardoz Technical Analysis 6 04-21-2009 12:37 PM
Objective ways to define a trend day before the trend has run its course?? Adamned Technical Analysis 7 01-29-2008 09:06 AM
REQ Help with Trend Indicator jjthetrader Coding Forum 55 12-14-2007 05:33 PM
Volume Gradient + Heikin Ashii Trend Indicator GCB Trading Indicators 27 04-07-2007 08:29 AM

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