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

[amibroker] Re: ATR Trailing Stop



PureBytes Links

Trading Reference Links

with loop you can do it, I've not check it, certainly there is some 
change to do, but ... it is one way

x=C-2*ATR(10);

for(i=0;i<10;i++)
{
trail[i]=NULL;
}
for(i=10;i<Barcount;i++)
{
if(c>trail[i-1])
trail[i]=max(x,trail[i-1]);
else
trail[i]=x;
}

> 
> I'm interested in moving over to AmiBroker from Metastock. I've had 
a 
> look at PowerScan and I think I will find it very useful and speed 
up 
> learning.
> 
> I have an ATR trailing stop in MetaStock that I'd like to use in 
> AmiBroker but even with PowerScan I am having trouble. Would anyone 
> with Meta/Ami experience be able to help please? Or, have a 
standard 
> ATR stop I might be able to try?
> 
> Here it is in Metastock code:
> 
> x:=C-2*ATR(10);
> If(C>PREV,Max(x,PREV),x)
> 
> Cheers Glenn


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/