PureBytes Links
Trading Reference Links
|
I'm looking for a way to access point and figure signals
from a standard bar chart. Basically I just need to know
if the current direction is in an up or down column. If
price remains between $20 and 100 I'm ok but I haven't
worked out the part outside that range yet. Perhaps a
factor can be applied to the intPortion function? The
following code plots a line that mimics the last p+f value
but needs something to allow for less than $20 and greater
than $100 prices. All suggestions for how to compensate
for this problem will be appreciated.
{145 P+F v0.01}
var: pfDir(1), pfPrice(0), box(0);
if c>20 then box=1;
if c>100 then box=2;
if c<20 then box=.5;
if c<5 then box=.25;
if pfDir>0 and H>=pfPrice+box then
pfPrice=pfPrice+intPortion((H-pfPrice)/box)*box;
if pfDir<0 and L<=pfPrice-box then
pfPrice=pfPrice-intPortion((pfPrice-L)/box)*box;
if pfPrice=pfPrice[1] and pfDir>0 and L<=pfPrice-3*box then begin
pfDir= -1;
pfPrice=pfPrice-intPortion((pfPrice-L)/box)*box;
end;
if pfPrice=pfPrice[1] and pfDir<0 and H>=pfPrice+3*box then begin
pfDir=1;
pfPrice=pfPrice+intPortion((H-pfPrice)/box)*box;
end;
plot1(pfPrice,"pfPrice");
|