Traderji.com - Online community for Indian investors & traders!


Help to identify peak and trough in a indicator

Discuss Help to identify peak and trough in a indicator at the AmiBroker within the Traderji.com - Online community for Indian investors & traders!; Hello , if i understood your requirement , is this you want ? please check ...


Go Back   Traderji.com - Online community for Indian investors & traders! > TOOLS & RESOURCES > Software > AmiBroker


Reply
 
Thread Tools
  #11  
Old 15th February 2013, 04:57 PM
casoni's Avatar
Member
 
Join Date: Feb 2006
Location: jam
Posts: 225
Thanks: 103
Thanked 193 Times in 77 Posts
casoni has a spectacular aura aboutcasoni has a spectacular aura aboutcasoni has a spectacular aura about
Default Re: Help to identify peak and trough in a indicator

Hello ,
if i understood your requirement , is this you want ?

please check this

per=Optimize("Period",Param("Period",14,2,20,1),2, 20,1);
percentchange=Optimize("Zig %",Param("Zig %",2,1,20,1),1,20,1);
az= RSI(per);
Plot( az,"",colorWhite,4);
ZZ = Zig(az,LastValue(PercentChange)) ;
Plot(zz,"",4,1);

this plots zz on rsi . and same zz can be applied on price chart
Thank you



Reply With Quote
Sponsored Links
  #12  
Old 15th February 2013, 11:14 PM
Member
 
Join Date: Feb 2013
Posts: 28
Thanks: 7
Thanked 6 Times in 4 Posts
giuditta is on a distinguished road
Default Re: Help to identify peak and trough in a indicator

HI Casoni,
thanks to your reply. I suppose that you are italian too like me.
My difficulty is to plot a peak of a zig formula. See the picture example in the previous page taken from metastock. I can't create the last formula in amibroker: according to this I need value 1 whenever zig of the zigzag in the middle has a peak and value 0 whenever there is no one.
Is there anyone able to help me? regards

Last edited by giuditta; 15th February 2013 at 11:25 PM.
Reply With Quote
  #13  
Old 15th February 2013, 11:24 PM
Member
 
Join Date: Feb 2013
Posts: 28
Thanks: 7
Thanked 6 Times in 4 Posts
giuditta is on a distinguished road
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by KelvinHand View Post
I merely show you the concept, not the exact function here, i did not verify in the amibroker, if i verified, i likely will enclosed in the [code].
Whether syntax 'chance' or 'change' is not the issue. they are just function parameter.

the last peak formula returns error 31 syntax error, unespected ';', expecting ')' or ',' is very easy, it told you what the cause.
you need to patiently figure out and correct it.

You are suppose to solve your problem, not me. I merely provide some help to you.
If you face problem and just give up and throw the problem to me. then i quit.

Come this stage, 99% of the problem had surfaced up because you think amibroker should follow what metastock is doing.
What you need is just a little push to yourself to complete the job.
Kelvin I will not give up thanks to your suggestions
Reply With Quote
  #14  
Old 16th February 2013, 04:42 AM
Member
 
Join Date: Jun 2008
Posts: 728
Thanks: 84
Thanked 827 Times in 401 Posts
KelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to behold
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by giuditta View Post
Kelvin I will not give up thanks to your suggestions
pm me your code.
Reply With Quote
  #15  
Old 16th February 2013, 12:18 PM
sudris's Avatar
Member
 
Join Date: May 2011
Posts: 464
Thanks: 1,701
Thanked 554 Times in 254 Posts
sudris is a name known to allsudris is a name known to allsudris is a name known to allsudris is a name known to allsudris is a name known to allsudris is a name known to all
Default Re: Help to identify peak and trough in a indicator

I think you are close enough.

Quote:
Peak( High, percdiff, 1 ) == High;
the highlighted ones are the arrays. make sure you use the same array at RHS of "==".

for example, if you want to use the Close array to find the peak then your code should look like below

Quote:
Peak( Close, percdiff, 1 ) == Close;
Reply With Quote
  #16  
Old 16th February 2013, 08:31 PM
Member
 
Join Date: Feb 2013
Posts: 28
Thanks: 7
Thanked 6 Times in 4 Posts
giuditta is on a distinguished road
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by KelvinHand View Post
pm me your code.
here is the code of the zig formula.

a = C-2*Ref(H,-1) + Ref(L,-2);
s = V*(C-Ref(H,-1));
q=a+s;
zigq=Zig(q,10);
Plot(Zigq,"zigq",colorWhite);
Reply With Quote
  #17  
Old 16th February 2013, 09:10 PM
Member
 
Join Date: Apr 2010
Posts: 280
Thanks: 231
Thanked 81 Times in 53 Posts
hmsanil will become famous soon enough
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by giuditta View Post
here is the code of the zig formula.

a = C-2*Ref(H,-1) + Ref(L,-2);
s = V*(C-Ref(H,-1));
q=a+s;
zigq=Zig(q,10);
Plot(Zigq,"zigq",colorWhite);

I tried to overlay this on price, but it not displaying properly.

How to overlay this indicator on price, can anybody please tell me how to do it

Thanks
Reply With Quote
  #18  
Old 17th February 2013, 01:16 AM
casoni's Avatar
Member
 
Join Date: Feb 2006
Location: jam
Posts: 225
Thanks: 103
Thanked 193 Times in 77 Posts
casoni has a spectacular aura aboutcasoni has a spectacular aura aboutcasoni has a spectacular aura about
Default Re: Help to identify peak and trough in a indicator

hello giuditta ,
are you looking for something like this ?

i have plotted peak-bottom on your indicator ,

please check , if this helps i will post the code.

* this is 60 min chart

thank you

Last edited by casoni; 1st June 2013 at 08:32 PM.
Reply With Quote
  #19  
Old 17th February 2013, 05:49 AM
Member
 
Join Date: Jun 2008
Posts: 728
Thanks: 84
Thanked 827 Times in 401 Posts
KelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to behold
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by hmsanil View Post
I tried to overlay this on price, but it not displaying properly.

How to overlay this indicator on price, can anybody please tell me how to do it

Thanks
First thing, when you plot as indicator (means no price chart), what is the value shown on the Y-Axis ?

Does it tally with the price chart value ?
if not why ?
cause there is a Volume play in the formula.


To display the price chart and the non-tally indicator together, do the following:

Plot(Zigq,"zigq",colorWhite, styleOwnScale);
Reply With Quote
The Following User Says Thank You to KelvinHand For This Useful Post:
hmsanil (17th February 2013)
  #20  
Old 17th February 2013, 06:27 AM
Member
 
Join Date: Jun 2008
Posts: 728
Thanks: 84
Thanked 827 Times in 401 Posts
KelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to beholdKelvinHand is a splendid one to behold
Default Re: Help to identify peak and trough in a indicator

Quote:
Originally Posted by giuditta View Post
here is the code of the zig formula.

a = C-2*Ref(H,-1) + Ref(L,-2);
s = V*(C-Ref(H,-1));
q=a+s;
zigq=Zig(q,10);
Plot(Zigq,"zigq",colorWhite);
Now you show out "My Formula", now i understand why you failed.
Since your are laying out your Ami Code, by extracting from your previous explanation,
Hope the following is what your are trying to do:

Code:
//--1st indicator
Change1=10;
function First_Indicator()
{
  a = C-2*Ref(H,-1) + Ref(L,-2);
  s = V*(C-Ref(H,-1));
  q = a+s; 

  zigq=Zig(q,Change1);

  return q;
} 


Zig_Fml1=First_Indicator();
Plot(Zig_Fml1,"zig1",colorWhite, styleOwnScale);


//-- 2nd Indicator
percdiff = 1; 
pkd = Peak(Zig_Fml1,percdiff) == High; 
Plot(pkd, "my zig peak",colorYellow,styleOwnScale);
If i m not wrong, the problem you had faced:
1. You try to plot on price chart, nothing shown.
2. Your formula contain volume.
3. When you try to plot the following it will never work, it always default to 0.
* pkd = Peak(Zig_Fml1,percdiff) == High;

Why ?
Because your formula contains item 2, no longer able to equal to High.


IF (your script work on matastock AND don't work on Amibroker) THEN
post the original mestastock with your actual picture;
ELSE
i think i got no way to do it.



Last edited by KelvinHand; 17th February 2013 at 11:58 AM.
Reply With Quote
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: Help to identify peak and trough in a indicator
Thread Thread Starter Forum Replies Last Post
peak n trough trading system ford7k AmiBroker 11 23rd February 2012 03:20 PM
Peak & trough formula ( tester) budihartono71 MetaStock 4 13th September 2010 09:42 AM
BoonC Peak 'n Trough V 1.1 afl jjravi AmiBroker 5 19th January 2010 03:06 PM
Determination Of Trough /peak renu daga Technical Analysis 28 22nd June 2008 01:32 PM
Peak, Trough & Zig kkseal AmiBroker 14 24th July 2007 10:20 AM


All times are GMT +5.5. The time now is 09:11 AM.

Indemnity, Disclaimer & Disclosure Notice:
By visiting Traderji.com you automatically indicate that you agree to our Forum Rules, Indemnity, Disclaimer & Disclosure Notice and General Content Disclaimer Notice and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum/site.
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. You are recommended to make appropriate enquiries and seek appropriate advise before sending money, incurring any expenses, acting on recommendations or entering into any commitment in relation to any advertisement published here. Traderji.com does not vouch for any claims made by the advertisers of products and services. Traderji.com will not be held liable for any consequences in the event such claims are not honoured by the advertisers. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of any information by anybody mentioned anywhere on this site.
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 or legality of any 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. Although we constantly delete all irrelevant content and/or SPAM, if you should 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 © www.Traderji.com 2001 - , All rights reserved.

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247