PureBytes Links
Trading Reference Links
|
hi brian,
i have read the article and so far i have the 9 bars lower than the
close from 4 days ago.
each lower bar has a yellow outline and the white outlined bar is
the 9th consecutive lower bar.
the bars that are close is higher than the close from 4 days ago
are in a green outline, and the blue outlined bar is the actual 9th
consecutive bar of the close higher than the close from 4 days ago.
A=IIf(C<Ref(C,-4),7,IIf(C>Ref(C,-4),5,0));
A1=ValueWhen(A,C,1);
b=Sum(C<Ref(C,-4),9)==9;
b0=IIf(BarsSince(b==0)==1,-5,0);
b1=ValueWhen(b0,C,1);
Aa=IIf(C>Ref(C,-4),5,1);
bb=Sum(C>Ref(C,-4),9)==9;
bb0=IIf(BarsSince(bb==0)==1,1,0);
bb1=ValueWhen(bb0,C,1);
Plot(C,"",A+b0+bb0,64);
Plot(C,"",1,64);
you can plot the valuelines as well.
cheers: john.
--- In amibroker@xxxx, "brian_35m" <cadvantag@xxxx> wrote:
> I was trying to create a formula that used the principles in the
> following article.
>
> http://www.activetradermag.com/glass.htm
>
> I put this in indicator builder. It has a couple errors that I cant
> seem to fix. When it changes from one pattern and begins another I
> was trying to get it to change color but I was unsuccessful
(examples
> are in Figure 1 & 2 in the article). Also, is it possible to get
> numbers to post on the bars?
>
> Thanks,
> Brian
>
> Day1 = Ref( C, -1 );
> Day2 = Ref( C, -2 );
> Day3 = Ref( C, -3 );
> Day4 = Ref( C, -4 );
> Day5 = Ref( C, -5 );
> Day6 = Ref( C, -6 );
> Day7 = Ref( C, -7 );
> Day8 = Ref( C, -8 );
> Day9 = Ref( C, -9 );
> Day10 = Ref( C, -10 );
> Day11 = Ref( C, -11 );
> Day12 = Ref( C, -12 );
> Day13 = Ref( C, -13 );
> Day14 = Ref( C, -14 );
> Day15 = Ref( C, -15 );
> Day16 = Ref( C, -16 );
> Day17 = Ref( C, -17 );
> Day18 = Ref( C, -18 );
> Day19 = Ref( C, -19 );
> Day20 = Ref( C, -20 );
> Day21 = Ref( C, -21 );
> Day22 = Ref( C, -22 );
>
>
>
> barcolor = IIf( Day22 < Day18, 4, IIf( Day22 >Day18, 8, 20 ) );
> barcolor = IIf( Day21 < Day17, 4, IIf( Day21 >Day17, 8, 20 ) );
> barcolor = IIf( Day20 < Day16, 4, IIf( Day20 >Day16, 8, 20 ) );
> barcolor = IIf( Day19 < Day15, 4, IIf( Day19 >Day15, 8, 20 ) );
> barcolor = IIf( Day17 < Day14, 4, IIf( Day18 >Day14, 8, 20 ) );
> barcolor = IIf( Day16 < Day13, 4, IIf( Day17 >Day13, 8, 20 ) );
> barcolor = IIf( Day16 < Day12, 4, IIf( Day16 >Day12, 8, 20 ) );
> barcolor = IIf( Day15 < Day11, 4, IIf( Day15 >Day11, 8, 20 ) );
> barcolor = IIf( Day14 < Day10, 4, IIf( Day14 >Day10, 8, 20 ) );
> barcolor = IIf( Day13 < Day9, 4, IIf( Day13 >Day9, 8, 20 ) );
> barcolor = IIf( Day12 < Day8, 4, IIf( Day12 >Day8, 8, 20 ) );
> barcolor = IIf( Day11 < Day7, 4, IIf( Day11 >Day7, 8, 20 ) );
> barcolor = IIf( Day10 < Day6, 4, IIf( Day10 >Day6, 8, 20 ) );
> barcolor = IIf( Day9 < Day5, 4, IIf( Day9 >Day5, 8, 20 ) );
> barcolor = IIf( Day8 < Day5, 4, IIf( Day8 >Day4, 8, 20 ) );
> barcolor = IIf( Day7 < Day3, 4, IIf( Day7 >Day3, 8, 20 ) );
> barcolor = IIf( Day6 < Day2, 4, IIf( Day6 >Day2, 8, 20 ) );
> barcolor = IIf( Day5 < Day1, 4, IIf( Day5 >Day1, 8, 20 ) );
>
>
>
>
> /* Colourized price bars drawn here */
> //Graph0BarColor = barcolor;
> Graph0Style = 2+4; // Bar Graph
> Graph0BarColor = barcolor;
> Graph0 = Volume;
|