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

[amibroker] Re: calling all AFL masters



PureBytes Links

Trading Reference Links

This code has some problems. It gives AroonUp=100 for every bar.
Try the
 ALen = 14;
AroonUp = 100 * (ALen - (HHVBars(H, ALen + 1))) / Alen;
AroonDn = 100 * (ALen - (LLVBars(L, ALen + 1))) / ALen;
Condition=(AroonUp>AroonDn) AND Ref(AroonUp,-1)<Ref(AroonDn,-1) AND 
Ref(AroonDn,-1)>68 AND C>MA(C,50) AND AroonUp=100;
Plot(aroonup," ",1,8);
to see.
You need an
...AND AroonUp==100;
in order to ask "AroonUp is equal to 100".
Dimitris
PS: Of course, if you really want AroonUp==100, then you dont need 
the AroonUp>AroonDn...
--- In amibroker@xxxxxxxxxxxxxxx, nikku <nikku@xxxx> wrote:
> 
> Hello
> 
> Well, here we go - I am going to take Yuki and Tomasz and a few 
others 
> up on their offer to post here with my questions, newbie though 
they may 
> be. I will continue to ask until someone tells me that I need to 
stop 
> because I'm driving them crazy :)
> 
> I know most of my questions will be ridiculously if not 
irritatingly 
> simple for most of you.
> 
> Below is an AA attempt using Aroon. The idea is to buy when the 
> *condition* parameters are true. I am trying to limit position 
size, but 
> it isn't working. Is there something wrong with the position size 
filter 
> I am attempting?  When I ask for this Analysis on a basket of 
stocks, I 
> get filled for the entire capital amount on the first signal, 
instead of 
> getting a smaller fill based on this stop, leaving capital free to 
take 
> subsequent entry signals. Also, I occasionally get filled for i.e. 
3 
> shares of a $12 stock when the entire capital amount seems to be 
available.
> 
> Any help is appreciated. I have learned that you have to be a lot 
more 
> meticulous using AFL than Metastock Formula Language - perhaps I 
have 
> made some silly error.
> 
> Please pay special attention to this line of the following code;  
note 
> the negative sign in front of the two.
> 
> *TrailStopAmount = -2 * ATR( 20 );
> 
> 
______________________________________________________________________
_____________________________
> *
> 
> ALen = 14;
> AroonUp = 100 * (ALen - (HHVBars(H, ALen + 1))) / Alen;
> AroonDn = 100 * (ALen - (LLVBars(L, ALen + 1))) / ALen;
> Condition=(AroonUp>AroonDn) AND
> Ref(AroonUp,-1)<Ref(AroonDn,-1) AND
> Ref(AroonDn,-1)>68 AND
> C>MA(C,50) AND
> AroonUp=100;
> 
> Buy= Condition;
> Sell=0;//
> 
> TrailStopAmount = -2 * ATR( 20 );
> Capital = 100000;
> 
> Risk = 0.01*Capital;
> PositionSize = (Risk/TrailStopAmount)*BuyPrice;
> ApplyStop( 2, 2, TrailStopAmount, 0);



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/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/