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

[amibroker] Introducing OHLC-Composites



PureBytes Links

Trading Reference Links




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="jpg00378.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> 






Yahoo! Groups Sponsor












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: ""