Traderji.com - Discussion forum for Stocks Commodities & Forex

Need help with the AFL on Zig Zag pivot

Discuss Need help with the AFL on Zig Zag pivot at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi frnds, i got this this afl from Subhim's collection. Need help on this one. ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Software > AmiBroker

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #1  
Old 24th June 2007, 09:03 PM
Member
 
Join Date: May 2006
Location: Kolkata
Posts: 1,098
Thanks: 1
Thanked 1 Time in 1 Post
swagat86 is on a distinguished road
Reputation: 25
Default Need help with the AFL on Zig Zag pivot

Hi frnds,

i got this this afl from Subhim's collection.

Need help on this one.

My queries:
1) I tried changing the PercentChange = 6; but its not givin me right signals when im changin it.
2) When im pressin the backtest button, im not gettin proper report. if utry this on nifty for last 2 yrs , u get just 52% gains. where as the real chart indicates much more better performance.



Quote:
//z_ZigZagValid
// ******** CHARTING
PercentChange = 6;
mystartbar = SelectedValue(BarIndex()); // FOR GRAPHING

mystartbardate = LastValue(ValueWhen(mystartbar == BarIndex(), DateNum(),1));

InitialValue = LastValue(ValueWhen(mystartbardate == DateNum(), C , 1 ) ) ;
Temp1 = IIf(BarIndex() >= mystartbar, InitialValue, Null) ;
Plot(Temp1, " ", colorBlack,styleLine);
Plot((1+(LastValue(PercentChange)/100))*(Temp1), " ", colorGreen, styleLine) ;
Plot((1-(LastValue(PercentChange)/100))*(Temp1), " ", colorRed, styleLine) ;

ZZ = Zig(C,LastValue(PercentChange)) ;
PivotLow = Ref(IIf(Ref(ROC(ZZ,1),-1) < 0 AND ROC(ZZ,1) > 0, 1, Null),1);
PivotHigh = Ref(IIf(Ref(ROC(ZZ,1),-1) > 0 AND ROC(ZZ,1) < 0, 1, Null),1);

PlotShapes( shapeCircle*PivotLow, colorGreen,0, L, -20) ;
PlotShapes( shapeCircle*PivotHigh,colorRed,0,H, 20) ;

Buy = IIf(C>(1+(LastValue(PercentChange)/100))*(ValueWhen(PivotLow, C, 1))
AND ROC(ZZ,1) > 0,1,0);
Sell = IIf(C<(1-(LastValue(PercentChange)/100))*(ValueWhen(PivotHigh, C, 1))
AND ROC(ZZ,1) < 0,1,0);

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

PlotShapes( shapeUpArrow*Buy, colorGreen,0, L, -20);
PlotShapes( shapeDownArrow*Sell, colorRed,0,H, -20) ;

BarColors =
IIf(BarsSince(Buy) < BarsSince(Sell)
AND BarsSince(Buy)!=0, colorGreen,
IIf(BarsSince(Sell) < BarsSince(Buy)
AND BarsSince(Sell)!=0, colorRed, colorBlue));

Plot(C, " ", BarColors, styleBar ) ;
Plot(ZZ," ", colorLightGrey,styleLine|styleThick);
Plot(ZZ," ", BarColors,styleDots|styleNoLine);

Title = Name() + " " + Date() + WriteIf(PivotLow, " Up Pivot ","")+WriteIf(PivotHigh," Down Pivot ","")+ WriteIf(Buy, " Buy Point ", "") + WriteIf(Sell, " Sell Point ", "") ;

AlertIf(Buy, "", "",1,1 );
AlertIf(Sell, "", "",2,1 );
Thanks in advance
Attached Images
File Type: png nifty.png (15.5 KB, 47 views)
Reply With Quote
Sponsored Links
  #2  
Old 24th June 2007, 09:17 PM
Member
 
