dave

TMA center channel bands

Category: Indicators By: dave Created: February 13, 2016, 2:33 PM
February 13, 2016, 2:33 PM
Indicators
5 Comments
TMA center channel bands

Here is another channel upper and lower bands indicator, this one is made of a centered Triangular Moving Average with classic deviation from this mean, made of plus and minus ATR multiplicated value. Quiet popular in the forex trading community, it is the base of many more or less sophisticated strategy, do your homework with this one, you’ll find it is valuable for different market phase.

 

// parameters
// HalfLength = 50
// AtrLength = 100
// AtrMultiplier = 2.0

avg = average[1](close)

sum = (HalfLength+1)*avg
sumw = (HalfLength+1)
k = HalfLength

for j = 1 to HalfLength do
  k = k-1
  sum = sum+(k*avg[j])
  sumw = sumw+k
next

buffer1 = sum/sumw

myrange = AverageTrueRange[AtrLength](close)*AtrMultiplier

buffer2 = buffer1+myrange
buffer3 = buffer1-myrange

RETURN buffer1 coloured(0,220,0) as "TMA", buffer2 coloured(220,0,0)  as "upper band", buffer3 coloured(0,220,0) as "lower band"

 

Download
Filename: TMA-center-channel.itf
Downloads: 499
dave
dave Junior
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

supertiti
4 years ago
#

// TMA CENTER Channel by Dave modifié // parameters // HalfLength = 50 // AtrLength = 100 // AtrMultiplier = 2.0 perso = 3.6 // AtrLength1 = 100 // AtrMultiplier1 = perso = 6.1 avg = average[1](close) sum = (HalfLength+1)*avg sumw = (HalfLength+1) k = HalfLength for j = 1 to HalfLength do k = k-1 sum = sum+(k*avg[j]) sumw = sumw+k next buffer1 = sum/sumw myrange = AverageTrueRange[AtrLength](close)*AtrMultiplier buffer2 = buffer1+myrange buffer3 = buffer1-myrange //////////////////////////////////////////////////////////// myrange1 = AverageTrueRange[AtrLength1](close)*AtrMultiplier1 buffer4 = buffer1+myrange1 buffer5 = buffer1-myrange1 //////////////////////////////////////////////////////////// RETURN buffer1 coloured(0,220,0) as "TMA", buffer2 coloured(220,0,0) as "upper band", buffer3 coloured(0,220,0) as "lower band",buffer4 coloured(220,0,0) as "upper band1", buffer5 coloured(0,220,0) as "lower band1"

Wolf
5 years ago
#

Just for information: This calculate code is interesting, but it is not a Triangular Moving Average, but A Weighted Moving Average. Nowadays with new version of PRT So, to reduce the calculate time. It is possible to cancel from line 6 to 16 and change line 18 by: Buffer1 = WeightedAverage[HalfLength](close) or Buffer1 = average[HalfLength,2](close) Thanks

Dron
4 years ago
#

Hola Lobo, soy nuevo en programación, pero me interesa ese indicador, en tu mensaje estas hablando en la modificación de código para adoptarlo a la nueva versión de prt, podrías colgar el código modificado competo please?

Chicane23
6 years ago
#

Hi! Can you explain the ATR length and ATR half length? Should one of these nbit be the number of periods linked to TMA?

Ermitage
10 years ago
#

Hello

please have you got the opportunity to modify code in order to obtain a centered simple moving avarage? thanks

ProRealCode ProRealCode
Loading...