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

RE: [amibroker] Observation on 3 days per bar plotting



PureBytes Links

Trading Reference Links

Hi Ken,

Neat code, thanks for sharing.

FWIW, I played with this concept some while ago and came up with my own
(less elegant way) of compressing 3 bars. I use a 'rolling' system so my
plot goes to the right hand edge. My values will coincide with your plot
every third day.

As an alternative, I am sure you will agree that Heikin-ashi plots are a
nice way to iron out the bumps in short term trends also.

Day1High = Max( H,Ref(H,-1));
Day2High = Max(Day1High, Ref(H,-2));
Day1Low = Min( L,Ref(L,-1));
Day2Low = Min(Day1Low, Ref(L,-2));

Day3Close = C;
Day3Open = Ref(O,-2);
Day3High = Max( Day1High,Day2High);
Day3Low = Min(Day1Low, Day2Low);
PlotOHLC( Day3Open, Day3High, Day3Low, Day3Close,"3 Day Candles ", colorRed,
styleCandle );
XSpace = Param("GraphXSpace",2,0,20,1);
GraphXSpace = XSpace;

Title = Name() + "\\C46 3 Day Candles " + EncodeColor(colorDarkGreen) + "
3DayOpen = " + Day3Open + 
EncodeColor(colorBlue) + " 3DayHigh = " + Day3High +
EncodeColor(colorOrange) + " 3DayLow = " + Day3Low + EncodeColor(colorRed) +
" 3DayClose = " + Day3Close + EncodeColor(colorDarkGreen) + " Dollar Traded
($K) = $" + int((Volume*Close)/1000);

Regards,

Gordon Sutherland


-----Original Message-----
From: Ken Close [mailto:closeks@xxxxxxxx] 
Sent: Tuesday, 12 October 2004 3:27 p.m.
To: AmiBroker List
Subject: [amibroker] Observation on 3 days per bar plotting


Well, I now have two different ways of showing 3 days per bar (or
point).  They are to use TimeFramCompress(C, 3*inDaily) or to use

x=Param("Days",3,2,5);
y=Cum(1)%x==0;
Ox=IIf(y,Ref(O,-(x-1)),Null);
Hx=IIf(y,HHV(H,x),Null);
Lx=IIf(y,LLV(L,x),Null);
Cx=IIf(y,C,Null);
Vx=Sum(V,x);
Change=100*(Cx-Ref(C,-x))/Ref(C,-x);
PlotOHLC(Ox,Hx,Lx,Cx,"",colorBlack,styleCandle);
GraphXSpace=3;

to plot candles----

What is interesting to observe, in comparison to a similar function in
TC2000 (wherein you select to show 3 day or x day charts), is that the
TC2000 internal algorithm works from the last (or current) day
backwards, while the Amibroker code starts at the beginning of the
datab     aseandworksitswayforward.

This is shown by looking at the close of the 3 day candle in TC2000 and
seeing today's price as the close price of the candle.

Looking at today's price of a three day per bar or line chart in
Amibroker shows either a null or yesterday's value.  This is the result
of working "forward" from the start of the database rather than
"backwards" from the current day's price.  Yesterday (Friday), the close
of the candle equaled the closing daily price but this is only true
every third day.

No big deal. I certainly could not program it to match how TC2000 works,
or do I know if it is even possible.  Dimitris could probably do it in
several lines of code.  But it is not so important. On second thought,
if one was writing a system off of this instead of visual
interpretation, this difference seems like it could influence crossing
points, etc and produce different and perhaps inferior results.

I have been interested in this because the 3 day per bar or some other
variation seems like it can show trends a little more clearly with less
delay than weekly and somewhat better than daily.  Don Worden of TC2000,
in his nightly notes, said that in today's choppy markets, he was
switching to 3 days/bar to more clearly spot trends.

Just thought I would share for your information----

Ken

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 10/8/2004
 




Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/