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

Re: [amibroker] Re: to calculate the slope at any specific point on a curve by AFL.



PureBytes Links

Trading Reference Links

Graham:
 
You lost me.  How does ROC(array, 1) = slope?  Aren't the following correct?
 
ROC(array, i - n) = (array(i) - array(i - n) / array(i - n))
 
and
 
slope(i - n)  = (array(i) - array(i - n)) / (i - n)
 
In other words, ROC divides the difference of two array values by the first array value and slope divides by the number of bars.  Sounds like apples and oranges to me.  What am I missing?
 
Bill
 
----- Original Message -----
From: Graham
Sent: Monday, July 18, 2005 2:08 AM
Subject: Re: [amibroker] Re: to calculate the slope at any specific point on a curve by AFL.

Cond = Cross( MA (Close, 20), MA(Close, 50) );
Cond1 = Cross( MA (Close, 50), MA(Close, 20) );
Buy = Cond;
Sell = Cond1;

Well i pointed to using ROC

Slope20 = ROC(ma(c,20),1);
Slope50 = ROC(ma(c,50),1);


to help yourself see what type of results use an exploration to provide numbers

filter=cond or cond1;
addcolumn(slope20,"slope20,1.3);
addcolumn(slope50,"slope50,1.3);

checking this against your charts you can work out the slope value you
want, then add this to your buy/sell conditions, something like this

eg
buy = cond and roc(ma(c,20),1)>0.5;



On 7/18/05, cstdc5588 <cstdc5588@xxxxxxxxx> wrote:
> Hi Graham,
>
> Thanks a lot.  You're so nice.
>
> Actually, I just need one simple formula, i.e., when 2 moving avgs
> cross, as in this formula:
>
> ///////
> Cond = Cross( MA (Close, 20), MA(Close, 50) );
> Cond1 = Cross( MA (Close, 50), MA(Close, 20) );
> Buy = Cond;
> Sell = Cond1;
> ///////
>
> I hope when a fast MA crosses a slow MA from bottom upward, the
> slope of the crossover tangent point of the fast MA is more than
> 0.5.  On the other hand, when a fast MA crosses a slow MA from top
> downward, the slope of the crossover tangent point of the fast MA is
> less than -0.5.  That is, the "buy" signal must satisfy the
> specified condition and with a slope > 0.5.  On the other hand,
> the "sell" signal must satisfy the specified condition and
> with a slope < -0.5.
>
> I understand that this slope must be calculated first, but I
> don't know how to calculate it using AFL.
>
> Could you please help me with this function?  Your help would be
> much appreciated.
>
> Robert.
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> > Unless you need intensive help, or want someone else to just write
> > them for you then stick with this group to help solve the little
> > things.
> > Don't know of any paid service, except maybe by AB. Checik with
> the AB
> > website and see if anything is there.
> > Otherwise us freebie helpers can assist each other with the
> learning curve.
> >
> > On 7/18/05, cstdc5588 <cstdc5588@xxxx> wrote:
> > > Hi Graham,
> > >
> > > Thanks a lot.
> > >
> > > Because I don't know much about AFL, I need some help to do this.
> > > I remember I've seen a link saying that someone can provide this
> > > service (of course, there'll be a charge), but I can't find
> > > it now.  Do you know about this service?  Where can I get it?
> Any
> > > suggestions?  Or do you know the link?
> > >
> > > Robert.
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx>
> wrote:
> > > > just use ROC(indicator,1) to get slope, will be expressed as Y-
> > > value/bar
> > > >
> > > > do a search for other posts of the same type if you want to
> > > convert to
> > > > some other value slope.
> > > >
> > > > On 7/18/05, cstdc5588 <cstdc5588@xxxx> wrote:
> > > > > Hi Friends,
> > > > >
> > > > > I want to know whether the AFL of AmiBroker could be used to
> > > > > calculate the slope at any specific point on a curve.
> > > > >
> > > > > For instance, if I want to find out the slope of the point
> when
> > > a 10-
> > > > > period moving average crosses a 20-period moving average,
> could
> > > this
> > > > > slope be calculated by AFL?  For the slope I hope it'll be
> > > > > expressed as 3/2 or -0.5, not as 30 degrees or 45 degrees,
> as the
> > > > > latter is too complicated and needs to use trigonometry to
> > > calculate.
> > > > >
> > > > > Any help would be much appreciated
> > > > >
> > > > > Robert.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 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
> > > > http://e-wire.net.au/~eb_kavan/
> > >
> > >
> > >
> > >
> > >
> > > 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
> > http://e-wire.net.au/~eb_kavan/
>
>
>
>
>
> 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
http://e-wire.net.au/~eb_kavan/


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.0/50 - Release Date: 7/16/05


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