-
Notifications
You must be signed in to change notification settings - Fork 1
/
FR-TrendLines.mq4
92 lines (86 loc) · 2.48 KB
/
FR-TrendLines.mq4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
Generated by EX4-TO-MQ4 decompiler LITE V4.0.406.1f [-]
Website: https://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2011 ArtForexTrading"
#property link "http://artforextrading.com"
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 White
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 White
#property indicator_color5 Blue
#property indicator_color6 Red
#property indicator_color7 Black
#property indicator_color8 Black
#import
extern int TPeriod = 34;
extern int TType = 3;
extern int TShift = 0;
double gda_88[];
double gda_92[];
double gda_96[];
double gda_100[];
double gda_104[];
double gda_108[];
int init() {
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, gda_88);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(1, gda_92);
SetIndexStyle(2, DRAW_LINE);
SetIndexBuffer(2, gda_96);
SetIndexEmptyValue(0, 0);
SetIndexEmptyValue(1, 0);
SetIndexEmptyValue(2, 0);
SetIndexStyle(3, DRAW_LINE);
SetIndexBuffer(3, gda_100);
SetIndexStyle(4, DRAW_LINE);
SetIndexBuffer(4, gda_104);
SetIndexStyle(5, DRAW_LINE);
SetIndexBuffer(5, gda_108);
SetIndexEmptyValue(3, 0);
SetIndexEmptyValue(4, 0);
SetIndexEmptyValue(5, 0);
return (0);
}
int deinit() {
return (0);
}
int start() {
double ld_0;
double ld_8;
double ld_16;
double ld_24;
double ld_32;
double ld_40;
int li_48 = IndicatorCounted();
if (li_48 < 0) return (-1);
if (li_48 > 0) li_48--;
int li_52 = Bars - li_48;
for (int li_56 = 0; li_56 < li_52; li_56++) {
ld_0 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_HIGH, li_56);
ld_8 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_HIGH, li_56 + 1);
ld_16 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_LOW, li_56);
ld_24 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_LOW, li_56 + 1);
ld_32 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_MEDIAN, li_56);
ld_40 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_MEDIAN, li_56 + 1);
gda_88[li_56] = ld_0;
gda_92[li_56] = ld_0;
gda_96[li_56] = ld_0;
gda_100[li_56] = ld_16;
gda_104[li_56] = ld_16;
gda_108[li_56] = ld_16;
if (ld_0 > ld_8) {
gda_96[li_56] = 0;
gda_108[li_56] = 0;
}
if (ld_0 < ld_8) {
gda_92[li_56] = 0;
gda_104[li_56] = 0;
}
}
return (0);
}