PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Herman,
I use
OHLC composites all the time. As an example I run the following code
against a watch list to update my sector indexes
<FONT face=Arial color=#0000ff
size=2>
//creates index by sector
isym=<FONT
color=#0000ff>"~i"+<FONT
size=2>SectorID(<FONT
size=2>1<FONT face=Arial
color=#0000ff>);
AddToComposite<FONT
color=#282828 size=2>(C<FONT
face=Arial>,isym,<FONT color=#ff00ff
size=2>"C"<FONT
face=Arial>);
AddToComposite<FONT
color=#282828 size=2>(O<FONT
face=Arial>,isym,<FONT color=#ff00ff
size=2>"O"<FONT
face=Arial>);
AddToComposite<FONT
color=#282828 size=2>(H<FONT
face=Arial>,isym,<FONT color=#ff00ff
size=2>"H"<FONT
face=Arial>);
AddToComposite<FONT
color=#282828 size=2>(L<FONT
face=Arial>,isym,<FONT color=#ff00ff
size=2>"L"<FONT
face=Arial>);
AddToComposite<FONT
color=#282828 size=2>(1<FONT
color=#282828 size=2>,isym,<FONT color=#ff00ff
size=2>"V"<FONT
face=Arial>); <FONT
face=Arial>//counts the sextor components
<SPAN
class=485135623-09122003>
<FONT face=Arial
size=2>Why do you feel the High and low data is inaccuate? To average I plot
PlotOHLC<FONT
face=Arial>(<FONT
color=#000000>O<FONT
color=#282828>/V<FONT
face=Arial>,<FONT
color=#000000>H<FONT
color=#282828>/V<FONT
face=Arial>,<FONT
color=#000000>L<FONT
color=#282828>/V<FONT
face=Arial>,<FONT
color=#000000>C<FONT
color=#282828>/V<FONT
face=Arial>," Sector"<FONT
color=#282828>,colorWhite<FONT
face=Arial>,64<FONT
color=#282828>);
<FONT face=Arial
color=#0000ff size=2>Perhaps I do not understand your
question....
Regards,
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: Herman vandenBergen
[mailto:psytek@xxxxxxxx]Sent: Tuesday, December 09, 2003 6:27
PMTo: AmiBrokerSubject: [amibroker] Introducing
OHLC-Composites
Most composites
display just one variable or, if they use more, they are usually
independent variables. This means that generally speaking composites do not
carry enough information to apply standard OHLC technical
analysis, like RSI, CMO, SAR, etc. to them.
<SPAN
class=120583612-09122003>
If we could make our
Composites embody all four price arrays (OHLC), in an accurate
representation of the market they represent, then they would be much more
useful. If you have played with this type of formulas you will know that you
cannot simply create four separate OHLC composites and use these
prices in a standard OHLC bar; the resulting price bar is usually distorted to
the point it becomes useless.
<SPAN
class=120583612-09122003>
Below you'll find
one way to create OHLC-Composites. While the Open and Close probably
accurately represent the market, the High and the Low appear to have lost
their significant information (they don't change much). What is needed is a
better way to calculate the OHLC-Composite's High and Low price.
<SPAN
class=120583612-09122003>
Any constructive
help from our resident Composite-Wizards to help make the
OHLC-Composite more meaningful will be much appreciated!
<SPAN
class=120583612-09122003>
<SPAN
class=120583612-09122003>herman
<SPAN
class=120583612-09122003>
<IMG alt="" hspace=0
src="jpg00379.jpg" align=baseline border=0>
<SPAN
class=120583612-09122003>
<SPAN
class=120583612-09122003>
//
Experimenting with OHLC-Composites - Herman - 09DEC2003<FONT
size=2> <FONT
color=#000000>// Step 1: Run Scan #1 All-Quotation Scan on your
Watchlist<FONT
color=#000000> // Step 2: Run Scan #2 on a
Single stock<FONT
color=#000000> // Step 3: Run OldBacktester on
a Single stock, Click Equity or<FONT
face=Arial> // select
CandleComp in your Workspace and display in Candle
format<FONT
color=#000000> Buy<FONT
color=#000000>=Sell<FONT
color=#000000>=Short<FONT
color=#000000>=Cover<FONT
color=#000000>=0<FONT
size=2>; <FONT
color=#000000>// Scan #1 on your watchlist<FONT
size=2> Bo = <FONT
color=#ff0000>O; <FONT
color=#000000>// Open price is used as
reference<FONT
color=#000000> Bh = H<FONT
color=#000000>/O<FONT
color=#000000>; // HLC are
averaged as their ratio to the Open price<FONT
size=2> Bl = <FONT
color=#ff0000>L/<FONT
color=#ff0000>O<FONT
color=#000000>; Bc = C<FONT
color=#000000>/O<FONT
size=2>; <FONT
color=#0000ff>AddToComposite(Bo,<FONT
color=#ff00ff>"~Bo",<FONT
color=#ff00ff>"X"<FONT
color=#000000>); AddToComposite<FONT
color=#000000>(Bh,"~Bh"<FONT
color=#000000>,"X"<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(Bl,<FONT
color=#ff00ff>"~Bl",<FONT
color=#ff00ff>"X"<FONT
color=#000000>); AddToComposite<FONT
color=#000000>(Bc,"~Bc"<FONT
color=#000000>,"X"<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(<FONT
color=#ff00ff>1,<FONT
color=#ff00ff>"~Bcount",<FONT
color=#ff00ff>"X"<FONT
color=#000000>); // Scan #2 on one single
stock!<FONT
color=#000000> n = Foreign<FONT
color=#000000>("~Bcount"<FONT
color=#000000>,"X"<FONT
size=2>); Ot = <FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~Bo",<FONT
color=#ff00ff>"X"<FONT
color=#000000>)/n; Ht = Ot*Foreign<FONT
color=#000000>("~Bh"<FONT
color=#000000>,"X")/n;
// Reconstruct HLC wrt average
Open
Lt = Ot*Foreign<FONT
color=#000000>("~Bl"<FONT
color=#000000>,"X"<FONT
size=2>)/n; Ct = Ot*<FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~Bc",<FONT
color=#ff00ff>"X"<FONT
color=#000000>)/n; AddToComposite<FONT
color=#000000>(Ot,"~CandleComp"<FONT
color=#000000>,"O"<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(Ht,<FONT
color=#ff00ff>"~CandleComp",<FONT
color=#ff00ff>"H"<FONT
color=#000000>); AddToComposite<FONT
color=#000000>(Lt,"~CandleComp"<FONT
color=#000000>,"L"<FONT
size=2>); <FONT
color=#0000ff>AddToComposite(Ct,<FONT
color=#ff00ff>"~CandleComp",<FONT
color=#ff00ff>"C"<FONT
color=#000000>); // Indicator, from
OldBacktester or Indicator window<FONT
face=Arial> n = <FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~Bcount",<FONT
color=#ff00ff>"X"<FONT
color=#000000>); Ot = Foreign<FONT
color=#000000>("~Bo"<FONT
color=#000000>,"X"<FONT
size=2>)/n; Ht = Ot*<FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~Bh",<FONT
color=#ff00ff>"X")/n; <FONT
color=#000000>// Reconstruct HLC wrt average
Open
Lt = Ot*Foreign<FONT
color=#000000>("~Bl"<FONT
color=#000000>,"X"<FONT
size=2>)/n; Ct = Ot*<FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~Bc",<FONT
color=#ff00ff>"X"<FONT
color=#000000>)/n; PlotOHLC<FONT
color=#000000>(Ot,Ht,Lt,Ct,"OHLC-Composite Candle
Chart",1<FONT
color=#000000>,<FONT
color=#ff0000>styleCandle<FONT
face=Arial>); <FONT
color=#ff0000>Title = <FONT
color=#0000ff>EncodeColor(<FONT
color=#ff0000>colorWhite)+<FONT
color=#ff00ff>"N100 OHLC-Composite Candle Chart"<FONT
size=2>; <FONT
color=#ff0000>GraphXSpace = <FONT
color=#ff00ff>5
<SPAN
class=120583612-09122003>
<SPAN
class=120583612-09122003> Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Attachment:
Description: ""
|