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

Re: [amibroker] Re: lower highs, lower lows



PureBytes Links

Trading Reference Links




You do that in whatever other command line you use to invoke the action. In 
Graham's case, he uses CountRise and CountFall. If you were using it in a Buy 
statement, your code would be: Buy=Rise; If rise were false, you wouldn't buy. 
If it were true, you would buy. 
 
Al
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  dom1_1998 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, July 17, 2003 10:04 
  PM
  Subject: [amibroker] Re: lower highs, 
  lower lows
  I'm really not the one qualified to answer this but how are 
  you goingto tell it to do X if it's true or Y if it 
  isn't?Dominick--- In <A 
  href="">amibroker@xxxxxxxxxxxxxxx, "Al 
  Venosa" <advenosa@x...> wrote:> 
  MessageGraham:> > I've noticed you and lots of other folks on 
  this board seeminglyunnecessarily use the iif statement a lot, as in your 
  Rise and Fallcode lines below. Yet, isn't it just as correct and less code 
  (i.e.,more efficient) to simply write:> > Rise = 
  H>Ref(H,-1) AND L>Ref(L,-1);> > Just curious why people 
  use iif so much. Thanks.> > Al Venosa>   ----- 
  Original Message ----- >   From: Graham >   
  To: amibroker@xxxxxxxxxxxxxxx >   Sent: Thursday, July 17, 
  2003 3:10 AM>   Subject: RE: [amibroker] lower highs, lower 
  lows> > >   I recently posted an indicator 
  which could be roughly what you arelooking for, at least for the trend 
  identifiaction. I will postanother version of what I am doing, and see if 
  it can be modified toget what you want>   Can't remember 
  which one I posted, but here is latest of thisparticular strain of my 
  fumblings>   //INDICATOR C 2> >   
  //Momentum> >   //by Graham Kavanagh 09 June 
  2003> >   Period1 = 40;> >   
  Period2 = 20;> >   Period3 = 5;> 
  >   Rise = IIf(H>Ref(H,-1) AND 
  L>Ref(L,-1),1,0);> >   Fall = IIf(H<Ref(H,-1) 
  AND L<Ref(L,-1),1,0);> >   CountRise = 
  Sum(Rise,Period1);> >   CountFall = 
  Sum(Fall,Period1);> >   IndC = 
  (CountRise-CountFall)/Period1*100;> >   MAIndC = 
  DEMA(IndC,Period2);> >   Trigger = 
  EMA(MAIndC,Period3);> >   Strengthup = MAindc - 
  ValueWhen(Cross(maindc,trigger),MAindc);> >   
  Strengthdn = MAindc - ValueWhen(Cross(trigger,maindc),MAindc);> 
  >   Strength = DEMA( (strengthup+strengthdn), period2 
  );> >   MAstrength = EMA(Strength,5);> 
  >   GraphXSpace = 2;> >   
  mycolor=IIf(MAIndC>Trigger, 
  colorGreen,IIf(MAIndC<Trigger,colorRed,colorBlack));> 
  >   Title =EncodeColor(SelectedValue(mycolor)) + Name() + " " 
  + Date()+ " Ind C2 Trend Strength: Higher Highs & Lows - Lower Highs 
  & 
  Lows:"+WriteVal(period1,1)+"/"+WriteVal(period1,2)+"/"+WriteVal(period3,1);> 
  >   Plot( strength, EncodeColor(colorGreen)+" trend Strength 
  ",colorGreen, styleLine+styleNoLabel);> >   Plot( 
  mastrength, EncodeColor(colorRed)+" MA Strength ", 
  colorRed,styleLine+styleNoLabel);> > > 
  >   Cheers,>   Graham> 
  >   <A 
  href="">http://groups.msn.com/ASXShareTrading> 
  >   <A 
  href="">http://groups.msn.com/FMSAustralia> 
  >     -----Original 
  Message----->     From: mrdavis9 
  [mailto:mrdavis9@xxxx] >     Sent: Thursday, 17 
  July 2003 2:52 PM>     To: 
  amibrokeryahoogroups>     Cc: jeff 
  davis>     Subject: [amibroker] lower highs, lower 
  lows> > >     A lot of traders are 
  expecting the markets to turn down any daynow, so I made an CRUDE AA scan 
  that is designed to find stocks thathave been trending up for 
  awhile,  but which have recently startedtrending  
  down.   Although I have posted the code  below, I am 
  notlooking  for suggestions for improving this CRUDE 
  scan.   I am stillstruggling with AFL, so I am not yet able to 
  create the AA scan thatwill look for exactly the conditions that I want to 
  scan for.    Ireally want  a  scan that will 
  find  those symbols that meet theWeinstein  definition of the 
  ending of an uptrend and the entering ofa downtrend.   I am 
  aware that DT is a little suspicious of Weinsteinbecause he wears a ring 
  on his pinkie.  It bothers me a little also,but at least he doesn't 
  wear a ring in his nose, at least not yet, asfar as I know .   I 
  am thinking that a lot of Amibroker users wouldlike to have a scan which 
  will find the conditions which are necessary for finding a Weinstein 
  change from uptrend to downtrend.  My understanding of Weinstein 
  trends is that after a series of higherhighs and higher lows, we suddenly 
  see a lower low, then we need to beworried.  After the appearance of 
  this first lower low, we need tokeep watching till the next high 
  occurs.  If this next high is lowerthan the previous high, then we 
  are officially in a Weinsteindowntrend.   The attached chart 
  that resulted from my CRUDE coding isapproximately the kind of results 
  that will result from a precisecoding of the Weinstein change of trend 
  definition.  Since an AA scanfor these Weinstein change of trend 
  conditions will  be useful to alot of Amibroker users, I would 
  greatly appreciate it if someexperienced Amibroker coders would post the 
  code for that looks forthese precise condtions.  Ron D 
  >     itema=C; > 
  >     Sell= MA(itema,40)>=MA(itema,20) AND 
  MA(itema,5)<=MA(itema,10)/*AND MA(itema,10)>= MA(itema,4) AND 
  MA(itema,4)>= MA(itema,5) ANDMA(itema,5)>=MA(itema,6)AND 
  MA(itema,6)>=MA(itema,7) ANDMA(itema,7)>=MA(itema,9) AND 
  MA(itema,10) >= MA(itema,12) ANDMA(itema,20)>=MA(itema,10) 
  */ANDRef(Cross(StochD(14),StochK(14)),-1);/* AND StochK(14)>=80; 
  */> >     Buy=(0);> 
  >     PlotShapes( shapeUpArrow * Buy + 
  shapeDownArrow * Sell, IIf(Buy, colorGreen, colorRed ) )> > 
  > >     Send BUG REPORTS to 
  bugs@xxxx>     Send SUGGESTIONS to 
  suggest@xxxx>     
  ----------------------------------------->     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 
  > >     Your use of Yahoo! Groups is subject 
  to the Yahoo! Terms ofService. > > 
  >         Yahoo! Groups Sponsor 
  >               
  ADVERTISEMENT>              
  >        
  >        > 
  >   Send BUG REPORTS to bugs@xxxx>   Send 
  SUGGESTIONS to suggest@xxxx>   
  ----------------------------------------->   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 
  > >   Your use of Yahoo! Groups is subject to the 
  Yahoo! Terms of Service.Send 
  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 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







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.