Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Three Period Time & Price Ranges for Amibroker (AFL)

Rating:
3 / 5 (Votes 3)
Tags:
amibroker

Plots 3 week, 3 month and 3 quarter time and price ranges as described in Frank Dilernia’s Book ‘The Trader Trading’

The formula let’s you look forward to the next periods levels by setting the number of days left in the current period.

Probably could be done a lot more elegantly, but the best I could do with my coding capabilities.

Colored for black background.

Screenshots

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn over 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly over 13 years ago
Williams Alligator System
Submitted by durgesh1712 over 13 years ago
*Level Breakout system*
Submitted by Tinych over 13 years ago
Horizontal Live Priceline Tool
Submitted by northstar over 13 years ago

Indicator / Formula

Copy & Paste Friendly
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
Plot(C,"close",colorBrightGreen,styleBar|styleThick);
 
_SECTION_BEGIN("range 3 Qtr");
Hi1 = IIf(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Ref(HighestSince(Month()!=Ref(Month(),-1),H,9),-1),0);
Hi = ValueWhen(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Hi1,1);
Lo1 = IIf(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Ref(LowestSince(Month()!=Ref(Month(),-1),L,9),-1),0);
Lo = ValueWhen(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Lo1,1);
Cl1 = IIf(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Ref(C,-1),0);
Cl = ValueWhen(Month()!=Ref(Month() ,-1)AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Cl1,1);
 
rg = (Hi - Lo);
bp = (Hi + Lo + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
Plot(bp,"",colorBlue,styleStaircase|styleNoLabel|styleNoRescale);
Plot(rh,"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(rl,"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
//Plot(rh1,"",colorblue,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl1,"",colorblue,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rh2,"",colorblue,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl2,"",colorblue,stylestylestaircase|stylenolabel|styleNoRescale);
 
 
x =Param("forward",20,0,20,1);
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(bp),"",colorBlue,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Hi1 = HighestSince(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),H,3);
Hi = ValueWhen(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Hi1,1);
Lo1 = LowestSince(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),L,3);
Lo = ValueWhen(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Lo1,1);
Cl1 = IIf(Month()!=Ref(Month(),-1) AND (Month()==4 OR Month()==7 OR Month()==10 OR Month()==1),Ref(C,-1),0);
Cl = C;
 
