PureBytes Links
Trading Reference Links
|
I do not know MS syntax.
In AFL there is a difference between "==" [equal to] and "="
[assignment operator]
See "Operator precedence and the parentheses" in the Users Guide.
For Plot statement see AFL Function Reference ->Plot
Dimitris
--- In amibroker@xxxxxxxxxxxxxxx, nikku <nikku@xxxx> wrote:
> Hi Dimitris
>
> Thanks a lot for taking the time to respond. I really appreciate it.
>
> Just to clarify, is this correct version of the code you are
suggesting?
> I ask because my formula, the one I gave in my email, was giving
the
> same results as I got in Metastock, so I thought I was ok - perhaps
this
> is just an issue of definition of goals.
>
> I pasted the following formula into Amibroker, but it didn't work -
I am
> misinterpreting your advice, obviously. I am eager to understand
what
> the last line, Plot(aroonup," ",1,8, means. Any further help you
can
> give would be greatly appreciated.
>
> Re: AroonUp = 100.... I assume you mean that since I have said that
I
> want AroonUp = 100, I don't need (AroonUp>AroonDn) because AroonDn
> cannot possibly = 100 if AroonUp does?
>
> 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);
>
>
>
> DIMITRIS TSOKAKIS wrote:
>
> > 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);
> >
> >
> >
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> >
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> >
> > *Yahoo! Groups Sponsor*
> > ADVERTISEMENT
> >
<http://us.ard.yahoo.com/SIG=129o65m4u/M=295196.4901138.6071305.300117
6/D=groups/S=1705632198:HM/EXP=1096529335/A=2128215/R=0/SIG=10se96mf6/
*http://companion.yahoo.com>
> >
> >
> >
> > ------------------------------------------------------------------
------
> > *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
> > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?
subject=Unsubscribe>
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service <http://docs.yahoo.com/info/terms/>.
> >
> >
>
>
> --
> The majority meet with failure because of their lack of persistence
in creating new plans to take the place of those which fail.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|