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

Re: [amibroker] Re: Peak & Zig Zag



PureBytes Links

Trading Reference Links




Jayson,
 
I noticed that also. I guess there are better indicators for me to be 
exploring at this time. 
 
I just received  Robert Pardo's book , "Design, Testing, and 
Optimization of Trading Systems" , today . I think I'll go read that and see 
what I can learn. Lots, I imagine !
 
Bye for now,
 
Greg
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Jayson 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Monday, November 24, 2003 4:29 
  PM
  Subject: RE: [amibroker] Re: Peak & 
  Zig Zag
  
  <FONT face=Arial color=#0000ff 
  size=2>Greg,
  the 
  challenge is the signal will always be late. If you set your pivots at, say, 
  5% then zz trend will not trigger until 5% after the turn actually happened. 
  The picture that Tomasz just posted illustrates this 
  perfectly......
   
  Regards, 
  Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Greg 
  [mailto:gregbean@xxxxxxxxxxx]Sent: Monday, November 24, 2003 3:19 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] 
  Re: Peak & Zig Zag
  Hi,
   
  I was wondering if anyone has read the Nov. 2003 TASC  article about 
  ZigZag trend indicator. 
   
  The author claims it to be a tradeable indicator because it solves 
  theproblem of the dynamic last leg.
   
   I was thinking this might be adapted with a validating signal such 
  as TRIX and or StoRSI but I haven't tested any further .  Anybody have 
  any thoughts about the TASC article and/or the indicator?
   
  Greg
   
  Here is the code that TJ programmed:
   
  
  /*THE ZIGZAG TREND INDICATOR
  In "The Zigzag Trend Indicator" article Spyros Raftopoulos presents an 
  enhancement of his zigzag validity indicator. A new Zigzag Trend indicator is 
  an attempt to address shortcomings (mainly 'last leg' problem) of classic 
  zigzag. The technique involves delaying the response of the indicator as long 
  as reversal amount is reached AND last leg of zigzag line becomes valid AND 
  can be easily reproduced in AmiBroker using its native AFL language. Listing 1 
  shows ready-to-use code that can be applied in Indicator Builder. It includes 
  also a very basic reversal trading system to be applied in Automatic Analysis 
  window. The percentage reversal amount can be changed on-the-fly without 
  modifying the code using the Parameters window.
  LISTING 1*/
  array = Close;
  amount = Param<FONT 
  size=1>("Amount", 
  6, 
  1, <FONT 
  color=#ff00ff size=1>50, <FONT color=#ff00ff 
  size=1>0.5 );
  zz0 = Zig( 
  array, amount );
  zz1 = Ref( 
  zz0, -1 );
  zz2 = Ref( 
  zz0, -2 );
  tr = ValueWhen<FONT 
  size=1>(zz0 > zz1 AND zz1 < zz2, zz1);
  pk = ValueWhen<FONT 
  size=1>(zz0 < zz1 AND zz1 > zz2, zz1);
  PU = tr + 0.01 * 
  abs<FONT 
  size=1>(tr)*amount;
  PD = pk - 0.01 * 
  abs<FONT 
  size=1>(pk)*amount;
  ZZT = IIf( 
  array >= PU AND zz0 > zz1, <FONT color=#ff00ff 
  size=1>1,
  IIf( array <= PD AND zz0 < zz1, 
  -1, <FONT 
  color=#ff00ff size=1>0 ) );
  ZZT = ValueWhen<FONT 
  size=1>( ZZT != 0, ZZT 
  );
  // plot price bar chart
  Plot( Close, <FONT color=#ff00ff 
  size=1>"Price", colorBlack, styleBar 
  );
  // plot Zigzag and zigzag trend 
  Plot( ZZT, <FONT color=#ff00ff 
  size=1>"ZigZagTrend", colorRed, 
  styleOwnScale ); 
  Plot( zz0, <FONT color=#ff00ff 
  size=1>"ZigZag line", colorBlue, styleThick 
  );
  // Plot the ribbon
  ribboncol= IIf<FONT 
  size=1>( ZZT > 0, 
  colorGreen, colorRed ); <FONT color=#0000ff 
size=1>
  Plot( <FONT color=#ff00ff 
  size=1>2, "ZZT 
  Ribbon", ribboncol, styleArea | 
  styleOwnScale | styleNoLabel, <FONT color=#ff00ff 
  size=1>0, <FONT color=#ff00ff 
  size=1>100 );
  GraphXSpace = 10<FONT 
  size=1>;
  Buy = Cover = <FONT color=#0000ff 
  size=1>Cross( ZZT, <FONT color=#ff00ff 
  size=1>0 );
  Sell = Short = <FONT color=#0000ff 
  size=1>Cross( <FONT color=#ff00ff 
  size=1>0, ZZT );
  // plot arrows
  PlotShapes( Buy + <FONT color=#ff00ff 
  size=1>2 * Sell, ribboncol, <FONT 
  color=#ff00ff size=1>0, <FONT color=#0000ff 
  size=1>IIf( Buy, L, H ), 
  -30 );
   
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    <A title=jcasavant@xxxxxxxxxxx 
    href="">Jayson 
    To: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Sent: Monday, November 24, 2003 3:29 
    PM
    Subject: RE: [amibroker] Re: Peak & 
    Zig Zag
    
    <FONT face=Arial color=#0000ff 
    size=2>The Challenge Phsst is that the legs can changed based on future data 
    in which case your buy or sell signal can simply vanish in the back test. 
    Zig can be very useful in real time but like every thing else in Real time 
    you simply can not know for sure until time has past if your signal was in 
    fact valid or not. A back test using zig (or peak or trough) will always 
    show you the best signals only and none of the failed 
    signals.
     
    Regards, 
    Jayson 
    <FONT face=Tahoma 
    size=2>-----Original Message-----From: Phsst 
    [mailto:phsst@xxxxxxxxx]Sent: Monday, November 24, 2003 1:57 
    PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
    Re: Peak & Zig ZagExcuse me... Enter key on 
    Subject Line gets me too often.It is clear that Zig Zag *can* give 
    unrealistic test results becauseit looks into the future. This is 
    documented. But there is almost thecaveat *can* included in the 
    caution.But are there any known conditions where test results can be 
    relied upon.For example if a calculated trendline up to the current 
    bar is morethan a few bars old, and is linear for those past bars, and 
    correlates(for lack of a better word) with current bar close 
    price,  does thisnot perhaps mean that an assumption can be safely 
    made that futureprices have not yet influenced the current 
    trend?Regards,PhsstSend 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. 
  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.