Join Date: Aug 2005
Posts: 222
Thanks: 0
Thanked 1 Time in 1 Post
saji oommen is on a distinguished road
Reputation: 31
Default Re: Need help with the AFL on Zig Zag pivot

Hello

ZIG
- zig-zag indicator Basic price pattern detection
(AFL 1.1)


SYNTAX zig(ARRAY, change )
RETURNS ARRAY
FUNCTION Calculates the minimum % change Zig Zag indicator. Caveat: this function is based on Zig-Zag indicator and may look into the future - this means that you can get unrealistic results when back testing trading system using this indicator. This function is provided rather for pattern and trend recognition formulas.
EXAMPLE zig(close,5)


As new data comes in signals will disappear.
regards

Saji
Reply With Quote
  #3  
Old 24th June 2007, 09:41 PM
Member
 
Join Date: Aug 2005
Posts: 222
Thanks: 0
Thanked 1 Time in 1 Post
saji oommen is on a distinguished road
Reputation: 31
Default Re: Need help with the AFL on Zig Zag pivot

Hello swagat86,

Before using any AFL use the check function (Tools menu in indicator window)after pasting the AFL code in the indicator window. Use the same code you posted earlier and read the message displayed.

Or even better apply this AFL code on any scrip and mark any buy sell signal dates. Then delete your data for that scrip by one one day using edit menu, delete quotation from the last quote.

You will find all buy sell signals gone as you go on deleting latest datas. Ensure you do not save the changes made to data. For this go to preferences- miscellaneous , tick ask to save changed data. When you exit AMI a message will shown whether changes are to be saved. Press cancel.

Regards

Saji
Reply With Quote
  #4  
Old 25th June 2007, 09:51 PM
Member
 
Join Date: May 2006
Location: Kolkata
Posts: 1,098
Thanks: 1
Thanked 1 Time in 1 Post
swagat86 is on a distinguished road
Reputation: 25
Default Re: Need help with the AFL on Zig Zag pivot

Quote:
Originally Posted by saji oommen View Post
Hello

ZIG
- zig-zag indicator Basic price pattern detection
(AFL 1.1)


SYNTAX zig(ARRAY, change )
RETURNS ARRAY
FUNCTION Calculates the minimum % change Zig Zag indicator. Caveat: this function is based on Zig-Zag indicator and may look into the future - this means that you can get unrealistic results when back testing trading system using this indicator. This function is provided rather for pattern and trend recognition formulas.
EXAMPLE zig(close,5)


As new data comes in signals will disappear.
regards

Saji

thanks for ur reply Saji.

Quote:
Originally Posted by saji oommen View Post
Hello swagat86,

Before using any AFL use the check function (Tools menu in indicator window)after pasting the AFL code in the indicator window. Use the same code you posted earlier and read the message displayed.

Or even better apply this AFL code on any scrip and mark any buy sell signal dates. Then delete your data for that scrip by one one day using edit menu, delete quotation from the last quote.

You will find all buy sell signals gone as you go on deleting latest datas. Ensure you do not save the changes made to data. For this go to preferences- miscellaneous , tick ask to save changed data. When you exit AMI a message will shown whether changes are to be saved. Press cancel.

Regards

Saji
yes i know Zig zag has a bad repitition for signals disapearing but wat my view point is we can gaze the trend as mentioned in the book by Larry Williams as mentioned in his book. this AFL can be used to find the trend, ie if a higher high pivot is made it indicates uptrend and vice versa.


thanks again.
Reply With Quote
Sponsored Links

Reply

Bookmarks


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads for: Need help with the AFL on Zig Zag pivot
Thread Thread Starter Forum Replies Last Post
power pivot plus xtltrader MetaStock 3 11th January 2008 12:05 PM
using pivot points kmathur Equities 10 21st January 2007 04:01 PM
Pivot Analysis klkoo MetaStock 2 12th December 2006 08:37 PM
Pivot CheckMate Technical Analysis 5 28th July 2005 12:27 PM


All times are GMT +5.5. The time now is 02:45 PM.

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com