REQ Help with Trend Indicator - Page 2 - Traders Laboratory
Forum Guidelines | Contact Us
Home

Go Back   Traders Laboratory > Trading Resources > Trading Indicators > Coding Forum

Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
 
LinkBack (3) Thread Tools Display Modes
  #11 (permalink)  
Old 11-24-2007, 01:36 PM
jjthetrader's Avatar
jjthetrader is trading

 
Join Date: Aug 2007
Location: Canada
Posts: 345
Thanks: 125
Thanked 72 Times in 44 Posts
This member is the original thread starter. Re: REQ Help with Trend Indicator

I only found my basic 'diamond indicator' but I will explain to you what you need to do in order to complete it.

Here's it's basic background. TGuider uses a 5 period MA as it's default. You can change this for quicker responses in immediate trend changes.

Logic:
If Price closes below the MA a red dot will paint in TSation.
If Price closes above the MA a green dot will paint.

That's the basis of it. But there is a little twist that gives you the warning of a possible trend change and that is the white diamond.
Here's how the white diamond works. You'll have to code this part in but not to worry it's very simple.

If you're in a downtrend, closing below the MA then all of a sudden you get a close above the MA, that would paint you a white diamond. If price then reversed and closed below the MA on the following bar, this would also be a white diamond.

In order for either the red or green dot to paint, it will need to be the second close on that side of the MA since the first will be white.

Are you following? Good.

It's as simple as that. Here's the basic code for just red and green dots. You'll have to put in the extra conditions for the white (possible change in trend coming) dots.

inputs: Price( Close ), Length( 4 ), Displace( 0 ) ;
variables: Avg( 0 ) ;

Avg = AverageFC( Price, Length ) ;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin

If Close < Avg then
begin
Plot1( Avg , "Avg", Red );
end
else
begin
Plot1 (Avg , "Avg", Green);
end;





{ Alert criteria }
if Displace <= 0 then
begin
if Price crosses over Avg then
Alert( "Price crossing over average" )
else if Price crosses under Avg then
Alert( "Price crossing under average" ) ;
end ;
end ;

Good Luck!

Reply With Quote
  #12 (permalink)  
Old 11-25-2007, 08:51 PM
deeznutzca has no status.

 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: REQ Help with Trend Indicator

Thanks for sharing!

Reply With Quote
  #13 (permalink)  
Old 11-26-2007, 05:46 AM
Blu-Ray's Avatar
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 427
Thanks: 105
Thanked 54 Times in 35 Posts
Re: REQ Help with Trend Indicator

Thanks JJ


I've coded it up to include the white crosses as well into the attached ELD.

Cheers

Blu-Ray
Attached Files
File Type: eld DIAMOND_TREND.ELD (3.6 KB, 55 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #14 (permalink)  
Old 11-26-2007, 08:46 AM
jjthetrader's Avatar
jjthetrader is trading

 
Join Date: Aug 2007
Location: Canada
Posts: 345
Thanks: 125
Thanked 72 Times in 44 Posts
This member is the original thread starter. Re: REQ Help with Trend Indicator

Blu-Ray, that's awesome! Thanks for coding it up for everyone.
Crosses are what I preferred as well.

TGuider also has an intermediary trending system. It's based on volatility bands. If you close above the bands your bars turn green, below the bands they turn red. You match this sytem up with your diamonds and you've got a clear trend direction. I haven't spent a lot of time trying to reproduce them because I do most of my trading now with TGuider and less with TrdeStation.


Last edited by jjthetrader; 11-26-2007 at 09:03 AM.
Reply With Quote
  #15 (permalink)  
Old 11-26-2007, 09:49 AM
MC's Avatar
MC MC is offline
MC is half man, half market!

Trader Specs
 
Join Date: Sep 2007
Location: NY
Posts: 540
Thanks: 170
Thanked 47 Times in 36 Posts
Send a message via AIM to MC
Re: REQ Help with Trend Indicator

Quote:
View Post
Thanks JJ


I've coded it up to include the white crosses as well into the attached ELD.

Cheers

Blu-Ray

Thanks a ton.

__________________
Price is simply the 2 way auctions method of advertisement. Volume measures the willingness of market participants to transact at the advertised price (AKA perceived value).
Reply With Quote
  #16 (permalink)  
Old 11-27-2007, 04:33 PM
val2004 has no status.

 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: REQ Help with Trend Indicator

hi
Is it possible to have the code in txt format for ts2000i

Thanks a lot

Reply With Quote
  #17 (permalink)  
Old 11-27-2007, 05:49 PM
Blu-Ray's Avatar
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 427
Thanks: 105
Thanked 54 Times in 35 Posts
Re: REQ Help with Trend Indicator

Quote:
View Post
hi
Is it possible to have the code in txt format for ts2000i

Thanks a lot

Here you go:


inputs: Price( Close ), Length( 5 ),Upcolor( DarkGreen),DnColor ( DarkRed),NColor(White) ; variables: Avg( 0 ) ; Avg = AverageFC( Price, Length ) ; Condition1 = close[1] > avg[1] and close > avg; Condition2 = close[1] < avg[1] and close < avg; plot1(avg,"avg"); if close crosses above avg then setplotcolor(1,NColor); if condition1 then setplotcolor (1,upcolor); if close crosses below avg then setplotcolor(1,NColor); if condition2 then setplotcolor (1,dncolor);
Hope this helps

Blu-Ray

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #18 (permalink)  
Old 11-28-2007, 05:36 AM
val2004 has no status.

 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: REQ Help with Trend Indicator

thanks a lot Blue ray .

Reply With Quote
  #19 (permalink)  
Old 11-29-2007, 07:00 PM
BlowFish's Avatar
BlowFish is in da house

Trader Specs
 
Join Date: Mar 2007
Location: Europe Mostly
Posts: 916
Thanks: 24
Thanked 133 Times in 94 Posts
Re: REQ Help with Trend Indicator

I Think there's more to it than that. Just after 9.30 there are 2 white despite 2 closes below. 11.30 & 12.15 you get red to green and green to red with no white. Have I missed something?

Cheers.

Reply With Quote
  #20 (permalink)  
Old 11-29-2007, 07:05 PM
BlowFish's Avatar
BlowFish is in da house

Trader Specs
 
Join Date: Mar 2007
Location: Europe Mostly
Posts: 916
Thanks: 24
Thanked 133 Times in 94 Posts
Re: REQ Help with Trend Indicator

AHh I think I see what's missing!

If the MA goes from down to up then it goes red to green immediately. If it is still down but close is above then it will go white.

Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.traderslaboratory.com/forums/f56/req-help-with-trend-indicator-2428.html
Posted By For Type Date
REQ Help with Trend Indicator - Page 3 - Traders Laboratory This thread Refback 12-12-2007 11:08 AM
Traders Laboratory - forumdisplay This thread Refback 11-27-2007 12:50 PM
Traders Laboratory - forumdisplay This thread Refback 09-10-2007 03:20 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heikin Ashi Trend Indicator Soultrader Trading Indicators 25 02-21-2008 06:24 PM
3bar trend waveslider Trading Indicators 18 01-29-2008 06:39 PM
Trend lines on an indicator zardoz Technical Analysis 1 05-16-2007 12:59 PM
Volume Gradient + Heikin Ashii Trend Indicator GCB Trading Indicators 27 04-07-2007 08:29 AM
Trend Trading vs Counter Trend Trading Soultrader Technical Analysis 9 10-29-2006 11:32 AM


All times are GMT -4. The time now is 05:09 PM.

 

 
 


1 2 3 4 5 6 7 8 9 10 11 12 13 14