rg = (Hi1 - Lo1);
bp = (Hi1 + Lo1 + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(bp),"",colorBlue,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, 20);
Plot(LastValue(rh),"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 20);
Plot(LastValue(rl),"",colorBlue,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 20);
_SECTION_END();
 
_SECTION_BEGIN("ranges 3 month fwd");
 
Hi1 = IIf(Month()!=Ref(Month(),-1),Ref(HighestSince(Month()!=Ref(Month(),-1),H,3),-1),0);
Hi = ValueWhen(Month()!=Ref(Month(),-1),Hi1,1);
Lo1 = IIf(Month()!=Ref(Month(),-1),Ref(LowestSince(Month()!=Ref(Month(),-1),L,3),-1),0);
Lo = ValueWhen(Month()!=Ref(Month(),-1),Lo1,1);
Cl1 = IIf(Month()!=Ref(Month(),-1),Ref(C,-1),0);
Cl = ValueWhen(Month()!=Ref(Month(),-1),Cl1,1);rg = (Hi - Lo);
 
rg = (Hi - Lo);
bp = (Hi + Lo + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
Plot(bp,"",colorCustom12,styleStaircase|styleNoLabel|styleNoRescale);
Plot(rh,"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(rl,"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
//Plot(rh1,"",colorcustom12,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl1,"",colorcustom12,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rh2,"",colorCustom12,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl2,"",colorCustom12,stylestylestaircase|stylenolabel|styleNoRescale);
 
 
x =Param("forward",20,0,20,1);
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(bp),"",colorCustom12,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
 
Hi1 = HighestSince(Month()!=Ref(Month(),-1),H,3);
Hi = ValueWhen(Month()!=Ref(Month(),-1),Hi1,1);
Lo1 = LowestSince(Month()!=Ref(Month(),-1),L,3);
Lo = ValueWhen(Month()!=Ref(Month(),-1),Lo1,1);
Cl1 = IIf(Month()!=Ref(Month(),-1),Ref(C,-1),0);
Cl = C;
 
rg = (Hi1 - Lo1);
bp = (Hi1 + Lo1 + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
 
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(bp),"",colorCustom12,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, 20);
Plot(LastValue(rh),"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 20);
Plot(LastValue(rl),"",colorCustom12,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 20);
_SECTION_END();
 
_SECTION_BEGIN("ranges 3 week");
Hi1 = IIf(DayOfWeek()<Ref(DayOfWeek(),-1),Ref(HighestSince(DayOfWeek()<Ref(DayOfWeek(),-1),H,3),-1),0);
Hi = ValueWhen(DayOfWeek()<Ref(DayOfWeek(),-1),Hi1,1);
Lo1 = IIf(DayOfWeek()<Ref(DayOfWeek(),-1),Ref(LowestSince(DayOfWeek()<Ref(DayOfWeek(),-1),L,3),-1),0);
Lo = ValueWhen(DayOfWeek()<Ref(DayOfWeek(),-1),Lo1,1);
Cl1 = IIf(DayOfWeek()<Ref(DayOfWeek(),-1),Ref(C,-1),0);
Cl = ValueWhen(DayOfWeek()<Ref(DayOfWeek(),-1),Cl1,1);
 
rg = (Hi - Lo);
bp = (Hi + Lo + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
Plot(bp,"",colorWhite,styleStaircase|styleNoLabel|styleNoRescale);
Plot(rh,"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(rl,"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
//Plot(rh1,"",colorWhite,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl1,"",colorWhite,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rh2,"",colorCustom12,stylestylestaircase|stylenolabel|styleNoRescale);
//Plot(rl2,"",colorCustom12,stylestylestaircase|stylenolabel|styleNoRescale);
 
 
x =Param("forward",5,0,5,1);
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale);
Plot(LastValue(bp),"",colorWhite,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
 
 
 
Hi1 = HighestSince(DayOfWeek()<Ref(DayOfWeek(),-1),H,3);
Hi = ValueWhen(DayOfWeek()<Ref(DayOfWeek(),-1),Hi1,1);
Lo1 = LowestSince(DayOfWeek()<Ref(DayOfWeek(),-1),L,3);
Lo = ValueWhen(DayOfWeek()<Ref(DayOfWeek(),-1),Lo1,1);
Cl1 = IIf(DayOfWeek()<Ref(DayOfWeek(),-1),Ref(C,-1),0);
Cl = C;
 
rg = (Hi1 - Lo1);
bp = (Hi1 + Lo1 + Cl)/3;
rh = bp + (rg*0.5);
rl = bp - (rg*0.5);
rh1 = bp + (rg*0.61);
rl1 = bp - (rg*0.61);
rh2 = bp + rg;
rl2 = bp - rg;;
 
 
 
Plot(LastValue(bp),"",colorBlack,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rh),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(rl),"",colorBlack,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, x);
Plot(LastValue(bp),"",colorWhite,styleStaircase|styleNoLabel|styleNoRescale, Null, Null, 5);
Plot(LastValue(rh),"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 5);
Plot(LastValue(rl),"",colorWhite,styleStaircase|styleDashed|styleNoLabel|styleNoRescale, Null, Null, 5);
_SECTION_END();

1 comments

1. buchacek

That what is visible is exactly the same as was posted by somebody else but much more simpler. Simple (H+L+C)/3
in different TimeFrame set and TimeFrameExpand will result with the same thing as was posted by somebody else here before. Can you do 2-Day SD Channel? I can’t post it as per copyright of Frank Dilernia. There is also 5-Day pattern in the book for Day Trading.

Leave Comment

Please login here to leave a comment.

Back