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

Re: [amibroker] Re: Indicator help



PureBytes Links

Trading Reference Links

buy = whateverlong;
short = whatevershort;

LongTrailExit = highestsince( Buy, c-ma(H-L,5) );
ShortTrailExit = lowestsince( Short, c+ma(H-L,5) );

Sell = Cross( ref(LongTrailExit,-1), c ); 
Cover = Cross( C, ref(ShortTrailExit,-1) ); 
I use ref(trail,-1) because it shadows actual trading conditions
better where you know yesterdays value, not todays.

On 9/9/05, Lesmond V <ebsn247@xxxxxxxx> wrote:
> It's better to use Average True Range instead of just H-L. Here is an
> example that should get you running:
> 
> TrailingStopLong = HHV( C - 2 * ATR(7), 14 );
> Plot( TrailingStopLong, "", colorRed, styleLine);
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "patchc2000" <dc003f8917@xxxx>
> wrote:
> > I am new to the AmiBroker programming language. I need help writing
> a
> > stop indicator:
> >
> > Close - average of (High-Low) for the past 5 days
> > Close + average of (High-Low) for the past 5 days
> >
> > i.e c -((High-Low)today +(High-Low)1-day ago+....+(High-Low)4-days
> > ago)/5 etc.
> >
> > So that symbol has a stop channel in effect.
> >
> > Thanks in advance.
> 
> 
> 
> 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help Sudanese refugees rebuild their lives through GlobalGiving.
http://us.click.yahoo.com/hjNroD/EbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/