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

RE: [amibroker] Re: Fib lines from manual study lines



PureBytes Links

Trading Reference Links




Hello,
 
I don't understand very well but perhaps it can 
helps

Plot(C,<FONT color=#ff00ff 
size=1>"",1<FONT 
size=1>,64);
GraphXSpace=1;
TL=Study(<FONT 
color=#ff00ff size=1>"TL",<FONT color=#0000ff 
size=1>GetChartID());
Val=ValueWhen<FONT 
size=1>(LastValue<FONT 
size=1>(BarIndex<FONT 
size=1>())==BarIndex<FONT 
size=1>(),TL);
End=IsTrue(TL) 
AND Ref<FONT 
face="Courier New" size=1>(IsNull<FONT 
size=1>(TL),<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
Plot(<FONT face="Courier New" color=#0000ff 
size=1>ValueWhen(End,TL)<FONT 
size=1>,"<FONT face="Courier New" 
color=#ff00ff size=1>End"<FONT 
size=1>,3,<FONT 
face="Courier New" color=#ff00ff size=1>1);<FONT 
face="Courier New" color=#0000ff size=1>
Plot(Val,<FONT 
face="Courier New" color=#ff00ff size=1>"Val"<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>2);
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=gkavanagh@xxxxxxxxxxxxx 
  href="">Graham 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, June 27, 2004 8:04 AM
  Subject: RE: [amibroker] Fib lines from 
  manual study lines
  Hoping someone can help here. I found this works properly 
  only if the drawnlines extend to the end of the chart. The values are 
  correct for the pricesof the drawn lines, and the starting bar (left end), 
  but the right end ofthe drawn study is taken as the last bar of the chart 
  .How can I get the value of barindex() of the right end of the drawn 
  linestudy. Cheers,Graham<A 
  href="">http://e-wire.net.au/~eb_kavan/-----Original 
  Message-----From: Graham [mailto:gkavanagh@xxxxxxxxxxxxx] Sent: 
  Sunday, June 27, 2004 10:19 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: 
  [amibroker] Fib lines from manual study linesHope DT hasn't already 
  done this one, but his work in automated angledsup/res lines got me to 
  thinking drawing angled Fibonacci levels. The builtin fib tool is good, 
  but only uses horizontal lines, so I thought I would doone for any pair of 
  drawn lines.Just draw 2 lines on the price chart and name them F1 and 
  F2 in the lineproperties window. You can add or delete lines, change % and 
  colours justusing the fibline statement per the last few lines of the 
  code.Plot(C,"",colorBlack,styleBar);Upper=ValueWhen(NOT 
  IsNull( 
  Study("f1",GetChartID())),Study("f1",GetChartID()));Lower=ValueWhen(NOT 
  IsNull(Study("f2",GetChartID())),Study("f2",GetChartID()));TLB = 
  ValueWhen( Upper AND IsNull(Ref(Upper,-1)), BarIndex());TLP = ValueWhen( 
  Upper AND IsNull(Ref(Upper,-1)), Upper );TRB = ValueWhen( Upper 
  ==LastValue(Upper), BarIndex());TRP = ValueWhen( Upper ==LastValue(Upper), 
  Upper );BLB = ValueWhen( Lower AND IsNull(Ref(Lower,-1)), 
  BarIndex());BLP = ValueWhen( Lower AND IsNull(Ref(Lower,-1)), Lower 
  );BRB = ValueWhen( Lower ==LastValue(Lower), BarIndex());BRP = 
  ValueWhen( Lower ==LastValue(Lower), Lower );procedure 
  FibLine(x,y){LB = LastValue( BLB+(TLB-BLB)*x );RB = LastValue( 
  BRB+(TRB-BRB)*x );LP = LastValue( BLP+(TLP-BLP)*x );RP = LastValue( 
  BRP+(TRP-BRP)*x );Line = LineArray( LB, LP, RB, RP ,0 );Plot( Line, 
  "Line "+(x*100)+"%", y, 
  styleLine);}FibLine(0.5,colorRed);FibLine(0.618,colorBlue);FibLine(0.382,colorGreen);FibLine(1.618,colorRed);FibLine(-0.618,colorRed);Cheers,Graham<A 
  href="">http://e-wire.net.au/~eb_kavan/Check 
  AmiBroker web page at:<A 
  href="">http://www.amibroker.com/Check 
  group FAQ at:<A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Yahoo! Groups LinksCheck 
  AmiBroker web page at:<A 
  href="">http://www.amibroker.com/Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  __________ 
  NOD32 1.796 (20040626) Information __________This message was checked 
  by NOD32 antivirus system.<A 
  href="">http://www.nod32.com


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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.