PureBytes Links
Trading Reference Links
|
this is probably in the archives. i'm not sure who created this, but credit
goes to them--not me,
ron
//////////begin/////////
box1=0;
box2=0;
procedure fillDarvas(start,end,swap,top, bottom )
{
for ( j = start; j < end; j++)
{
if( box1[j] = swap)
box1[j]= top ;
else
box1[j]= bottom;
if(box2[j] = swap)
box2[j]= bottom ;
else
box2[j]= top;
}
}
BoxArr1 = 0;
BoxArr2 = 0;
StateArray = 0;
DBuy = 0;
DSell = 0;
TopArray = 0;
BotArray = 0;
tick=0;
BoxTop = High[0];
BoxBot = Low[0];
swap=0;
state = 0;
BoxStart = 0;
for (i=0; i<BarCount; i++)
{
if (state==5)
{
TopArray[i]=BoxTop;
BotArray[i]=BoxBot;
if (Low[i]<(BoxBot*(1-tick/100)) || High[i]>(BoxTop*(1+tick/100)))
{
fillDarvas(BoxStart,i,swap,BoxTop,BoxBot);
state = 1;
swap = !swap;
BoxTop = High[i];
BoxStart = i;
}
}
else
{
if (High[i]<BoxTop)
{
if ((state<3) || (Low[i]>BoxBot))
{
state++;
}
else
{
state=3;
}
if (state==3)
BoxBot=Low[i];
}
else
{
state=1;
BoxTop=High[i];
}
}
StateArray[i] = state;
}
fillDarvas(BoxStart,BarCount,swap,BoxTop,BoxBot);
Plot(C,"",1,64);
//Plot( box1, "" , colorRed, styleLine );
//Plot( box2, "" , colorGreen , styleLine );
Plot( box1, "" , colorRed, 512);
Plot( box2, "" , colorGreen , 512);
///////////end///////////////////
-----Original Message-----
From: dsov2002 [mailto:dsov@xxxxxxxxx]
Sent: Friday, September 10, 2004 6:24 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Darvas Box
Just wondering whether anyone out there has attempted to implement
Darvas Box into AmiBroker?
This feature has recently been in most of the well-known trading
software.
I have tried to search for it in AmiBroker related websites but don't
seem to find anything on it.
Thanks,
David
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 9/10/2004
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/
|