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

RE: [amibroker] Re: Fibonacci Time Retracements - Graham



PureBytes Links

Trading Reference Links

Trying to ceate fibonacci time retracements in AB. See explaination 
at http://www.fibonacci-retracements.com/m2.  I have been somewhat 
successful creating these retracement lines for price using the 
following code: 

//Fibonacci Retracement Lines

H52 = Ref(HHV(H,60),-1);
L52 = Ref(LLV(L,60),-1);
L52bar = LastValue( BarsSince(L==L52));
H52bar=LastValue(BarsSince(H==H52));
change = H52-L52;
Retrace38 = H52 - change*0.382;
Retrace50 = H52 - Change*0.50;
Retrace62 = H52 - Change*0.618;
Retrace100 = H52 - Change*1;

Plot(C,"price",colorBlack,styleCandle);
Plot(IIf(BarIndex()>=(BarCount-1- H52bar), H52, Null), "H52", 
colorRed,styleLine);
Plot(IIf(BarIndex()>=(BarCount-1- H52bar), Retrace38, Null), "Retr 
38%", colorYellow,styleLine);
Plot(IIf(BarIndex()>=(BarCount-1- H52bar), Retrace50, Null), "Retr 
50%", colorBlue,styleLine);
Plot(IIf(BarIndex()>=(BarCount-1- H52bar), Retrace62, Null), "Retr 
62%", colorGreen,styleLine);
Plot(IIf(BarIndex()>=(BarCount-1- H52bar), Retrace100, Null), "Retr 
100%", colorRed,styleLine);
GraphXSpace=5;

Not sure how to create Time retracements to follow all of the same 
rules as price retracements in AB.

Help is appreciated
MR



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:
     http://docs.yahoo.com/info/terms/