#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Home
Forex Forum
+ Add Script
Metastock
Expert Advisors
Explorations
Indicators
Trading Systems
Metatrader
MQL Experts
MQL Indicators
MQ4 Experts
MQ4 Indicators
MQ4 Scripts
Tradestation
Functions
Indicators
PaintBars
ShowMe
Trading Systems
Amibroker
Commentaries
Explorations
Functions
Indicators
Trading Systems
Contact us
Newsletter
Group: Metatrader MQL Indicators
Title: ATR Channel
Description:
ATR Channel - Average True Range Channel
/*[[ Name := Average True Range Channel Author := Damiani Link := Separate Window := No First Color := Yellow First Draw Type := Line Use Second Data := Yes Second Color := Yellow Second Draw Type := Line Second Symbol := 218 ]]*/ Inputs : PeriodsATR(18), MA_Periods(18), MA_type(MODE_EMA),Mult_Factor(2),Advance(0); Variables : shift(0),cc(0), chanW(0); Variables : bar(0), prevbars(0), start(0), cs(0), prevcs(0),commodt(0); SetLoopCount(0); cs= PeriodsATR+ MA_Periods+ MA_type+Mult_Factor+Advance; //checksum used to see if parameters have been changed if cs=prevcs and (commodt=symbol) then start=Bars-prevbars //params haven't changed only need to calculate new bar else start=-1; commodt=symbol; prevbars = Bars; prevcs = cs; if (start=1 | start=0) then bar=start else bar=bars-1; For shift = Bar Downto 0 Begin cc=ima(MA_Periods,MA_type,shift); chanW=iatr(PeriodsATR,shift); SetIndexValue(shift-Advance,cc+Mult_factor*chanW); SetIndexValue2(shift-Advance,cc-Mult_factor*chanW); // loopbegin = loopbegin-1; End;
Author/Source:
Damiani
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact