Point and figure chart

man4urheart

Well-Known Member
#31
IS there anybody who is really good at AFL can do it. A basic idea of code can be taken from this code which is based on Closing instead of High Low

SetBarsRequired(100000,100000);
//Set the Price limits for change of box values
c5 = 5;
c10 = 10;
c20 = 20;
c50 = 50;
c100 = 100;
c200 = 200;
c500 = 500;
c1000 = 1000;
c2000 = 2000;
c3000 = 3000;
c4000 = 4000;
c5000 = 5000;

//Set box values Bx for the price up to Cx
b5 = 0.1;
b10 = 0.2;
b20 = 0.25;
b50 = 0.5;
b100 = 1;
b200 = 2;
b500 = 5;
b1000 = 10;
b2000 = 20;
binfinity = 40;

//Number of boxes in each price range
nb5 = c5/b5;
nb10 = nb5 + (c10-c5)/b10;
nb20 = nb10 + (c20-c10)/b20;
nb50 = nb20 + (c50-c20)/b50;
nb100 = nb50 + (c100-c50)/b100;
nb200 = nb100 + (c200-c100)/b200;
nb500 = nb200 + (c500-c200)/b500;
nb1000 = nb500 + (c1000-c500)/b1000;
nb2000 = nb1000 + (c2000-c1000)/b2000;
nb3000 = nb2000 + (c3000 - c2000)/binfinity;
nb4000 = nb3000 + (c4000 - c3000)/binfinity;
nb4000 = nb4000 + (c5000 - c4000)/binfinity;

//define box values for each price zone
box = IIf(C<=c5,b5,
IIf(C>c5 AND C<=c10, b10,
IIf(C>c10 AND C<=c20, b20,
IIf(C>c20 AND C<=c50, b50,
IIf(C>c50 AND C<=c100, b100,
IIf(C>c100 AND C<=c200, b200,
IIf(C>c200 AND C<=c500, b500,
IIf(C>c500 AND C<=c1000, b1000,
IIf(C>c1000 AND C<=c2000, b2000,
binfinity )))))))));

//Round the Close data into box equivalents
CF = ceil(C/box)*box;
CR = floor(C/box)*box;

//Rising chart values
CRB = IIf(CR<=c5, 0 + CR/b5,
IIf(CR>c5 AND CR<=c10, nb5+(CR-c5)/b10,
IIf(CR>c10 AND CR<=c20, nb10+(CR-c10)/b20,
IIf(CR>c20 AND CR<=c50, nb20+(CR-c20)/b50,
IIf(CR>c50 AND CR<=c100, nb50+(CR-c50)/b100,
IIf(CR>c100 AND CR<=c200, nb100+(CR-c100)/b200,
IIf(CR>c200 AND CR<=c500, nb200+(CR-c200)/b500,
IIf(CR>c500 AND CR<=c1000, nb500+(CR-c500)/b1000,
IIf(CR>c1000 AND CR<=c2000, nb1000+(CR-c1000)/b2000,
nb2000+(CR-c2000)/binfinity
)))))))));

//Falling chart values
CFB = IIf(CF<=c5, 0 + CF/b5,
IIf(CF>c5 AND CF<=c10, nb5+(CF-c5)/b10,
IIf(CF>c10 AND CF<=c20, nb10+(CF-c10)/b20,
IIf(CF>c20 AND CF<=c50, nb20+(CF-c20)/b50,
IIf(CF>c50 AND CF<=c100, nb50+(CF-c50)/b100,
IIf(CF>c100 AND CF<=c200, nb100+(CF-c100)/b200,
IIf(CF>c200 AND CF<=c500, nb200+(CF-c200)/b500,
IIf(CF>c500 AND CF<=c1000, nb500+(CF-c500)/b1000,
IIf(CF>c1000 AND CF<=c2000, nb1000+(CF-c1000)/b2000,
nb2000+(CF-c2000)/binfinity
)))))))));

//Jscript to produce the P&F chart
EnableScript("jscript");
<%

Close = VBArray( AFL( "Close" ) ).toArray();
CRB = VBArray( AFL( "CRB" ) ).toArray();
CFB = VBArray( AFL( "CFB" ) ).toArray();

PFO = new Array();
PFC = new Array();

Reverse = 3 ; // reversal requirement

// initialize first element
j = 0;
PFC[j] = CFB[0];
PFO[j] = CFB[0]+1;
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 < Close.length; i++ )
{

if( CFB <= PFC[j]-1 && down) //continue down
{
PFC[j] = CFB;
PFO[j] = CFB+1;
}
else
{
if( CRB >= PFC[j] + Reverse && down) //Change direction to up
{
j++;
swap = 1;
PFC[j] = CRB;
PFO[j] = CRB - 1;
}
}
if( CRB >= PFC[j] + 1 && up) //Continue up
{
PFC[j] = CRB;
PFO[j] = CRB - 1;
}
else
{
if( CFB <= PFC[j] - Reverse && up) //Change direction to down
{
j++;
PFC[j] = CRB;
PFO[j] = CRB+1;
swap = 1;
}
}
if( swap )
{
swap = 0;
if( up )
{
up = 0;
down = 1;
}
else
{
up = 1;
down = 0;
}
}
}
delta = Close.length - j-1;

AFL.Var("PFO") = PFO;
AFL.Var("PFC") = PFC;
AFL.Var("delta") = delta;
AFL.Var("Reverse") = Reverse;
AFL.Var("j") = j;

%>

PFO = Ref( PFO, -delta );
PFC = Ref( PFC, -delta );

// High-Low range sets the height of the P&F bar
H = IIf(Ref(PFC,-1)>Ref(PFO,-1),Ref(HHV(PFC,1),-1)-1,Max(PFO,PFC));
L = IIf(Ref(PFC,-1)<Ref(PFO,-1),Ref(LLV(PFC,1),-1)+1,Min(PFO,PFC));
O = IIf(Ref(PFC,-1)>Ref(PFO,-1),Ref(HHV(PFC,1),-1)-1,IIf(Ref(PFC,-1)<Ref(PFO,-1),Ref(LLV(PFC,1),-1)+
1,PFO));

// the difference between Open AND Close should be set to box size
// the sign decides if X or O are plotted
C = O + 1 * IIf( PFC > PFO, 1,-1);

Full formula can be accessed at
http://www.amibroker.com/library/formula.php?id=257
 
#32
The posts by BVP and others are nearly one and half years old. I donot know how far my posts will help. If some newbie reads these posts and if he is interested in PnF charting and trading, I think these points may help.

When compared to Amibroker, slightly visually better PnF chart can be obtained in Metastock. Only visually better chart and not for any practical purpose. The formulas written by Graham Kavanagh (links to which have been provided by BVP), though displayes PnF charts they are not useful for making analysis. Basic point in PnF chart is the box itself. They must be perfect square boxes. Both Amibroker and Metastock do not plot in perfect square boxes. When that itself is not there, there is no point in relying on the chart displayed by these softwares. If you are having FCharts paid version, see how chart is dispayed there. Iam attaching a screenshot taken from FCharts full version (i.e. paid version) just to show how these boxes should be drawn. See the image below.



But FCharts has its own limitation. You cannot adjust box sizes. What I mean to say is that right from Rs. 1/- to Rs. 10000/- or whatever it may be, you will have same standard size box. If you draw chart like that, it will be horribly wrong. You will have to adjust box size depending upon the price. Further in FCharts you cannot use hi-lo data. F Charts uses close data only. You cannot draw trendlines. You cannot draw percentage boxes. If you try to plot a chart as per Wyckoff method (i.e. one box reversal), you will not get the desired chart. Practically you cannot do anything. If you are seriously considering using PnF charts, then you will have to purchase Bulls Eye Broker. Mind you, even Bulls Eye Broker will be helpful only in EOD charts and for swing trading and not for Real Time charting or day trading analysis.
without proper box size
you will not get best result - box size is 2 for every 100.

