Welcome to the Traders Laboratory Forums.
Technical Analysis The technical discussion forum for traders.

Reply
Old 12-06-2011, 04:31 PM   #1

Join Date: Nov 2011
Posts: 7
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Smoothing Color Change in MA Signal Line ?

Has anyone come across a good technique for smoothing the color defining transitions without disturbing the entry and exit points of blatant directional changes?

I am sure inevitably someone is going to come on here and say that further smoothing of an MA will lessen false signals but delay entry, and I don't disagree.

BUT due to the standard way of coding a color alternating signal line being an either or approach, minuet changes in the direction are approached as veritable True or False in nature. All of this ultimately allowing for what I personally refer to as micro chop or false signals.




I have had some success in limiting the issue by replacing the standard price input with (High + Low)/2 as opposed to Close, as well as changing the number of look back bars from 1 to 2.


Code:
{ Color criteria }
if (Value1 > Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, upColour)
else if (Value1 < Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, downColour);
I have contemplated using a percentage of variance or some form of a slope calculation to allow for a margin of error, but I just can't seem to wrap my head around which would be more effective and adaptive to various circumstances.

Any suggestions would be much appreciated.
Aston01 is offline  
Reply With Quote
Old 12-06-2011, 05:23 PM   #2

Tams's Avatar

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

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

Re: Smoothing Color Change in MA Signal Line ?

Quote:
Originally Posted by Aston01 »
Has anyone come across a good technique for smoothing the color defining transitions without disturbing the entry and exit points of blatant directional changes?

I am sure inevitably someone is going to come on here and say that further smoothing of an MA will lessen false signals but delay entry, and I don't disagree.

BUT due to the standard way of coding a color alternating signal line being an either or approach, minuet changes in the direction are approached as veritable True or False in nature. All of this ultimately allowing for what I personally refer to as micro chop or false signals.




I have had some success in limiting the issue by replacing the standard price input with (High + Low)/2 as opposed to Close, as well as changing the number of look back bars from 1 to 2.


Code:
{ Color criteria }
if (Value1 > Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, upColour)
else if (Value1 < Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, downColour);
I have contemplated using a percentage of variance or some form of a slope calculation to allow for a margin of error, but I just can't seem to wrap my head around which would be more effective and adaptive to various circumstances.

Any suggestions would be much appreciated.
there are hundreds of ways to smooth a MA...

eg.

use medianprice instead of close
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 12-08-2011, 11:56 AM   #3
zdo

Join Date: Nov 2007
Location: boonies
Posts: 1,349
Ignore this user

Thanks: 317
Thanked 355 Times in 256 Posts
Blog Entries: 104

Smoothing the color VS smoothing the central tendency

Aston,

Preface: For real life, though, you said it just right with
Quote:
I have contemplated using a percentage of variance or some form of a slope calculation to allow for a margin of error, but I just can't seem to wrap my head around which would be more effective and adaptive to various circumstances.
The simplest, non-adaptive start I can give you
[pseudocode]
Code:
inputs:
…
nSdevLen(200),
…
nBrktMlt1(.6),   { manually tweak this input and your value1’s length parameter to get goldilock’s settings }
…

// also add a flatColor(neutralcolor) input...		
;

vars:
…
degree(0),
sdev(0),
colorThreshold(0),
 …
;

//////////////////
{Color criteria}
degree = absvalue(arctangent(nlAvg- nlAvg[1]));
sdev = stddev(degree, sdevLen);
colorThreshold = sdev * nBrktMlt1;

{ 
notes: 
> [2] changed to [1] throughout this example - why wait? ;) .  
> nlAvg equivalent to your Value1…
}


if (degree <=  colorThreshold)  then begin
  SetPlotColor(1, flatColor);

end else begin
 if (nlAvg > nlAvg [1]) then     
   SetPlotColor(1, upColor)

 else
  SetPlotColor(1, dnColor;

end;   // if (degree >  colorThreshold)
///


This concept could also be modified to keep the dnColour during your red circle (because angles haven’t changed sufficiently to up )

You could also get more fuzzy using GradientColor reserved word, etc. hth
zdo is offline  
Reply With Quote
Old 12-08-2011, 08:23 PM   #4

Join Date: Oct 2011
Location: Manila
Posts: 12
Ignore this user

Thanks: 3
Thanked 0 Times in 0 Posts

Re: Smoothing Color Change in MA Signal Line ?

Quote:
Originally Posted by Aston01 »
Has anyone come across a good technique for smoothing the color defining transitions without disturbing the entry and exit points of blatant directional changes?

I am sure inevitably someone is going to come on here and say that further smoothing of an MA will lessen false signals but delay entry, and I don't disagree.

BUT due to the standard way of coding a color alternating signal line being an either or approach, minuet changes in the direction are approached as veritable True or False in nature. All of this ultimately allowing for what I personally refer to as micro chop or false signals.




I have had some success in limiting the issue by replacing the standard price input with (High + Low)/2 as opposed to Close, as well as changing the number of look back bars from 1 to 2.


Code:
{ Color criteria }
if (Value1 > Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, upColour)
else if (Value1 < Value1[2]) then 
	SetPlotColor[colourDeltaBar](1, downColour);
I have contemplated using a percentage of variance or some form of a slope calculation to allow for a margin of error, but I just can't seem to wrap my head around which would be more effective and adaptive to various circumstances.

Any suggestions would be much appreciated.
Hi Aston,

I have been using a heat-map approach to determining support and resistance for my grid trading application. This technique could be adapted to MAs, Please see my last blog post here and then PM me if you are interested in pursuing.

Best

John
JohnTaylorHK is offline  
Reply With Quote
Old 12-08-2011, 10:50 PM   #5

Join Date: Nov 2011
Posts: 7
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Smoothing Color Change in MA Signal Line ?

Tams - I gave median a whirl and it seemed make an improvement in the smoothing without much lag...Thanks for the idea

John - Interesting idea ..I'll have to do some more reading on it
Aston01 is offline  
Reply With Quote
Old 12-17-2011, 11:55 AM   #6

Join Date: Jul 2009
Location: Orlando
Posts: 39
Ignore this user

Thanks: 17
Thanked 11 Times in 11 Posts

Re: Smoothing Color Change in MA Signal Line ?

Use the juric formula to smooth your MA where jthma is the juric function ie;

NewMA=jthma(yourMA,3);

to get it super smooth run it through the formula one more time.

NewMA1=jthma(NewMA,3);
estate1997 is offline  
Reply With Quote
The Following User Says Thank You to estate1997 For This Useful Post:
JohnTaylorHK (12-18-2011)

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
Holt Winter's Double Exponential Smoothing. r4bb1t Trading Indicators 7 09-11-2011 12:23 PM
Does Anyone Know How to Get Indicator ADX W/ Smoothing Please? whirl Technical Analysis 3 08-19-2010 02:26 PM
Smoothing out price feb2865 Technical Analysis 34 08-07-2010 09:21 PM
Set Background Color aaa Coding Forum 2 05-29-2010 09:56 AM
[Smoothing Out The TRIN & TRINQ] Soultrader Trading Videos 2 04-22-2007 03:33 PM

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