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

[amibroker] VALUEWHEN IGNORES ME



PureBytes Links

Trading Reference Links




Below I have copied a SCAN  that 
is designed to place a buy arrow when  
Cross(stochk(100),stochd(100)) occurs.  However, before  a buy 
arrow is allowed to be  placed, two prior conditions must be 
satisfied.  
 
Condition#1 is what I have coded as a 
"LOOKBACK2".  It is a question regarding the value of 
stochk(100) associated with the most recent occurrence 
of  Cross(stochk(100),stochd(100)).  This "LOOKBACK2"  says 
that the value of stochk(100) must be at a LOWER value when this LOOKBACK2 
occurrs when  compared to the CURRENT value of stochk(100) that 
accompanies this newly discovered Cross(stochk(100),stochd(100)) .
 
Condition#2 is what I have coded as 
"LOOKBACK3".  It is a question that examines the value of 
stochk(100) associated with  LOOKBACK2 that I have referred to as 
 Condition#1.   This"LOOKBACK3"  says that 
the LOOKBACK3 value of stochk(100) must be at a HIGHER 
 value than it was when LOOKBACK2 happened. 
 
The problem is that my scans seem to be completely 
ignoring these two preconditions.  I really thought that I fully understand 
how to use Valuewhen(     , but I must not, because this 
scan is ignoring my instructions.  I ran this scan with each of the 
Buy=conditions separately, and both scans totally ignored my LOOKBACK 
requirements.  
 
All help will be appreciated.  Ron D
 
============================================
Filter=C>1<FONT 
size=4> AND C<100<FONT 
size=4> AND MA<FONT 
size=4>(V,50<FONT 
size=4>)>100000;
arrayk=<FONT 
face="Bookman Old Style" color=#0000ff size=4>StochK<FONT 
face="Bookman Old Style" size=4>(<FONT face="Bookman Old Style" 
color=#ff00ff size=4>100<FONT face="Bookman Old Style" 
size=4>);
arrayd=<FONT face="Bookman Old Style" color=#0000ff 
size=4>StochD(<FONT 
face="Bookman Old Style" color=#ff00ff size=4>100<FONT 
face="Bookman Old Style" size=4>);
kdcross=<FONT face="Bookman Old Style" color=#0000ff 
size=4>Cross<FONT face="Bookman Old Style" 
size=4>(arrayk,arrayd);
Lookback2=ValueWhen<FONT 
size=4>(kdcross,arrayk,<FONT face="Bookman Old Style" color=#ff00ff 
size=4>2);
Lookback3=ValueWhen<FONT 
size=4>(kdcross,arrayk,<FONT face="Bookman Old Style" color=#ff00ff 
size=4>3);
Lookback4=ValueWhen<FONT 
size=4>(kdcross,arrayk,4<FONT 
size=4>);
Lookback5=ValueWhen<FONT 
size=4>(kdcross,arrayk,5<FONT 
size=4>);
Lookback6=ValueWhen<FONT 
size=4>(kdcross,arrayk,6<FONT 
size=4>);
test3=IIf<FONT 
size=4>(Lookback3<Lookback4,<FONT face="Bookman Old Style" 
color=#ff00ff size=4>1,<FONT face="Bookman Old Style" 
color=#ff00ff size=4>0);
test2=IIf<FONT 
size=4>(Lookback2<Lookback3,<FONT face="Bookman Old Style" 
color=#ff00ff size=4>1,<FONT face="Bookman Old Style" 
color=#ff00ff size=4>0);
test1=IIf(<FONT 
face="Bookman Old Style" size=4>arrayk<FONT 
size=4>>Lookback2,test2,<FONT face="Bookman Old Style" color=#ff00ff 
size=4>0);
testo=IIf<FONT 
size=4>(kdcross,test1,0<FONT 
size=4>);
Buy=Filter AND testo;
Buy=Filter AND <FONT face="Bookman Old Style" 
size=4>kdcross AND Lookback2<arrayk AND Lookback3>Lookback2 
;
---Outgoing mail is certified 
Virus Free.Checked by AVG anti-virus system (<A 
href="">http://www.grisoft.com).Version: 6.0.530 / 
Virus Database: 325 - Release Date: 
10/25/2003






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.