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

RE: [amibroker] Hold cond1 true then buy when cond2 happens



PureBytes Links

Trading Reference Links




I am going to code an exploration that 
 looks back over the last 25 daily bars to see if an Array condition has 
been met on ALL of the last 25 bars.   If it fails to find that 
ALL of the last 25 bars are true, it will then look for 24 true bars, then 
23 true bars, and so on till it finally quits looking at about 10 bars 
back.  I can code this  with lots of repititons of coding, 
but I would like to find a more elegant way to code it.  
 
I was unable to divise a way to do this with Sum() or 
Cum().  Is there any other simple way to code this? 
 
If loops is the way to go, then I would sure appreciate 
seeing this coded with loops.  I learn best by seeing a working example of 
something that I am attempting to do.  TIA  Ron 
D 
 
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  johsun 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, February 18, 2004 11:42 
  AM
  Subject: [amibroker] Re: IsNotThere(Array 
  or Ref(Array,-1) or Ref(Array,-1) or
  cond=Your conditionx=Sum(cond,4)>=1;this will 
  return True if cond has occurred in the last four days including today. Is 
  that what you wanted?JS--- In <A 
  href="">amibroker@xxxxxxxxxxxxxxx, 
  "mrdavis9" <mrdavis9@x...> 
  wrote:> Below is coding that allows the  Seq10e2up2e10 OR 
  SeqR14toR14e15 conditions to have occurred upto three days before the 
  RSIEMA2cross occurs.  Is there a lot more elegant and simple way to 
  do this?> > An  IsNotThere(Array) would do what I 
  want.  Is there one that I missed that can be made to work.  I 
  still have not been able to grasp doing loops.  If looping is a good 
  way to do this, I would sure appreciate seeing the below IIF coding made 
  into a looping function.  Then, by knowing what it is designed to do, 
  I should be able to finally understand how looping works.  Ron 
  D> > Day3a=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-3),1,0);> > Day3=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-3),1,0);> > Day2a=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-1),1,day3a);> > Day2=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-2),Day3,0);> > Day1a=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-1),Day2,Day2a);> > Day1=IIf(Ref(Seq10e2up2e10 OR 
  SeqR14toR14e15,-1),Day2,0);> > Day0a=IIf(Seq10e2up2e10 OR 
  SeqR14toR14e15,Day1,Day1a);> > 
  Day0=IIf(RSIEMA2cross,Day0a,0);Send BUG REPORTS to <A 
  href="">bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  <A 
  href="">suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: <A 
  href="">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 
  Yahoo! Groups Links<*> To visit your group on the web, go 
  to:     <A 
  href="">http://groups.yahoo.com/group/amibroker/<*> 
  To unsubscribe from this group, send an email to:     
  <A 
  href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx<*> 
  Your use of Yahoo! Groups is subject to:     <A 
  href="">http://docs.yahoo.com/info/terms/


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.