Page 1 of 1

Moving Trend (Rafter indicator)

Posted: 13 Jul 2009
by dlahyani
looking for someone who can help convert this code to MC from esignal efs code.
thanks in advance, Daniel

Code: Select all

*********************************
function preMain()
{
setStudyTitle("Movtrend");
setCursorLabelName("Movtrend", 0);
setDefaultBarFgColor(Color.blue, 0);
setPriceStudy(true);
}
function main(n) {
if(n == null)
n = 20;
var sum = 0;
var i = 0;
var mt = 0;

for(i = n; i > 0; i--)
sum += (i - (n + 1) / 3) * close(i - n);
wt = 6 / (n * (n + 1)) * sum
return wt;
}

Posted: 13 Jul 2009
by TJ
what does it do?
do you have a screen shot?

Posted: 13 Jul 2009
by dlahyani
Hi TJ,

check this description.

www.tssupport.com/support/base/?action=article&id=1803


Daniel


Image

Posted: 11 Aug 2009
by TJ
you can set the bands to invisible if you do not wish to see them.

Code: Select all

// Moving Trend Band (MTB)
// as described by William Rafter
//
// Author: TJ
// Date: 20090811
// http://www.tssupport.com/forum/viewtopic.php?p=28041#28041
//

input:
Length(20),
Upcol(blue),
Dncol(red);

var:
MovTrend(0),
sd(0),
upband(0),
lowband(0);

{---------- end of variables ----------}

MovTrend = LinearRegvalue( Close, length, 0 );

sd = StdDev(movtrend, length);
upband = MovTrend + sd;
lowband = MovTrend - sd;

Plot10( MovTrend, "MTB");

if movtrend > MovTrend[1] then
SetPlotColor[1](10, upcol)
else
SetPlotColor[1](10, dncol);

plot30(upband, "UpBand");
plot40(lowband, "LowBand");

{---------- end of MTB ----------}

more info here:
http://www.traderslaboratory.com/forums ... -6563.html


170.86

movtrend

Posted: 22 Oct 2009
by dlahyani
TJ,

thank you for the effort.

Best, Dan