[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

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/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/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/