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

[amibroker] Re: How to code sequential events ?



PureBytes Links

Trading Reference Links




Process each independently, then determine which 
occured first
 
Cond1 = ...
Cond2 = ...
 
Cond1_Bar = 
valuewhen(Cond1,BarIndex(),1);
Cond2_Bar = 
valuewhen(Cond2,BarIndex(),1);
 
Compare Cond1_Bar and Cond2_Bar . Smaller value 
comes first
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  gty182 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Monday, April 05, 2004 1:26 
PM
  Subject: [amibroker] How to code 
  sequential events ?
  
  Hello,
   
  I 've tried everything method I know (maybe I 
  just don't know much ;-) ) and still don't know how to code 
  this:
   
  I got 2 events , one after other. I want to know 
  wheather (<FONT 
  color=#0000ff>Cross(Oo,L)  occurs 
  after Cross(H,DSu) 
  ( Oo and DSu are some levels defined 
  before ) and they both take place same day. So I've  made something like 
  this:
   
  CondS=( Cross<FONT 
  size=1>(H,DSu)*TimeNum<FONT 
  size=1>() < 
  (Cross<FONT 
  size=1>(Oo,L)*TimeNum<FONT 
  size=1>() ) AND ( Cross<FONT 
  size=1>(H,DSu)*DateNum<FONT 
  size=1>() == Cross<FONT 
  size=1>(Oo,L)*DateNum<FONT 
  size=1>() ) ; 
   
  But it won't work of course (it 
  checks just one bar, right ? ) I think i'd have to use some kind of array to 
  "scan" whole day and check there weather second even takes place after the 
  other one (it doesn't matter if second one occurs before first one, it's just 
  importenad if it happens AFTER it) But I'm not really sure how to do it and 
  where to start.
   
  Maybe there is some simple solution 
  I can't see or something ? 
   
  thanks,
   
  gtySend 
  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 
  


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








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 the Yahoo! Terms of Service.