PureBytes Links
Trading Reference Links
|
Thanks,
Richard
----- Original Message -----
From: bluesinvestor
To: amibroker@xxxxxxxxxxxxxxx
Sent: Friday, July 19, 2002 3:29 PM
Subject: RE: [amibroker] Re: Point & Figure Chart in AFL
Forgot to mention:
http://groups.yahoo.com/group/amibroker/message/17288
For PnF.dll information.
Peter
-----Original Message-----
From: bluesinvestor [mailto:investor@x...]
Sent: Friday, July 19, 2002 4:23 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Re: Point & Figure Chart in AFL
Hello Mirat,
Good stuff!! I made some modifications to your code to call my Point &Figure DLL and plot the data using your jscript code. I tested it on one stock (PYPL - short history) and it looks correct (except for the beginningbars:
I have attached the AFL to this email (and posted below for Yahoo viewers).
Thanks again,
Peter
// PF Chart by Mirat Dave
// Copy and paste this as a custom indicator.
x=calcPnF(0,3);
EnableScript("jscript");
<%
PnFValue = VBArray( AFL( "PnFVal" ) ).toArray();
PnFColumn = VBArray( AFL( "PnFCol" ) ).toArray();
// Calculate running average stock price for use in calculating the Boxsize.
PFO = new Array();
PFC = new Array();
// initialize first element
j = 0;
PFO[j] = PnFValue[0];
PFC[j] = PnFValue[0];
// perform the loop that produces PF Chart
for( i = 1; i < PnFValue.length; i++ )
{
if ( PnFColumn[i] == 0 )
{
if( PnFColumn[i] == 0 && PnFColumn[i-1] == 0)
{
PFC[j] = PnFValue[i];
}
if( PnFColumn[i] == 0 && PnFColumn[i-1] != 0 )
{
j++;
PFC[j] = PnFValue[i];
PFO[j] = PnFValue[i-1];
}
}
else
{
if (PnFColumn[i] == 1)
{
if( PnFColumn[i] == 1 && PnFColumn[i-1] == 1 )
{
PFC[j] = PnFValue[i];
}
if( PnFColumn[i] == 1 && PnFColumn[i-1] != 1 )
{
j++;
PFO[j] = PnFValue[i-1];
PFC[j] = PnFValue[i];
}
}
}
}
// Shift chart to the right to eliminate trailing empty data
// - PF charts are generally smaller/shorter then the full stock chartsbecause they lack a time scale.
delta = PnFValue.length - PFO.length;
for( i = PnFValue.length; i > delta; i-- )
{
PFO[ i-1 ] = PFO[ i-delta-1];
PFC[ i-1 ] = PFC[ i-delta-1];
}
for( i = 0; i < delta; i++)
{
PFO[ i-1 ] = 0;
PFC[ i-1 ] = 0;
}
AFL.Var("delta") = delta;
AFL.Var("length") = PnFValue.length;
AFL.Var("PFO") = PFO;
AFL.Var("PFC") = PFC;
%>
O = PFO;
C = PFC;
H = (O+C)/2;
L = (O+C)/2;
GraphXSpace = 9;
Graph0Style = 64;
Graph0Color =1;
Graph0 = C;
Filter=C>0;
AddColumn(PFO,"PFO");
AddColumn(PFC,"PFC");
-----Original Message-----
From: mirat_dave [mailto:mirat_dave@x...]
Sent: Friday, July 19, 2002 10:00 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Point & Figure Chart in AFL
Hello Richard and Dimitris,
Sorry to have caused so much confusion.
Since most stocks since 2000 have been trending down, you may get a
only a few bars because the P&F Chart ignores small up moves and only
extends down bars when the price moves more than the box size. Since
2000, you may very well have only a few bars. Try loading more data
for at least one stock.
I used AmiQuote and Yahoo for the data. I have data from January
1994. The AmiBroker version on which I created this file is 4.0.0
Apr 26 2002.
I do not know if the AmiBroker version is causing the difference. I
saw that it worked for Richard on MSFT (although I am not sure what
the whole MSFT v. MSFT issue was - it seems to have resolved
itself). Perhaps Richard also has more data loaded.
As you can see from the script, it is very simple. If problems
continue, I would be happy to go through it in detail to see if there
is a coding error.
I'm afraid I have no other explanation other than more data. Let's
try that first.
Mirat
PS I would post .gifs of my charts but I do not know how to attach a
file to my reply. Although that would not help resolve the issue. :-)
--- In amibroker@xxxx, "Richard Alford" <richard.alford@xxxx> wrote:
> I am just isolating variables. If we have the same program and
version (4.06.1 Jun 19 build), the same indicator code (this I
confirmed) and same data we should get the same result. (I continue
to believe in deterministic computing - probably naive in light of
Microsoft!). The questionable variable, and a big one, is the data
source - I use qp2. Perhaps someone using yahoo could compare to
your results?
>
>
> It does appear that the "box size", the significant change that
defines an X or O in my understanding, should be normalized to the
price of the instrument to account for the difference in WCOME
pricing vs. DJIA, for example. I am referring to the code fragment:
>
> // Calculate PF Chart Box size and minimum Reverse values
> // Box = ((tot[i]/(i+1))^.5)/7.3374;
>
> Cheers,
>
> Richard
> ----- Original Message -----
> From: dtsokakis
> To: amibroker@xxxx
> Sent: Wednesday, July 17, 2002 2:49 PM
> Subject: [amibroker] Re: Point & Figure Chart in AFL
>
>
> Richard,
> YHOO via Amiquote.
> Why do you think it is a matter of data provider ?
> Dimitris Tsokakis
>
> --- In amibroker@xxxx, "Richard Alford" <richard.alford@xxxx>
wrote:
> > but the point remains that you and I get different results.
what
> is your data source?
> >
> > Richard
> > ----- Original Message -----
> > From: dtsokakis
> > To: amibroker@xxxx
> > Sent: Wednesday, July 17, 2002 1:47 PM
> > Subject: [amibroker] Re: Point & Figure Chart in AFL
> >
> >
> > Richard,
> > ANY other function works just fine with my valuable Amibroker
> 4.06.
> > Just fine.
> > I can not see the reason for this P&F script.
> > Anyway, the author perhaps could expain.
> > Dimitris Tsokakis
> >
> > --- In amibroker@xxxx, "Richard Alford" <richard.alford@xxxx>
> wrote:
> > > DT, I agree it was not easy to understand. The attached
charts
> > showed the TWO results that were generated whenever I entered
the
> > symbol MSFT - it appears to be a fluke and I cannot reproduce
it
> any
> > longer. Although there is not ticker name in the formula,
there
> was
> > strange behavior occurring for MSFT and MSFT only at that
time.
> > >
> > > The gist of my reply to you was that using the SAME code as
you
> > posted and using the code I copied from the files sections, I
> > generated the same results - and not the results that you
were
> > creating. That suggests that you have a problem in your data
> and/or
> > setup. The only reason for the two codes was to guarantee
that
> there
> > wasn't a subtle error - there was not.
> > >
> > > Sorry for adding the confusion about the MSFT fluke at the
same
> > time.
> > >
> > > Cheers,
> > >
> > > Richard
> > > ----- Original Message -----
> > > From: dtsokakis
> > > To: amibroker@xxxx
> > > Sent: Wednesday, July 17, 2002 12:47 AM
> > > Subject: [amibroker] Re: Point & Figure Chart in AFL
> > >
> > >
> > > Richard,
> > > It is not easy to understand this
> > > "the plot for MSFT changes when one changes the symbol go
> MSFT
> > from
> > > MSFT??? "
> > > I copied the formula from
> > > http://groups.yahoo.com/group/amibroker/files/Point-Figure
> > > pasted in my Ind. builder and get the posted gifs.
> > > No ticker name is into the formula.
> > > What is "the two MSFT " ???
> > > Do you use the same code from the above address??
> > > DT
> > >
> > >
> > > --- In amibroker@xxxx, "Richard Alford"
<richard.alford@xxxx>
> > wrote:
> > > > Those are not the figures I generate using the code in
> > the "files
> > > section". (Why wasn't this put in the AFL library is a
> question
> > in
> > > my mind???)
> > > >
> > > > Just noticed that the plot for MSFT changes when one
> changes
> > the
> > > symbol go MSFT from MSFT??? Not the case for AMZN or
ORCL?
> > > >
> > > > I attached the two MSFT for comparison, one is "my"
copy,
> and
> > the
> > > other is a copy and paste of the code in your note. The
> > difference
> > > is the quirk in MSFT, not an error in the code you have
used.
> And
> > DT
> > > do you really like black on blue borders? Personally, I
can
> > never
> > > read your chart titles.
> > > >
> > > > Cheers,
> > > >
> > > > Richard
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: Dimitris Tsokakis
> > > > To: amibroker@xxxx
> > > > Sent: Tuesday, July 16, 2002 1:14 PM
> > > > Subject: [amibroker] Re: Point & Figure Chart in AFL
> > > >
> > > >
> > > > Mirat,
> > > > Here is P&F charts for AMZN, MSFT and ORCL.
> > > > Data since Jan 2000.
> > > > Is it the expected picture ?
> > > > The code, copied from files section
> > > >
> > > > // PF Chart by Mirat Dave
> > > > // Copy and paste this as a custom indicator.
> > > >
> > > > EnableScript("jscript");
> > > > <%
> > > >
> > > > High = VBArray( AFL( "High" ) ).toArray();
> > > > Low = VBArray( AFL( "Low" ) ).toArray();
> > > >
> > > > // Calculate running average stock price for use in
> > calculating
> > > the Box size.
> > > >
> > > > tot = new Array();
> > > > tot[0] = (High[0] + Low[0])/2;
> > > > for( i=1; i < High.length; i++ )
> > > > {
> > > > tot[i] = tot[i-1] + ((High[i] + Low[i])/2);
> > > > }
> > > > PFO = new Array();
> > > > PFC = new Array();
> > > >
> > > > // initialize first element
> > > >
> > > > j = 0;
> > > > PFO[j] = High[0];
> > > > PFC[j] = Low[0];
> > > > down = 1; // By default the first bar is a down bar.
> > > >
> > > > up = 0;
> > > > swap = 0;
> > > >
> > > > // perform the loop that produces PF Chart
> > > >
> > > > for( i = 1; i < High.length; i++ )
> > > > {
> > > > // Calculate PF Chart Box size and minimum Reverse
values
> > > >
> > > > Box = ((tot[i]/(i+1))^.5)/7.3374;
> > > > Reverse = Box * 3;
> > > > if( Low[i] < PFC[j] - Box && down)
> > > > {
> > > > PFC[j] = Low[i];
> > > > }
> > > > else
> > > > {
> > > > if( High[i] >= PFC[j] + Reverse && down)
> > > > {
> > > > j++;
> > > > swap = 1;
> > > > PFO[j] = Low[i];
> > > > PFC[j] = High[i];
> > > > }
> > > > }
> > > > if( High[i] > PFC[j] + Box && up)
> > > > {
> > > > PFC[j] = High[i];
> > > > }
> > > > else
> > > > {
> > > > if( Low[i] <= PFC[j] - Reverse && up)
> > > > {
> > > > j++;
> > > > PFC[j] = Low[i];
> > > > PFO[j] = High[i];
> > > > swap = 1;
> > > > }
> > > > }
> > > > if( swap )
> > > > {
> > > > swap = 0;
> > > > if( up )
> > > > {
> > > > up = 0;
> > > > down = 1;
> > > > }
> > > > else
> > > > {
> > > > up = 1;
> > > > down = 0;
> > > > }
> > > > }
> > > > }
> > > >
> > > > // Shift chart to the right to eliminate trailing
empty
> data
> > > > // - PF charts are generally smaller/shorter then the
> full
> > stock
> > > charts because they lack a time scale.
> > > >
> > > > delta = High.length - PFO.length;
> > > > for( i = High.length; i > delta; i-- )
> > > > {
> > > > PFO[ i-1 ] = PFO[ i-delta-1];
> > > > PFC[ i-1 ] = PFC[ i-delta-1];
> > > > }
> > > > for( i = 0; i < delta; i++)
> > > > {
> > > > PFO[ i-1 ] = 0;
> > > > PFC[ i-1 ] = 0;
> > > > }
> > > > AFL.Var("PFO") = PFO;
> > > > AFL.Var("PFC") = PFC;
> > > > %>
> > > >
> > > > O = PFO;
> > > > C = PFC;
> > > >
> > > > H = (O+C)/2;
> > > > L = (O+C)/2;
> > > >
> > > > GraphXSpace = 9;
> > > > Graph0Style = 64;
> > > >
> > > > Graph0Color =1;
> > > > Graph0 = C;
> > > >
> > > > Thanks in advance for any reply.
> > > > Dimitris Tsokakis
> > > >
> > > > Yahoo! Groups Sponsor
> > > >
> > > > Click here to find your contact lenses!
> > > >
> > > > Your use of Yahoo! Groups is subject to the Yahoo!
Terms
> of
> > > Service.
> > >
> > >
> > > Yahoo! Groups Sponsor
> > > ADVERTISEMENT
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo! Terms
of
> > Service.
> >
> >
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> >
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Yahoo! Groups Sponsor
ADVERTISEMENT
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------=_NextPart_001_0636_01C22F3D.3B493840
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><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Looks great, Peter. Can you elaborate on what
is meant by the traditional scaling? <FONT face="Courier New" size=3>"x =
Boxsize (use '0' for traditional scaling)</FONT></FONT><FONT><FONT face=Arial
size=2>or provide a reference. I was checking out Kaufman and I couldn't
find a recommended box size.</FONT></FONT></DIV>
<DIV><FONT><FONT face=Arial size=2></FONT></FONT> </DIV>
<DIV><FONT><FONT face=Arial size=2>Thanks,</FONT></FONT></DIV>
<DIV><FONT><FONT face=Arial size=2></FONT></FONT> </DIV>
<DIV><FONT><FONT face=Arial size=2>Richard</FONT></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=investor@xxxx
href="mailto:investor@xxxx">bluesinvestor</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=amibroker@xxxxxxxxxx
href="mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, July 19, 2002 3:29 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [amibroker] Re: Point&
Figure Chart in AFL</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff
size=2>Forgot to mention:</FONT></SPAN></DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff size=2><A
href="http://groups.yahoo.com/group/amibroker/message/17288">http://groups.yahoo.com/group/amibroker/message/17288</A></FONT></SPAN></DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff size=2>For
PnF.dll information.</FONT></SPAN></DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=741082920-19072002><FONT face=Arial color=#0000ff
size=2>Peter</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> bluesinvestor
[mailto:investor@x...]<BR><B>Sent:</B> Friday, July 19, 2002 4:23
PM<BR><B>To:</B> <A
href="mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A><BR><B>Subject:</B>
RE: [amibroker] Re: Point & Figure Chart in AFL<BR><BR></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Hello Mirat,</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Good stuff!! I made some
modifications to your code to call my Point & Figure DLL and plot the
data using your jscript code. I tested it on one stock (PYPL - short
history) and it looks correct (except for the beginning bars:</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><IMG alt="" hspace=0 src="cid:063301c22f67$240e7760$6400a8c0@xxxxxxxxx"
align=baseline border=0></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><IMG alt="" hspace=0 src="cid:063401c22f67$240e7760$6400a8c0@xxxxxxxxx"
align=baseline border=0></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>I have attached the AFL to this
email (and posted below for Yahoo viewers).</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Thanks again,</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Peter</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><FONT color=#008000 size=1>
<P>// PF Chart by Mirat Dave</P>
<P>// Copy and paste this as a custom indicator.</P></FONT><FONT
color=#000000 size=1>
<P>x=</FONT><FONT color=#0000ff size=1>calcPnF</FONT><FONT color=#000000
size=1>(</FONT><FONT color=#ff00ff size=1>0</FONT><FONT color=#000000
size=1>,</FONT><FONT color=#ff00ff size=1>3</FONT><FONT color=#000000
size=1>);</P></FONT><FONT color=#0000ff size=1>
<P>EnableScript</FONT><FONT color=#000000 size=1>(</FONT><FONT color=#ff00ff
size=1>"jscript"</FONT><FONT color=#000000 size=1>);</P>
<P><%</P>
<P>PnFValue = VBArray( AFL( </FONT><FONT color=#ff00ff
size=1>"PnFVal"</FONT><FONT color=#000000 size=1> ) ).toArray();</P>
<P>PnFColumn = VBArray( AFL( </FONT><FONT color=#ff00ff
size=1>"PnFCol"</FONT><FONT color=#000000 size=1> )
).toArray();</P></FONT><FONT color=#008000 size=1>
<P>// Calculate running average stock price for use in calculating the Box
size.</P></FONT><FONT color=#000000 size=1>
<P>PFO = new Array();</P>
<P>PFC = new Array();</P></FONT><FONT color=#008000 size=1>
<P>// initialize first element</P></FONT><FONT color=#000000 size=1>
<P>j = </FONT><FONT color=#ff00ff size=1>0</FONT><FONT color=#000000
size=1>;</P>
<P>PFO[j] = PnFValue[</FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1>];</P>
<P>PFC[j] = PnFValue[</FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1>];</P></FONT><FONT color=#008000 size=1>
<P>// perform the loop that produces PF Chart</P></FONT><FONT color=#000000
size=1>
<P>for( i = </FONT><FONT color=#ff00ff size=1>1</FONT><FONT color=#000000
size=1>; i < PnFValue.length; i++ )</P>
<P>{</P>
<P>if ( PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1> ) </P>
<P>{</P>
<P>if( PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1> && PnFColumn[i-</FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1>] == </FONT><FONT color=#ff00ff
size=1>0</FONT><FONT color=#000000 size=1>)</P>
<P>{</P>
<P>PFC[j] = PnFValue[i];</P>
<P>}</P>
<P>if( PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1> && PnFColumn[i-</FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1>] != </FONT><FONT color=#ff00ff
size=1>0</FONT><FONT color=#000000 size=1> )</P>
<P>{</P>
<P>j++;</P>
<P>PFC[j] = PnFValue[i];</P>
<P>PFO[j] = PnFValue[i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>];</P>
<P>}</P>
<P>}</P>
<P>else</P>
<P>{</P>
<P>if (PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>)</P>
<P>{</P>
<P>if( PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1> && PnFColumn[i-</FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1>] == </FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1> )</P>
<P>{</P>
<P>PFC[j] = PnFValue[i];</P>
<P>}</P>
<P>if( PnFColumn[i] == </FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1> && PnFColumn[i-</FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1>] != </FONT><FONT color=#ff00ff
size=1>1</FONT><FONT color=#000000 size=1> )</P>
<P>{</P>
<P>j++;</P>
<P>PFO[j] = PnFValue[i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>];</P>
<P>PFC[j] = PnFValue[i];</P>
<P>}</P>
<P>}</P>
<P>}</P>
<P>}</P></FONT><FONT color=#008000 size=1>
<P>// Shift chart to the right to eliminate trailing empty data</P>
<P>// - PF charts are generally smaller/shorter then the full stock charts
because they lack a time scale.</P></FONT><FONT color=#000000 size=1>
<P>delta = PnFValue.length - PFO.length;</P>
<P>for( i = PnFValue.length; i > delta; i-- )</P>
<P>{</P>
<P>PFO[ i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT color=#000000
size=1> ] = PFO[ i-delta-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>];</P>
<P>PFC[ i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT color=#000000
size=1> ] = PFC[ i-delta-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>];</P>
<P>}</P>
<P>for( i = </FONT><FONT color=#ff00ff size=1>0</FONT><FONT color=#000000
size=1>; i < delta; i++)</P>
<P>{</P>
<P>PFO[ i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT color=#000000
size=1> ] = </FONT><FONT color=#ff00ff size=1>0</FONT><FONT color=#000000
size=1>;</P>
<P>PFC[ i-</FONT><FONT color=#ff00ff size=1>1</FONT><FONT color=#000000
size=1> ] = </FONT><FONT color=#ff00ff size=1>0</FONT><FONT color=#000000
size=1>;</P>
<P>}</P>
<P>AFL.Var(</FONT><FONT color=#ff00ff size=1>"delta"</FONT><FONT
color=#000000 size=1>) = delta;</P>
<P>AFL.Var(</FONT><FONT color=#ff00ff size=1>"length"</FONT><FONT
color=#000000 size=1>) = PnFValue.length;</P>
<P>AFL.Var(</FONT><FONT color=#ff00ff size=1>"PFO"</FONT><FONT color=#000000
size=1>) = PFO;</P>
<P>AFL.Var(</FONT><FONT color=#ff00ff size=1>"PFC"</FONT><FONT color=#000000
size=1>) = PFC;</P>
<P>%></P><B>
<P>O</B> = PFO;</P><B>
<P>C</B> = PFC;</P><B>
<P>H</B> = (<B>O</B>+<B>C</B>)/</FONT><FONT color=#ff00ff
size=1>2</FONT><FONT color=#000000 size=1>;</P><B>
<P>L</B> = (<B>O</B>+<B>C</B>)/</FONT><FONT color=#ff00ff
size=1>2</FONT><FONT color=#000000 size=1>;</P><B>
<P>GraphXSpace</B> = </FONT><FONT color=#ff00ff size=1>9</FONT><FONT
color=#000000 size=1>;</P><B>
<P>Graph0Style</B> = </FONT><FONT color=#ff00ff size=1>64</FONT><FONT
color=#000000 size=1>;</P><B>
<P>Graph0Color</B> =</FONT><FONT color=#ff00ff size=1>1</FONT><FONT
color=#000000 size=1>;</P><B>
<P>Graph0</B> = <B>C</B>;</P><B>
<P>Filter</B>=<B>C</B>></FONT><FONT color=#ff00ff size=1>0</FONT><FONT
color=#000000 size=1>;</P></FONT><FONT color=#0000ff size=1>
<P>AddColumn</FONT><FONT color=#000000 size=1>(PFO,</FONT><FONT
color=#ff00ff size=1>"PFO"</FONT><FONT color=#000000
size=1>);</P></FONT><FONT color=#0000ff size=1>
<P>AddColumn</FONT><FONT color=#000000 size=1>(PFC,</FONT><FONT
color=#ff00ff size=1>"PFC"</FONT><FONT color=#000000
size=1>);</P></FONT></FONT></DIV>
<DIV><BR><BR></DIV>
<P><FONT size=2>-----Original Message-----<BR>From: mirat_dave [<A
href="mailto:mirat_dave@xxxx">mailto:mirat_dave@x...</A>]<BR>Sent:
Friday, July 19, 2002 10:00 AM<BR>To: amibroker@xxxxxxxxxxxxxxx<BR>Subject:
[amibroker] Re: Point & Figure Chart in AFL<BR><BR><BR>Hello Richard and
Dimitris,<BR><BR>Sorry to have caused so much confusion.<BR><BR>Since most
stocks since 2000 have been trending down, you may get a<BR>only a few bars
because the P&F Chart ignores small up moves and only<BR>extends down
bars when the price moves more than the box size. Since<BR>2000, you
may very well have only a few bars. Try loading more data<BR>for at
least one stock.<BR><BR>I used AmiQuote and Yahoo for the data. Ihave
data from January<BR>1994. The AmiBroker version on which I created
this file is 4.0.0 <BR>Apr 26 2002.<BR><BR>I do not know if the
AmiBroker version is causing the difference. I<BR>saw that it worked
for Richard on MSFT (although I am not sure what<BR>the whole MSFT v. MSFT
issue was - it seems to have resolved<BR>itself). Perhaps Richardalso
has more data loaded.<BR><BR>As you can see from the script, it is very
simple. If problems<BR>continue, I would be happy to go through it in
detail to see if there<BR>is a coding error.<BR><BR>I'm afraid I have no
other explanation other than more data. Let's<BR>try that
first.<BR><BR>Mirat<BR><BR>PS I would post .gifs of my charts butI do
not know how to attach a<BR>file to my reply. Although that wouldnot
help resolve the issue. :-)<BR><BR><BR><BR><BR><BR>--- In amibroker@xxxxx,
"Richard Alford" <richard.alford@xxxx> wrote:<BR>> I am just
isolating variables. If we have the same program and<BR>version
(4.06.1 Jun 19 build), the same indicator code (this I<BR>confirmed) and
same data we should get the same result. (I continue<BR>to believe in
deterministic computing - probably naive in light of<BR>Microsoft!).
The questionable variable, and a big one, is the data<BR>source - I use
qp2. Perhaps someone using yahoo could compare to<BR>your
results?<BR>><BR>><BR>> It does appear that the "box size", the
significant change that<BR>defines an X or O in my understanding, should be
normalized to the<BR>price of the instrument to account for the difference
in WCOME<BR>pricing vs. DJIA, for example. I am referring to the code
fragment:<BR>><BR>> // Calculate PF Chart Box size and minimum Reverse
values<BR>> // Box =
((tot[i]/(i+1))^.5)/7.3374; <BR>><BR>>
Cheers,<BR>><BR>> Richard<BR>> ----- Original Message
-----<BR>> From: dtsokakis<BR>> To:
amibroker@xxxx<BR>> Sent: Wednesday, July 17, 2002 2:49
PM<BR>> Subject: [amibroker] Re: Point & Figure Chart in
AFL<BR>><BR>><BR>> Richard,<BR>> YHOO
via Amiquote.<BR>> Why do you think it is a matter of data
provider ?<BR>> Dimitris Tsokakis<BR>><BR>>
--- In amibroker@xxxx, "Richard Alford"
<richard.alford@xxxx><BR>wrote:<BR>> > but the point
remains that you and I get different
results. <BR>what<BR>> is your data
source?<BR>> ><BR>> >
Richard<BR>> > ----- Original Message
-----<BR>> > From:
dtsokakis<BR>> > To:
amibroker@xxxx<BR>> > Sent: Wednesday, July
17, 2002 1:47 PM<BR>> > Subject: [amibroker]
Re: Point & Figure Chart in AFL<BR>>
><BR>> ><BR>> >
Richard,<BR>> > ANY other function works just
fine with my valuable Amibroker<BR>>
4.06.<BR>> > Just fine.<BR>>
> I can not see the reason for this P&F
script.<BR>> > Anyway, the author perhaps
could expain.<BR>> > Dimitris
Tsokakis<BR>> ><BR>> > ---
In amibroker@xxxx, "Richard Alford"
<richard.alford@xxxx><BR>> wrote:<BR>>
> > DT, I agree it was not easy to understand. The
attached<BR>charts<BR>> > showed the TWO
results that were generated whenever I entered<BR>the<BR>>
> symbol MSFT - it appears to be a fluke and I cannot
reproduce<BR>it<BR>> any<BR>> >
longer. Although there is not ticker name in the
formula,<BR>there<BR>> was<BR>>
> strange behavior occurring for MSFT and MSFT only at
that<BR>time.<BR>> > ><BR>>
> > The gist of my reply to you was that using the SAME
code as<BR>you<BR>> > posted and using the
code I copied from the files sections, I<BR>>
> generated the same results - and not the results that
you<BR>were<BR>> > creating. That
suggests that you have a problem in your data<BR>>
and/or<BR>> > setup. The only reason for
the two codes was to guarantee<BR>that<BR>>
there<BR>> > wasn't a subtle error - there was
not.<BR>> > ><BR>>
> > Sorry for adding the confusion about the MSFT fluke at
the<BR>same<BR>> > time.<BR>>
> ><BR>> > >
Cheers,<BR>> > ><BR>>
> > Richard<BR>> >
> ----- Original Message -----<BR>>
> > From: dtsokakis<BR>>
> > To: amibroker@xxxx<BR>>
> > Sent: Wednesday, July 17, 2002 12:47
AM<BR>> > > Subject:
[amibroker] Re: Point & Figure Chart in AFL<BR>>
> ><BR>> >
><BR>> > >
Richard,<BR>> > > It is not
easy to understand this<BR>> >
> "the plot for MSFT changes when one changes the symbol
go<BR>> MSFT<BR>> >
from<BR>> > > MSFT???
"<BR>> > > I copied the formula
from<BR>> > > <A
href="http://groups.yahoo.com/group/amibroker/files/Point-Figure"
target=_blank>http://groups.yahoo.com/group/amibroker/files/Point-Figure</A><BR>>
> > pasted in my Ind. builder and get the
posted gifs.<BR>> > > No ticker
name is into the formula.<BR>> >
> What is "the two MSFT " ???<BR>>
> > Do you use the same code from the above
address??<BR>> > >
DT<BR>> > ><BR>>
> ><BR>> > >
--- In amibroker@xxxx, "Richard
Alford"<BR><richard.alford@xxxx><BR>> >
wrote:<BR>> > > > Thoseare
not the figures I generate using the code in<BR>>
> the "files<BR>> >
> section". (Why wasn't this put in the AFL library is
a<BR>> question<BR>> >
in<BR>> > > my
mind???)<BR>> > >
><BR>> > > > Just noticed
that the plot for MSFT changes when one<BR>>
changes<BR>> > the<BR>>
> > symbol go MSFT from MSFT??? Notthe
case for AMZN or<BR>ORCL? <BR>> >
> ><BR>> > >
> I attached the two MSFT for comparison, one is
"my"<BR>copy,<BR>> and<BR>> >
the<BR>> > > other is a copy
and paste of the code in your note. The<BR>>
> difference<BR>> >
> is the quirk in MSFT, not an error in the code you
have<BR>used.<BR>> And<BR>> >
DT<BR>> > > do you really like
black on blue borders? Personally, I<BR>can<BR>>
> never<BR>> > >
read your chart titles.<BR>> >
> ><BR>> > >
> Cheers,<BR>> > >
><BR>> > > >
Richard<BR>> > >
><BR>> > >
><BR>> > > >
----- Original Message -----<BR>> >
> > From: Dimitris
Tsokakis<BR>> > >
> To: amibroker@xxxx<BR>> >
> > Sent: Tuesday, July 16, 2002 1:14
PM<BR>> > > >
Subject: [amibroker] Re: Point & Figure Chart in AFL<BR>>
> > ><BR>> >
> ><BR>> > >
> Mirat,<BR>> >
> > Here is P&F charts for AMZN, MSFTand
ORCL.<BR>> > > >
Data since Jan 2000.<BR>> > >
> Is it the expected picture ?<BR>>
> > > The code, copied from
files section<BR>> > >
><BR>> > > >
// PF Chart by Mirat Dave<BR>> >
> > // Copy and paste this as a custom
indicator.<BR>> > >
><BR>> > > >
EnableScript("jscript");<BR>> >
> > <%<BR>> >
> ><BR>> > >
> High = VBArray( AFL( "High" )
).toArray();<BR>> > >
> Low = VBArray( AFL( "Low" )
).toArray();<BR>> > >
><BR>> > > >
// Calculate running average stock price for use in<BR>>
> calculating<BR>> >
> the Box size.<BR>> >
> ><BR>> > >
> tot = new Array();<BR>> >
> > tot[0] = (High[0] +
Low[0])/2;<BR>> > >
> for( i=1; i < High.length; i++ )<BR>>
> > > {<BR>>
> > > tot[i] = tot[i-1] +
((High[i] + Low[i])/2);<BR>> >
> > }<BR>> >
> > PFO = new Array();<BR>>
> > > PFC = new
Array();<BR>> > >
><BR>> > > >
// initialize first element<BR>> >
> ><BR>> > >
> j = 0;<BR>> >
> > PFO[j] = High[0];<BR>>
> > > PFC[j] =
Low[0];<BR>> > >
> down = 1; // By default the first bar is a down
bar.<BR>> > >
><BR>> > > >
up = 0;<BR>> > >
> swap = 0;<BR>> >
> ><BR>> > >
> // perform the loop that produces PF
Chart<BR>> > >
><BR>> > > >
for( i = 1; i < High.length; i++ )<BR>> >
> > {<BR>> >
> > // Calculate PF Chart Box size and minimum
Reverse<BR>values<BR>> > >
><BR>> > > >
Box = ((tot[i]/(i+1))^.5)/7.3374;<BR>> >
> > Reverse = Box * 3;<BR>>
> > > if( Low[i] < PFC[j] -
Box && down)<BR>> > >
> {<BR>> > >
> PFC[j] = Low[i];<BR>> >
> > }<BR>> >
> > else<BR>> >
> > {<BR>> >
> > if( High[i] >= PFC[j] + Reverse
&& down)<BR>> > >
> {<BR>> > >
> j++;<BR>> > >
> swap = 1;<BR>> >
> > PFO[j] = Low[i];<BR>>
> > > PFC[j] =
High[i];<BR>> > >
> }<BR>> > >
> }<BR>> > >
> if( High[i] > PFC[j] + Box &&
up)<BR>> > > >
{<BR>> > > >
PFC[j] = High[i];<BR>> > >
> }<BR>> > >
> else<BR>> > >
> {<BR>> > >
> if( Low[i] <= PFC[j] - Reverse &&
up)<BR>> > > >
{<BR>> > > >
j++;<BR>> > > >
PFC[j] = Low[i];<BR>> > >
> PFO[j] = High[i];<BR>> >
> > swap = 1;<BR>>
> > > }<BR>>
> > > }<BR>>
> > > if( swap
)<BR>> > > >
{<BR>> > > >
swap = 0;<BR>> > >
> if( up )<BR>> >
> > {<BR>> >
> > up = 0;<BR>>
> > > down =
1;<BR>> > > >
}<BR>> > > >
else<BR>> > > >
{<BR>> > > > up
= 1;<BR>> > > >
down = 0;<BR>> > >
> }<BR>> > >
> }<BR>> > >
> }<BR>> > >
><BR>> > > >
// Shift chart to the right to eliminate
trailing<BR>empty<BR>> data<BR>>
> > > // - PF charts are
generally smaller/shorter then the<BR>>
full<BR>> > stock<BR>>
> > charts because they lack a time
scale.<BR>> > >
><BR>> > > >
delta = High.length - PFO.length;<BR>> >
> > for( i = High.length; i > delta;i--
)<BR>> > > >
{<BR>> > > >
PFO[ i-1 ] = PFO[ i-delta-1];<BR>> >
> > PFC[ i-1 ] = PFC[
i-delta-1];<BR>> > >
> }<BR>> > >
> for( i = 0; i < delta; i++)<BR>>
> > > {<BR>>
> > > PFO[ i-1 ] =
0;<BR>> > > >
PFC[ i-1 ] = 0;<BR>> > >
> }<BR>> > >
> AFL.Var("PFO") = PFO;<BR>> >
> > AFL.Var("PFC") = PFC;<BR>>
> > > %><BR>>
> > ><BR>> >
> > O = PFO;<BR>>
> > > C =
PFC;<BR>> > >
><BR>> > > >
H = (O+C)/2;<BR>> > >
> L = (O+C)/2;<BR>> >
> ><BR>> > >
> GraphXSpace = 9;<BR>> >
> > Graph0Style = 64;<BR>>
> > ><BR>> >
> > Graph0Color =1;<BR>>
> > > Graph0 =
C;<BR>> > >
><BR>> > > >
Thanks in advance for any reply.<BR>> >
> > Dimitris Tsokakis<BR>>
> > ><BR>> >
> > Yahoo!
Groups Sponsor<BR>> > >
><BR>> > >
> Click here to findyour
contact lenses!<BR>> > >
><BR>> > > >
Your use of Yahoo! Groups is subject to the
Yahoo!<BR>Terms<BR>> of<BR>> >
> Service.<BR>> >
><BR>> > ><BR>>
> > Yahoo!
Groups Sponsor<BR>> >
>
ADVERTISEMENT<BR>> >
> <BR>>
>
> <BR>>
> ><BR>> > >
Your use of Yahoo! Groups is subject to the Yahoo!
Terms<BR>of<BR>> >
Service.<BR>> ><BR>>
><BR>>
> Yahoo! Groups
Sponsor<BR>>
>
ADVERTISEMENT<BR>>
> <BR>>
> <BR>>
><BR>> > Your use of Yahoo! Groups is
subject to the Yahoo! Terms of<BR>>
Service.<BR>><BR>><BR>>
Yahoo! Groups
Sponsor<BR>>
ADVERTISEMENT<BR>> <BR>> <BR>><BR>>
Your use of Yahoo! Groups is subject to the Yahoo! Terms
of<BR>Service.<BR><BR><BR>------------------------ Yahoo! Groups Sponsor
---------------------~--><BR>Will You Find True Love?<BR>Will You Meet
the One?<BR>Free Love Reading by phone!<BR><A
href="http://us.click.yahoo.com/O3jeVD/R_ZEAA/Ey.GAA/GHeqlB/TM"
target=_blank>http://us.click.yahoo.com/O3jeVD/R_ZEAA/Ey.GAA/GHeqlB/TM</A><BR>---------------------------------------------------------------------~-><BR><BR><BR><BR>Your
use of Yahoo! Groups is subject to <A
href="http://docs.yahoo.com/info/terms/"
target=_blank>http://docs.yahoo.com/info/terms/</A><BR><BR><BR></FONT></P></BLOCKQUOTE><BR><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_0636_01C22F3D.3B493840--
Attachment:
Description: ""
Attachment:
Description: ""
|