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

Re: [amibroker] Graph plots using loops



PureBytes Links

Trading Reference Links




My fault. I had the chart showing 'Weekly' data. Return to 
daily data makes the Gap line make sense.
 
Steve
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Listes 
  trading 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, April 30, 2003 11:40 
  AM
  Subject: RE: [amibroker] Graph plots 
  using loops
  
  <FONT face=Verdana color=#800000 
  size=2>The "nobbly" line seems to detect a gap at 0. I guess that the 
  stock<FONT face=Verdana 
  color=#800000 size=2> has a wrong quotation somewhere. Try to check and 
  to correct using Symbol/Quote Editor or maybe with the new database 
  purify tool.
  <FONT face=Verdana color=#800000 
  size=2> 
  <FONT face=Verdana color=#800000 
  size=2>Waz
  
    <FONT face=Tahoma 
    size=2>-----Original Message-----From: Steve Almond (F) 
    [mailto:steve@xxxxxxxxxxxxxxxxxxxxxx]Sent: mercredi 30 avril 2003 
    12:19To: <A 
    href="">amibroker@xxxxxxxxxxxxxxxSubject: 
    Re: [amibroker] Graph plots using loops
    Great plot! One problem I have is that on many charts I 
    show a green 'nobbly' line at zero (see attached). This compresses the rest 
    of the chart. Is there a way to avoid this? I couldn't see anything obvious 
    in the code.
     
    Thanks,
     
    Steve
    <BLOCKQUOTE 
    >
      ----- Original Message ----- 
      <DIV 
      >From: 
      <A title=listes.trading@xxxxxxx 
      href="">Listes trading 
      To: <A 
      title=amibroker@xxxxxxxxxxxxxxx 
      href="">AmiBroker 
      Sent: Wednesday, April 30, 2003 9:43 
      AM
      Subject: [amibroker] Graph plots 
      using loops
      
      <SPAN 
      class=707444008-30042003>Hello
      <SPAN 
      class=707444008-30042003> 
      Here is a 
      simple code that uses a "for" loop to plot last supports, 
      resistances and open gaps on a candlestick chart.
      <SPAN 
      class=707444008-30042003> 
      <FONT 
      color=#0000ff size=2>
      Bars = param<FONT 
      color=#0000ff size=2>("Bars"<FONT 
      color=#0000ff size=2>,50<FONT 
      color=#0000ff size=2>,10<FONT 
      color=#0000ff size=2>,500<FONT 
      color=#0000ff size=2>,10<FONT 
      color=#0000ff size=2>);
      NN = param<FONT color=#0000ff 
      size=2>("Number of items to 
      plot",<FONT color=#282828 
      size=2>5,<FONT color=#282828 
      size=2>5,<FONT color=#282828 
      size=2>100,<FONT color=#282828 
      size=2>1);
      pc = 5<FONT color=#0000ff 
      size=2>*LastValue<FONT 
      color=#0000ff size=2>((HHV<FONT 
      color=#0000ff size=2>(H<FONT 
      color=#0000ff size=2>,Bars)-<FONT color=#3cb371 
      size=2>LLV(<FONT color=#ff0000 
      size=2>L,Bars))/<FONT 
      color=#3cb371 size=2>MA(<FONT 
      color=#ff0000 size=2>C,Bars));
      x0 = LastValue<FONT 
      color=#0000ff size=2>(Cum<FONT 
      color=#0000ff size=2>(1<FONT 
      color=#0000ff size=2>));
      Colorgapup = colorGreen<FONT 
      color=#0000ff size=2>;
      Colorgapdown = colorRed<FONT 
      color=#0000ff size=2>;
      Colorsupport = <FONT color=#ff0000 
      size=2>colorSeaGreen;
      Colorresistance = <FONT color=#ff0000 
      size=2>colorLightOrange;<FONT 
      color=#ff0000 size=2>
      title = <FONT color=#ff00ff 
      size=2>"Candlestick chart with supports, resistances and open gaps / 
      "+ <FONT color=#3cb371 
      size=2>fullname();<FONT 
      color=#ff0000 size=2>
      graphxspace = <FONT 
      color=#282828 size=2>1;<FONT 
      color=#3cb371 size=2>
      plot(<FONT color=#ff0000 
      size=2>C,<FONT color=#ff00ff 
      size=2>"",<FONT color=#ff0000 
      size=2>colorblack,<FONT 
      color=#ff0000 size=2>stylecandle<FONT color=#0000ff 
      size=2>);
      plot(<FONT color=#3cb371 
      size=2>bbandbot((<FONT 
      color=#ff0000 size=2>H+<FONT 
      color=#ff0000 size=2>L)/<FONT 
      color=#282828 size=2>2,<FONT 
      color=#282828 size=2>20,<FONT 
      color=#282828 size=2>2),<FONT 
      color=#ff00ff size=2>"",<FONT 
      color=#ff0000 size=2>colorlightblue<FONT color=#0000ff 
      size=2>,stylenolabel<FONT 
      color=#0000ff size=2>);
      plot(<FONT color=#3cb371 
      size=2>bbandtop((<FONT 
      color=#ff0000 size=2>H+<FONT 
      color=#ff0000 size=2>L)/<FONT 
      color=#282828 size=2>2,<FONT 
      color=#282828 size=2>20,<FONT 
      color=#282828 size=2>2),<FONT 
      color=#ff00ff size=2>"",<FONT 
      color=#ff0000 size=2>colorlightblue<FONT color=#0000ff 
      size=2>,stylenolabel<FONT 
      color=#0000ff size=2>);
      for(i=<FONT color=#282828 
      size=2>1; i<NN+<FONT 
      color=#282828 size=2>1; i++)
      {
      // Resistances
      yb = LastValue<FONT 
      color=#0000ff size=2>(Trough<FONT 
      color=#0000ff size=2>(L<FONT 
      color=#0000ff size=2>,pc,i));
      xb = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>TroughBars(<FONT 
      color=#ff0000 size=2>L,pc,i));
      resistance = IIf<FONT 
      color=#0000ff size=2>(Cum<FONT 
      color=#0000ff size=2>(1<FONT 
      color=#0000ff size=2>)>=x0-xt+<FONT color=#282828 
      size=2>1,yt,-<FONT color=#282828 
      size=2>1e10);<FONT 
      color=#a52a00 size=2>
      // Supports
      yt = LastValue<FONT 
      color=#0000ff size=2>(Peak<FONT 
      color=#0000ff size=2>(H<FONT 
      color=#0000ff size=2>,pc,i));
      xt = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>PeakBars(<FONT 
      color=#ff0000 size=2>H,pc,i));
      support = IIf<FONT 
      color=#0000ff size=2>(Cum<FONT 
      color=#0000ff size=2>(1<FONT 
      color=#0000ff size=2>)>=x0-xb+<FONT color=#282828 
      size=2>1,yb,-<FONT color=#282828 
      size=2>1e10);<FONT 
      color=#a52a00 size=2>
      // Open gaps up
      xgapup = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>ValueWhen(<FONT 
      color=#3cb371 size=2>GapUp<FONT color=#0000ff 
      size=2>(),Cum<FONT color=#0000ff 
      size=2>(1<FONT color=#0000ff 
      size=2>),i));
      ygapup = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>ValueWhen(<FONT 
      color=#3cb371 size=2>GapUp<FONT color=#0000ff 
      size=2>(),Ref<FONT color=#0000ff 
      size=2>(H<FONT color=#0000ff 
      size=2>,-1<FONT color=#0000ff 
      size=2>),i));
      ygapup = IIf<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>LastValue(<FONT 
      color=#3cb371 size=2>LLV(<FONT 
      color=#ff0000 size=2>L<FONT color=#0000ff 
      size=2>,x0-xgapup+1<FONT 
      color=#0000ff size=2>))<=ygapup,-<FONT color=#282828 
      size=2>1e10,ygapup);
      ygapup = IIf<FONT 
      color=#0000ff size=2>(Cum<FONT 
      color=#0000ff size=2>(1<FONT 
      color=#0000ff size=2>)>=xgapup,ygapup,-<FONT color=#282828 
      size=2>1e10);<FONT 
      color=#a52a00 size=2>
      // Open gaps down
      xgapdn = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>ValueWhen(<FONT 
      color=#3cb371 size=2>GapDown<FONT color=#0000ff 
      size=2>(),Cum<FONT color=#0000ff 
      size=2>(1<FONT color=#0000ff 
      size=2>),1<FONT color=#0000ff 
      size=2>));
      ygapdn = LastValue<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>ValueWhen(<FONT 
      color=#3cb371 size=2>GapDown<FONT color=#0000ff 
      size=2>(),Ref<FONT color=#0000ff 
      size=2>(L<FONT color=#0000ff 
      size=2>,-1<FONT color=#0000ff 
      size=2>),1<FONT color=#0000ff 
      size=2>));
      ygapdn = IIf<FONT 
      color=#0000ff size=2>(<FONT color=#3cb371 
      size=2>LastValue(<FONT 
      color=#3cb371 size=2>HHV(<FONT 
      color=#ff0000 size=2>H,x0-xgapdn 
      +1<FONT color=#0000ff 
      size=2>))>=ygapdn ,-1e10<FONT 
      color=#0000ff size=2>,ygapdn );
      ygapdn = IIf<FONT 
      color=#0000ff size=2>(Cum<FONT 
      color=#0000ff size=2>(1<FONT 
      color=#0000ff size=2>)>=xgapdn ,ygapdn ,-<FONT color=#282828 
      size=2>1e10);<FONT 
      color=#a52a00 size=2>
      // Graph plots
      Plot<FONT color=#0000ff 
      size=2>(ygapdn ,""<FONT 
      color=#0000ff size=2>,Colorgapdown ,<FONT color=#282828 
      size=2>4+<FONT color=#282828 
      size=2>8);
      Plot<FONT color=#0000ff 
      size=2>(ygapup,""<FONT 
      color=#0000ff size=2>,Colorgapup ,<FONT color=#282828 
      size=2>4+<FONT color=#282828 
      size=2>8);
      Plot<FONT color=#0000ff 
      size=2>(support,""<FONT 
      color=#0000ff size=2>,Colorsupport ,<FONT color=#282828 
      size=2>4);
      Plot<FONT color=#0000ff 
      size=2>(resistance,""<FONT 
      color=#0000ff size=2>,Colorresistance ,<FONT color=#282828 
      size=2>4);
      }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. 
    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












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.