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

Re: [amibroker] need help: how to code Troughbars correctly with MACD



PureBytes Links

Trading Reference Links

thanks graham, i got a better idea.
i just add one constant to shift the macd to always
positive to find the troughbars.....then come back to
the original macd :)



--- Graham <kavemanperth@xxxxxxxxx> wrote:

> You may not be able to use trough or peak type
> functions with MACD as
> the values can be negative which plays havoc with
> any function that
> has percent change like trough
> One suggestion could be to split MACD into positive
> and negative
> components and search on teh negative after you have
> made them
> positive :)
> Below is a quick suggestion for consideration
> eg
> MACDneg = iif( MACD()<0, abs(MACD()), 0 );
> MACDpos = iif( MACD()>0, MACD(), 0 );
> 
> MACDtrough = peakbars(MACDneg,10,1) ;
> 
> On Sat, 15 Jan 2005 21:37:03 -0800 (PST), suree
> namsiripongpan
> <suree_n@xxxxxxxxx> wrote:
> > 
> > Dear All,
> > 
> > I tried to code troughbars(macd(),20,1) but return
> > wrong result.  but this work well with close
> variable.
> > 
> > I suspect that MACD has both negative and
> postitive
> > value while close is only positive.
> > 
> > __________________________________
> > Do you Yahoo!?
> > The all-new My Yahoo! - What will yours do?
> > http://my.yahoo.com
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at:
>
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/
> 



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail


------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/