[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Point & Figure Chart in AFL



PureBytes Links

Trading Reference Links

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.