PureBytes Links
Trading Reference Links
|
Jim is right: you overwrite L (Low) array in your formula. Just replace your L with L1 or so.
I have attached fixed formula to this e-mail.
Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com
----- Original Message -----
From: Brett Forrester
To: amibroker@xxxxxxxxxxxxxxx
Sent: Monday, July 09, 2001 10:07 PM
Subject: [amibroker] Re: Candlestick graphstyle problem
Tomasz,
I tried your suggestion but still basically have the same problem as before. Below is my code and attached is a screen shot showing the candles with long tails on the tops.
A = MA ( C, 21 );
SMA50 = MA ( C, 50);
I = ( C - A ) / A;
I50 = ( C - SMA50 ) / SMA50;
J = IIF ( I > 0, I * I, 0 );
J50 = IIF ( I50 > 0, I50 * I50, 0 );
K = IIF ( J > 0, 1, 0 );
K50 = IIF ( J50 > 0, 1, 0 );
L = SUM ( K, 185 );
L50 = SUM ( K50, 250);
M = IIF ( I < 0, I * I, 0 );
M50 = IIF ( I50 < 0, I50 * I50, 0 );
N = IIF ( M > 0, 1, 0 );
N50 = IIF ( M50 > 0, 1, 0 );
OO = SUM ( N, 185 );
OO50 = SUM ( N50, 250 );
P = 1.43933 * SQRT ( SUM ( J, 185 ) / L );
P50 = 1.645 * SQRT ( SUM ( J50, 250) / L50 );
Q = 1.43933 * SQRT ( SUM ( M,185 ) / OO );
Q50 = 1.645 * SQRT ( SUM ( M50,250 ) / OO50 );
R = MA (P , 21 );
R50 = MA (P50 , 21 );
S = MA (Q, 21 );
S50 = MA (Q50, 21 );
UPPER = ( 1 + R ) * A;
UPPERINT = ( 1 + R50 ) * SMA50;
LOWER = ( 1 - S ) * A;
LOWERINT = ( 1 - S50 ) * SMA50;
SMA90 = MA (close, 90 );
UpperBreakout = SMA90 + 15 * STDEV (SMA90, 21);
LowerBreakout = SMA90 - 15 * STDEV (SMA90, 21);
MAXGRAPH=9;
graph1=2*c;
graph0=upper;
graph2=lower;
GRAPH3=A;
GRAPH4=UPPERINT;
GRAPH5=LOWERINT;
graph6=UpperBreakout;
graph7=LowerBreakout;
GRAPH1STYLE=64;
GRAPH0STYLE=GRAPH2STYLE=GRAPH3STYLE=GRAPH4STYLE=GRAPH5STYLE=graph6style=graph7style=1;
graph0color=graph2color=9;
GRAPH4COLOR=GRAPH5COLOR=5;
graph1color=16;
graph6color=graph7color=4;
title= name() + " " + date() + " Price:" + writeval(close,.2) + " - Upper Bomar = " + writeval( graph0,.2 ) + ", Lower Bomar = " + writeval( graph2,.2 ) +
", 21MA = " + writeval(graph3,.2 ) + ", Upper Intermedite = " + writeval(graph4,.2 ) +", Lower Inermediate = " + writeval(graph5,.2 );
high=2*high;
low=2*low;
open=2*open;
Please excuse the colors as I am in the process of modifying some of the assignments and I have not completed the changes prior to this screen shot.
Thanks for your assistance again,
Brett
--- In amibroker@xxxx, "Tomasz Janeczko" <tj@xxxx> wrote:
> Dear Brett,
>
> Please do not be afraid about your database.
> AFL formulas are safe because they operate on copies of the data
> so even if you modify the OHLC arrays in the AFL formula
> this wouldn't affect the database (unless you are using scripting and automation
> - but this is another story)
>
> An example:
>
> graph0 = 2 * close;
> graph0style = 64;
> graph0color = 2;
> high = 2 * high;
> low = 2 * low;
> open = 2 * open;
>
> draws candlestick chart with doubled prices.
>
>
> Best regards,
> Tomasz Janeczko
> ===============
> AmiBroker - the comprehensive share manager.
> http://www.amibroker.com
>
> ----- Original Message -----
> From: brett_f1@xxxx
> To: amibroker@xxxx
> Sent: Tuesday, July 03, 2001 1:07 AM
> Subject: [amibroker] Re: Candlestick graphstyle problem
>
>
> Yes I did/do realize the candles must also use the high, low and open
> values in addition to the close I'm using. However, I incorrectly
> assumed that these values would be read without me having to write
> them into the code.
>
> How do I OVERWRITE the High, Low and Open variables? I hesitate to
> try this on my own as I've grown tired of restoring my databases
> after other blunders I've made.
>
> Regards,
>
> Brett
>
>
>
> --- In amibroker@xxxx, "Tomasz Janeczko" <tj@xxxx> wrote:
> > Hello Brett,
> >
> > If you are using graphstype=64 you have to know that this style
> > uses indirectly High, Low and Open arrays. This is so because
> > candlesticks need 4 arrays to draw (not only one)
> > So it is not enough to write:
> > graph0 = something;
> > graph0style = 64;
> >
> > but you have to OVERWRITE the High, Low and Open variables.
> > (the safest way is to do this at the end of the formula otherwise
> built in functions
> > will operate on overwritten values)
> >
> > Best regards,
> > Tomasz Janeczko
> > ===============
> > AmiBroker - the comprehensive share manager.
> > http://www.amibroker.com
> >
> > ----- Original Message -----
> > From: brett_f1@xxxx
> > To: amibroker@xxxx
> > Sent: Saturday, June 30, 2001 6:45 PM
> > Subject: [amibroker] Candlestick graphstyle problem
> >
> >
> > I'm using geaphstyle=64 with some other graphs to overlay some
> other
> > indicators with and I'm having a problem with the end result of
> the
> > display. The candles appear with an outline color and long thin
> tops
> > from the body to the top of the chart. Has anyone else
> experienced
> > this type of problem and been able to fix it?
> >
> > Brett
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------=_NextPart_001_006F_01C10918.136D9BA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Tahoma size=2>Hello Brett,</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>Jim is right: you overwrite L (Low) array in
your formula. Just replace your L with L1 or so.</FONT></DIV>
<DIV><FONT face=Tahoma size=2>I have attached fixed formula to this
e-mail.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Best regards,<BR>Tomasz Janeczko<BR>===============<BR>AmiBroker - the
comprehensive share manager.<BR><A
href="http://www.amibroker.com">http://www.amibroker.com</A><BR></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial ce">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial ce; font-color: black"><B>From:</B>
<A title=brett@xxxx href="mailto:brett@xxxx">Brett
Forrester</A> </DIV>
<DIV style="FONT: 10pt arial ce"><B>To:</B> <A title=amibroker@xxxxxxxxxxxxx
href="mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial ce"><B>Sent:</B> Monday, July 09, 2001 10:07
PM</DIV>
<DIV style="FONT: 10pt arial ce"><B>Subject:</B> [amibroker] Re: Candlestick
graphstyle problem</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Tomasz,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I tried your suggestion but still basically have
the same problem as before. Below is my code and attached is a screen
shot showing the candles with long tails on the tops.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>A = MA ( C, 21 );<BR>SMA50 = MA ( C,50);<BR>I =
( C - A ) / A;<BR>I50 = ( C - SMA50 ) / SMA50;<BR>J = IIF ( I > 0,I * I, 0
);<BR>J50 = IIF ( I50 > 0, I50 * I50, 0 );<BR>K = IIF ( J > 0, 1, 0
);<BR>K50 = IIF ( J50 > 0, 1, 0 );<BR>L = SUM ( K, 185 );<BR>L50 = SUM (
K50, 250);<BR>M = IIF ( I < 0, I * I, 0 );<BR>M50 = IIF ( I50 <0, I50 *
I50, 0 );<BR>N = IIF ( M > 0, 1, 0 );<BR>N50 = IIF ( M50 > 0, 1, 0
);<BR>OO = SUM ( N, 185 );<BR>OO50 = SUM ( N50, 250 );<BR>P = 1.43933 * SQRT (
SUM ( J, 185 ) / L );<BR>P50 = 1.645 * SQRT ( SUM ( J50, 250) / L50 );<BR>Q =
1.43933 * SQRT ( SUM ( M,185 ) / OO );<BR>Q50 = 1.645 * SQRT ( SUM ( M50,250 )
/ OO50 );<BR>R = MA (P , 21 );<BR>R50 = MA (P50 , 21 );<BR>S = MA (Q, 21
);<BR>S50 = MA (Q50, 21 );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>UPPER = ( 1 + R ) * A;<BR>UPPERINT =( 1 + R50 )
* SMA50;<BR>LOWER = ( 1 - S ) * A;<BR>LOWERINT = ( 1 - S50 ) *
SMA50;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>SMA90 = MA (close, 90 );<BR>UpperBreakout = SMA90
+ 15 * STDEV (SMA90, 21);<BR>LowerBreakout = SMA90 - 15 * STDEV (SMA90,
21);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>MAXGRAPH=9;<BR>graph1=2*c;<BR>graph0=upper;<BR>graph2=lower;<BR>GRAPH3=A;<BR>GRAPH4=UPPERINT;<BR>GRAPH5=LOWERINT;<BR>graph6=UpperBreakout;<BR>graph7=LowerBreakout;<BR>GRAPH1STYLE=64;<BR>GRAPH0STYLE=GRAPH2STYLE=GRAPH3STYLE=GRAPH4STYLE=GRAPH5STYLE=graph6style=graph7style=1;<BR>graph0color=graph2color=9;<BR>GRAPH4COLOR=GRAPH5COLOR=5;<BR>graph1color=16;<BR>graph6color=graph7color=4;<BR>title=
name() + " " + date() + " Price:" + writeval(close,.2) + " - Upper Bomar = " +
writeval( graph0,.2 ) + ", Lower Bomar = " + writeval( graph2,.2 )
+<BR> ", 21MA = " + writeval(graph3,.2 ) + ", Upper Intermedite = " +
writeval(graph4,.2 ) +", Lower Inermediate = " + writeval(graph5,.2
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>high=2*high;<BR>low=2*low;<BR>open=2*open;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Please excuse the colors as I am in the process
of modifying some of the assignments and I have not completed the changes
prior to this screen shot.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for your assistance again,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Brett</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--- In <A
href="mailto:amibroker@xxxx">amibroker@xxxx</A>..., "Tomasz Janeczko" <<A
href="mailto:tj@xxxx">tj@xxxx</A>...> wrote:<BR>> Dear Brett,<BR>> <BR>>
Please do not be afraid about your database.<BR>> AFL formulas are safe
because they operate on copies of the data<BR>> so even if you modify the
OHLC arrays in the AFL formula<BR>> this wouldn't affect the database
(unless you are using scripting and automation<BR>> - but this is another
story)<BR>> <BR>> An example:<BR>> <BR>> graph0 = 2 *
close;<BR>> graph0style = 64;<BR>> graph0color = 2;<BR>> high = 2 *
high;<BR>> low = 2 * low;<BR>> open = 2 * open;<BR>> <BR>> draws
candlestick chart with doubled prices.<BR>> <BR>> <BR>> Best
regards,<BR>> Tomasz Janeczko<BR>> ===============<BR>> AmiBroker -
the comprehensive share manager.<BR>> <A
href="http://www.amibroker.com">http://www.amibroker.com</A><BR>>
<BR>> ----- Original Message ----- <BR>> From:
brett_f1@xxxx... <BR>> To: <A
href="mailto:amibroker@xxxx">amibroker@xxxx</A>... <BR>> Sent:
Tuesday, July 03, 2001 1:07 AM<BR>> Subject: [amibroker] Re:
Candlestick graphstyle problem<BR>> <BR>> <BR>> Yes I
did/do realize the candles must also use the high, low and open
<BR>> values in addition to the close I'm using. However,
I incorrectly <BR>> assumed that these values would be read
without me having to write <BR>> them into the code.<BR>>
<BR>> How do I OVERWRITE the High, Low and Open
variables? I hesitate to <BR>> try this on my own asI've
grown tired of restoring my databases <BR>> after other
blunders I've made.<BR>> <BR>> Regards,<BR>>
<BR>> Brett<BR>> <BR>> <BR>> <BR>> ---
In amibroker@xxxx..., "Tomasz Janeczko" <<A
href="mailto:tj@xxxx">tj@xxxx</A>...> wrote:<BR>> > Hello
Brett,<BR>> > <BR>> > If you are using
graphstype=64 you have to know that this style<BR>> >uses
indirectly High, Low and Open arrays. This is so because<BR>>
> candlesticks need 4 arrays to draw (not only one)<BR>>
> So it is not enough to write:<BR>> > graph0 =
something;<BR>> > graph0style = 64;<BR>> >
<BR>> > but you have to OVERWRITE the High, Low and Open
variables.<BR>> > (the safest way is to do this at the end
of the formula otherwise <BR>> built in
functions<BR>> > will operate on overwritten
values)<BR>> > <BR>> > Best
regards,<BR>> > Tomasz Janeczko<BR>> >
===============<BR>> > AmiBroker - the comprehensive share
manager.<BR>> > <A
href="http://www.amibroker.com">http://www.amibroker.com</A><BR>>
> <BR>> > ----- Original Message -----
<BR>> > From: <A
href="mailto:brett_f1@xxxx">brett_f1@xxxx</A>... <BR>>
> To: amibroker@xxxx...
<BR>> > Sent: Saturday, June 30, 2001 6:45
PM<BR>> > Subject: [amibroker] Candlestick
graphstyle problem<BR>> > <BR>> >
<BR>> > I'm using geaphstyle=64 with someother
graphs to overlay some <BR>> other <BR>>
> indicators with and I'm having a problem with the end result
of <BR>> the <BR>> >
display. The candles appear with an outline color and long thin
<BR>> tops <BR>> > from the body
to the top of the chart. Has anyone else <BR>>
experienced <BR>> > this type of problem and
been able to fix it?<BR>> > <BR>>
> Brett<BR>> > <BR>> >
<BR>> > Your use of Yahoo! Groups is subject to
the Yahoo! Terms of <BR>> Service.<BR>> <BR>>
<BR>> Your use of Yahoo! Groups is subject to the Yahoo! Terms
of Service.</FONT></DIV><BR><TT>Your use of Yahoo! Groups is subject to the <A
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</TT>
<BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_001_006F_01C10918.136D9BA0--
Attachment:
Attachment:
Description: "Description: Binary data"
|