sushil
 
#33
[ In point & figure chart box size is most important , software that allows you to adjust the box size can give you the best result, most afl written on basis ATR , which automatically adjust the box size ,thats why calculation is not perfect. i am trying to edit AFL by Graham Kavanagh 17 Apr 2004 .



sushil
 

RSI

Well-Known Member
#35

without proper box size
you will not get best result - box size is 2 for every 100.

sushil
Sushil,

That is what exactly I was saying in that post. There is no substitute for Bulls Eye Broker. If you want perfect point and figure chart, you will have to purchase a software that is just dedicated to that purpose. Bulls Eye Broker was the perfect one. But the sad news is that they have stopped selling it and they are closing the business.
 
#36
Sushil,

That is what exactly I was saying in that post. There is no substitute for Bulls Eye Broker. If you want perfect point and figure chart, you will have to purchase a software that is just dedicated to that purpose. Bulls Eye Broker was the perfect one. But the sad news is that they have stopped selling it and they are closing the business.
rsi ,

better try amibroker

sushil
 

RSI

Well-Known Member
#37
rsi ,

better try amibroker

sushil
No. I have Bulls Eye Broker. I posted here after trying point and figure charts with Metastock, Fibotrader, Amibroker, FCharts Pro, TradeGuider, QuoteTracker and a few other softwares whose names I donot remember. For free pnf charts you can try stock charts, but I am not satisfied with it. After having Bulls Eye Broker, I am not trying to view point and figure charts in any other software.
 
#38
No. I have Bulls Eye Broker. I posted here after trying point and figure charts with Metastock, Fibotrader, Amibroker, FCharts Pro, TradeGuider, QuoteTracker and a few other softwares whose names I donot remember. For free pnf charts you can try stock charts, but I am not satisfied with it. After having Bulls Eye Broker, I am not trying to view point and figure charts in any other software


can you tell me the difference between metastock & bulls eye


sushil
 

RSI

Well-Known Member
#39
can you tell me the difference between metastock & bulls eye


sushil
You cannot adjust box size in Metastock. What I am trying to say is that right from Rs. 1/- to Rs.1000/-, box size will be the same. Box size has to be adjusted depending upon the price. Otherwise, as I was saying in my earlier posts, pnf charts will be useless for trading purpose. Bulls Eye Broker does it automatically. Adjustment of box size is one of the major problems with all these charting softwares other than Bulls Eye Broker.

You cannot have Wyckoff reversal in any other software other than Bulls Eye Broker. You cannot have relative strength chart in any other software other than Bulls Eye Broker. If you do not have these things, which are some of the most important features of PnF charting, the software is useless for trading or for analysis.

I would suggest you to get hold of one or two good books on pnf charting. You will understand what I am saying.
 
#40
You cannot adjust box size in Metastock. What I am trying to say is that right from Rs. 1/- to Rs.1000/-, box size will be the same. Box size has to be adjusted depending upon the price. Otherwise, as I was saying in my earlier posts, pnf charts will be useless for trading purpose. Bulls Eye Broker does it automatically. Adjustment of box size is one of the major problems with all these charting softwares other than Bulls Eye Broker.

You cannot have Wyckoff reversal in any other software other than Bulls Eye Broker. You cannot have relative strength chart in any other software other than Bulls Eye Broker. If you do not have these things, which are some of the most important features of PnF charting, the software is useless for trading or for analysis.

I would suggest you to get hold of one or two good books on pnf charting. You will understand what I am saying.
i have an indicator ( PnF VALUE ) that lets you to adjust box size in mata stock , and also edited ( Graham Kavanagh 17 Apr 2004 ) AFL for amibroker .
 

Similar threads