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

Darvas system



PureBytes Links

Trading Reference Links



Hi TJ and others 
I dont know if anyone has has worked on the darvas 
boxes, ? 
the following code finds the first 2 phases 

phase 1.  stock trading at hi 130 days in 
this case.
phase 2. 3 consecutive days higher.
phase 3. ?  needs to be 3 consecutive days 
lower to form the box bottom once the 1 st 2 rules are meet ..
there is a 4 phase/rule if the cond2 and 3 don't 
occur within 20 days start again ..( but that's easy by eye fro now)
Thanks David
 
 
 
 
/* Darvas with alltime high
Use the following formula to find the all-time highest and display its value 
and date:***/
/******** set range in AA to period that suits 130 days = 6 
mths**************/
alltimehigh = LastValue<FONT 
size=1>( Highest( 
High ) );
alltimehighbar = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Cum(1<FONT 
size=1>) );
alltimeyear = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Year() );
alltimemonth = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Month() );
alltimeday = ValueWhen( 
High == alltimehigh, Day<FONT 
size=1>() );
"All time highest was " + <FONT color=#0000ff 
size=1>WriteVal( alltimehigh );<FONT 
color=#ff00ff size=1>
"on the " + <FONT color=#0000ff 
size=1>WriteVal( alltimeyear, <FONT color=#ff00ff 
size=1>1 ) + <FONT color=#ff00ff 
size=1>"." + <FONT color=#0000ff 
size=1>WriteVal( alltimemonth, <FONT color=#ff00ff 
size=1>1 ) + <FONT color=#ff00ff 
size=1>"." + <FONT color=#0000ff 
size=1>WriteVal( alltimeday, <FONT color=#ff00ff 
size=1>1 );
/* Draw also a buy arrow on highest day */<FONT face="Courier New" 
size=1>
cond1 = High == 
alltimehigh and V > <FONT color=#ff00ff 
size=1>5000;
cond2= O <C and
Ref(Open<C,-<FONT color=#ff00ff 
size=1>1) and
Ref(Open<C,-<FONT color=#ff00ff 
size=1>2) ; 
Buy = Cond1 and Cond2;