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

Re: [amibroker] lower highs, lower lows



PureBytes Links

Trading Reference Links




Graham:
 
I've noticed you and lots of other folks on this board seemingly 
unnecessarily use the iif statement a lot, as in your Rise and Fall code 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
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=gkavanagh@xxxxxxxxxxxxx 
  href="">Graham 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">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 are looking for, at least for the 
  trend identifiaction. I will post another version of what I am doing, and see 
  if it can be modified to get what you want
  Can't remember which one 
  I posted, but here is latest of this particular strain of my 
  fumblings
  
  //INDICATOR C 2
  //Momentum
  //by Graham Kavanagh 09 June 2003
  Period1 = 40<FONT 
  size=2>;
  Period2 = 20<FONT 
  size=2>;
  Period3 = 5<FONT 
  size=2>;
  Rise = IIf<FONT 
  size=2>(H<FONT 
  size=2>>Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2>>Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1<FONT 
  size=2>),1<FONT 
  size=2>,0);
  Fall = IIf<FONT 
  size=2>(H<FONT 
  size=2><Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2><Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1<FONT 
  size=2>),1<FONT 
  size=2>,0);
  CountRise = Sum<FONT 
  size=2>(Rise,Period1);
  CountFall = Sum<FONT 
  size=2>(Fall,Period1);
  IndC = (CountRise-CountFall)/Period1*<FONT color=#ff00ff 
  size=2>100;
  MAIndC = DEMA<FONT 
  size=2>(IndC,Period2);
  Trigger = EMA<FONT 
  size=2>(MAIndC,Period3);
  Strengthup = MAindc - <FONT color=#0000ff 
  size=2>ValueWhen(<FONT color=#0000ff 
  size=2>Cross(maindc,trigger),MAindc);
  Strengthdn = MAindc - <FONT color=#0000ff 
  size=2>ValueWhen(<FONT color=#0000ff 
  size=2>Cross(trigger,maindc),MAindc);
  Strength = DEMA<FONT 
  size=2>( (strengthup+strengthdn), period2 );
  MAstrength = EMA<FONT 
  size=2>(Strength,5<FONT 
  size=2>);
  GraphXSpace = <FONT color=#ff00ff 
  size=2>2;
  mycolor=IIf<FONT 
  size=2>(MAIndC>Trigger, <FONT color=#ff0000 
  size=2>colorGreen, <FONT color=#0000ff 
  size=2>IIf(MAIndC<Trigger,<FONT 
  color=#ff0000 size=2>colorRed,<FONT 
  color=#ff0000 size=2>colorBlack));<FONT 
  color=#ff0000 size=2>
  Title =<FONT color=#0000ff 
  size=2>EncodeColor(<FONT color=#0000ff 
  size=2>SelectedValue(mycolor)) + <FONT 
  color=#0000ff size=2>Name() + <FONT 
  color=#8b0000 size=2>" " + <FONT 
  color=#0000ff size=2>Date() + <FONT 
  color=#8b0000 size=2>" Ind C2 Trend Strength: Higher Highs & Lows - Lower 
  Highs & Lows: "+<FONT color=#0000ff 
  size=2>WriteVal(period1,<FONT color=#ff00ff 
  size=2>1)+<FONT color=#8b0000 
  size=2>"/"+<FONT color=#0000ff 
  size=2>WriteVal(period1,<FONT color=#ff00ff 
  size=2>2)+<FONT color=#8b0000 
  size=2>"/"+<FONT color=#0000ff 
  size=2>WriteVal(period3,<FONT color=#ff00ff 
  size=2>1);
  Plot( strength, <FONT color=#0000ff 
  size=2>EncodeColor(<FONT color=#ff0000 
  size=2>colorGreen)+<FONT color=#8b0000 
  size=2>" trend Strength ", <FONT 
  color=#ff0000 size=2>colorGreen, <FONT 
  color=#ff0000 size=2>styleLine+<FONT 
  color=#ff0000 size=2>styleNoLabel);<FONT 
  color=#0000ff size=2>
  Plot( mastrength, <FONT color=#0000ff 
  size=2>EncodeColor(<FONT color=#ff0000 
  size=2>colorRed)+<FONT color=#8b0000 
  size=2>" MA Strength ", <FONT color=#ff0000 
  size=2>colorRed, <FONT color=#ff0000 
  size=2>styleLine+<FONT color=#ff0000 
  size=2>styleNoLabel);
   
   <o:SmartTagType name="PersonName" 
  namespaceuri="urn:schemas-microsoft-com:office:smarttags">
  

  

  
  <B 
  ><I 
  ><SPAN 
  >Cheers<SPAN 
  class=GramE>,<st1:PersonName 
  ><B 
  ><I 
  ><SPAN 
  >Graham
  <A 
  href=""><SPAN 
  ><FONT 
  color=#008080>http://groups.msn.com/ASXShareTrading
  <A 
  href=""><FONT 
  color=#008080>http://groups.msn.com/FMSAustralia
  
    
    <FONT 
    face=Tahoma size=2>-----Original Message-----From: mrdavis9 
    [mailto:mrdavis9@xxxxxxxxxx] Sent: Thursday, 17 July 2003 2:52 
    PMTo: amibrokeryahoogroupsCc: jeff 
    davisSubject: [amibroker] lower highs, lower 
    lows
    A lot of traders are expecting the 
    markets to turn down any day now, so I made an CRUDE AA scan that 
    is designed to find stocks that have been trending 
    up for awhile,  but which have recently started trending 
     down.   Although I have posted the code  below, I 
    am not looking  for suggestions for improving this CRUDE 
    scan.   I am still struggling with AFL, so I am not yet able to 
    create the AA scan that will look for exactly the conditions that I want to 
    scan for.    I really want  a  scan that will find 
     those symbols that meet the Weinstein  definition of the ending 
    of an uptrend and the entering of a downtrend.   I am aware that 
    DT is a little suspicious of Weinstein because 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, as far as I know . 
      I am thinking that a lot of Amibroker users would like 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 higher highs and higher lows, we 
    suddenly see a lower low, then we need to be worried.  After the 
    appearance of this first lower low, we need to keep watching till the next 
    high occurs.  If this next high is lower than the previous high, then 
    we are officially in a Weinstein downtrend.   The attached chart 
    that resulted from my CRUDE coding is approximately the kind of results that 
    will result from a precise coding of the Weinstein change of trend 
    definition.  Since an AA scan for these Weinstein change of trend 
    conditions will  be useful to a lot of Amibroker users, I would greatly 
    appreciate it if some experienced Amibroker coders would post the code for 
    that looks for these precise condtions.  Ron D 
    itema=C<FONT 
    size=1>; 
    Sell= <FONT color=#0000ff 
    size=1>MA(itema,<FONT color=#ff00ff 
    size=1>40)>=<FONT color=#0000ff 
    size=1>MA(itema,<FONT color=#ff00ff 
    size=1>20) AND <FONT color=#0000ff 
    size=1>MA(itema,<FONT color=#ff00ff 
    size=1>5)<=<FONT color=#0000ff 
    size=1>MA(itema,<FONT color=#ff00ff 
    size=1>10)/* AND 
    MA(itema,10)>= MA(itema,4) AND MA(itema,4)>= MA(itema,5) AND 
    MA(itema,5)>=MA(itema,6)AND MA(itema,6)>=MA(itema,7) AND 
    MA(itema,7)>=MA(itema,9) AND MA(itema,10) >= MA(itema,12) AND 
    MA(itema,20)>=MA(itema,10) */AND <FONT 
    color=#0000ff size=1>Ref(<FONT color=#0000ff 
    size=1>Cross(<FONT color=#0000ff 
    size=1>StochD(<FONT color=#ff00ff 
    size=1>14),<FONT color=#0000ff 
    size=1>StochK(<FONT color=#ff00ff 
    size=1>14)),-<FONT color=#ff00ff 
    size=1>1);/* AND 
    StochK(14)>=80; */
    Buy=(0<FONT 
    size=1>);
    PlotShapes( shapeUpArrow * Buy + 
    shapeDownArrow * Sell, <FONT color=#0000ff 
    size=1>IIf( Buy, colorGreen, 
    colorRed ) )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. 
    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.