# Moving Trend (Rafter indicator)

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
dlahyani
Posts: 24
Joined: 06 Feb 2007

### Moving Trend (Rafter indicator)

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;}`

TJ
Posts: 6638
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1919 times
what does it do?
do you have a screen shot?

dlahyani
Posts: 24
Joined: 06 Feb 2007
Hi TJ,

check this description.

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

Daniel

TJ
Posts: 6638
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1919 times
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] thenSetPlotColor[1](10, upcol)elseSetPlotColor[1](10, dncol);plot30(upband, "UpBand");plot40(lowband, "LowBand");{---------- end of MTB ----------} `

170.86
Last edited by TJ on 06 Dec 2009, edited 2 times in total.

dlahyani
Posts: 24
Joined: 06 Feb 2007

### movtrend

TJ,

thank you for the effort.

Best, Dan

Return to “User Contributed Studies and Indicator Library”