#
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: T3 ROC with Price
Description:
T3 ROC with Price. Good pairing with Cool2, set for eurusd, 5,5,1 for gbpusd 8,8,1.5 and adjust for other pairs
/*[[ Name := t3 ROC with Price Author := Alejandro Galindo (original version from SPECULATOR) Notes := modified with t3 by mikesbon Separate Window := no First Color := Turquoise First Draw Type := Line First Symbol := 217 Use Second Data := no ]]*/ input: vPeriod(5),t3_period(5),b(1); var: t3(0); var: e1(0),e2(0),e3(0),e4(0),e5(0),e6(0),c1(0),c2(0),c3(0),c4(0); var: n(0),w1(0),w2(0),b2(0),b3(0); var: shift(0),loopbegin(0),ROC(0); var: first(True),prevbars(0); var: cnt(0); b2=b*b; b3=b2*b; c1=-b3; c2=(3*(b2+b3)); c3=-3*(2*b2+b+b3); c4=(1+3*b+b3+3*b2); n=t3_period; if n<1 then n=1; n = 1 + 0.5*(n-1); w1 = 2 / (n + 1); w2 = 1 - w1; SetLoopCount(0); //*********************************************************************************** // check for additional bars loading or total reloading If Bars < prevbars or Bars-prevbars>1 Then first = True; prevbars = Bars; // loopbegin1 prevent couning of counted bars exclude current If first Then { loopbegin = Bars-vPeriod-2; If loopbegin < 0 Then Exit; // not enough bars for counting first = False; // this block is to be evaluated once only } Else { loopbegin = Bars - (Bars-vPeriod-2); } //*********************************************************************************** loopbegin = loopbegin+1; // current bar is to be recounted too for shift = loopbegin downto 0 { //ROC= (((Close[shift]-Close[shift+vPeriod])/Close[shift+vPeriod]*100)+Point);// /Close[shift+vPeriod] ROC= (((Close[shift]-Close[shift+vPeriod])/Close[shift+vPeriod])+Point);// /Close[shift+vPeriod] e1 = w1*ROC + w2*e1; e2 = w1*e1 + w2*e2; e3 = w1*e2 + w2*e3; e4 = w1*e3 + w2*e4; e5 = w1*e4 + w2*e5; e6 = w1*e5 + w2*e6; ROC = c1*e6 + c2*e5 + c3*e4 + c4*e3; if ROC>0 then SetIndexValue(shift, ROC+close[shift]) else SetIndexValue(shift,close[shift]+ROC); loopbegin = loopbegin-1; // prevent to previous bars recounting }; SetIndexValue(shift, ROC);
Author/Source:
Alejandro Galindo
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact