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; Hello , if i understood your requirement , is this you want ? please check ...

 Traderji.com Help to identify peak and trough in a indicator
 Register FAQ Calendar Search Today's Posts Mark Forums Read

#11
15th February 2013, 03:57 PM
 Member Join Date: Feb 2006 Posts: 397 Thanks: 184 Thanked 486 Times in 212 Posts
Re: Help to identify peak and trough in a indicator

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

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
 Sorry your browser does not support IFRAME

Looking for a share broker?

#12
15th February 2013, 10:14 PM
 Member Join Date: Feb 2013 Posts: 31 Thanks: 9 Thanked 6 Times in 4 Posts
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 10:25 PM.
#13
15th February 2013, 10:24 PM
 Member Join Date: Feb 2013 Posts: 31 Thanks: 9 Thanked 6 Times in 4 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by KelvinHand 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
#14
16th February 2013, 03:42 AM
 Member Join Date: Jun 2008 Location: Banned Forever Posts: 918 Thanks: 114 Thanked 1,184 Times in 555 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by giuditta Kelvin I will not give up thanks to your suggestions
#15
16th February 2013, 11:18 AM
 Member Join Date: May 2011 Posts: 464 Thanks: 1,701 Thanked 554 Times in 254 Posts
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;
#16
16th February 2013, 07:31 PM
 Member Join Date: Feb 2013 Posts: 31 Thanks: 9 Thanked 6 Times in 4 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by KelvinHand 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);
#17
16th February 2013, 08:10 PM
 Member Join Date: Apr 2010 Posts: 322 Thanks: 248 Thanked 97 Times in 65 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by giuditta 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
#18
17th February 2013, 12:16 AM
 Member Join Date: Feb 2006 Posts: 397 Thanks: 184 Thanked 486 Times in 212 Posts
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 07:32 PM.
#19
17th February 2013, 04:49 AM
 Member Join Date: Jun 2008 Location: Banned Forever Posts: 918 Thanks: 114 Thanked 1,184 Times in 555 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by hmsanil 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);
 The Following User Says Thank You to KelvinHand For This Useful Post: hmsanil (17th February 2013)
#20
17th February 2013, 05:27 AM
 Member Join Date: Jun 2008 Location: Banned Forever Posts: 918 Thanks: 114 Thanked 1,184 Times in 555 Posts
Re: Help to identify peak and trough in a indicator

Quote:
 Originally Posted by giuditta 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.
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.
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 10:58 AM.

 Bookmarks

 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 OffTrackbacks are Off Pingbacks are Off Refbacks are Off Forum Rules

 Similar Threads for: Help to identify peak and trough in a indicator Thread Thread Starter Forum Replies Last Post ford7k AmiBroker 11 23rd February 2012 02:20 PM budihartono71 MetaStock 4 13th September 2010 08:42 AM jjravi AmiBroker 5 19th January 2010 02:06 PM renu daga Technical Analysis 28 22nd June 2008 12:32 PM kkseal AmiBroker 14 24th July 2007 09:20 AM

All times are GMT +5.5. The time now is 05:58 PM.

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.