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

RE: [amibroker] Re: to calculate the value of the point 'P'



PureBytes Links

Trading Reference Links

slope of any function f is df/dt based on calcus. so can be approx to f(t+h) - f(t-h) / 2h as h approaches 0.
try google numerical analysis on differentiation..
watch out its always looks into the future......
 
 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Steve Dugas
Sent: Tuesday, 9 August 2005 12:02 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: to calculate the value of the point 'P'

Hi,

My thinking is that it would be very hard to *accurately* do what you are
trying to do. It's been a while since my college math days, but I will go
out on a limb and tell you what I *think* - if anyone knows I am saying
something wrong, please correct.

You  are looking for the slope of the line tangent to the fast MA at the
point where the fast MA crosses the slow MA. First of all, I think it might
be hard to identify the precise x-value of this point, since the exact point
of cross is probably somewhere between 2 data bars. Maybe the bar following
the point of cross would be close enough, or maybe you would need to use
some formula to estimate the exact value based on the MA values at the bars
before and after the cross - I'm not sure how much accuracy is required.
Anyway, assuming you got this far, you would still need to find the tangent
of that point. Since the typical MA line probably doesn't meet the
mathematical definition of a "standard" shape ( circle, ellipse, whatever ),
there is probably no "canned" formula, and I am guessing that you would need
to use calculus to approximate this - i.e., pick a second point on the MA
line and slide it towards the first point, repeatedly calculating the slope
of the secant as it approaches the tangent.
Good luck with that!   8 - )

Like I said, this is just off the top of my head, and maybe there is a
better way - just thought I would let you know what I was thinking.

Steve

PS - Where is Dimitris when you need him??!!      8 - )


----- Original Message -----
From: "cstdc5588" <cstdc5588@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, August 08, 2005 3:26 AM
Subject: [amibroker] Re: to calculate the value of the point 'P'


> Hi Graham,
>
> Thank you for your reply.
>
> I have searched all about slope posts, but I can't find any
> answers.  That's because I have a special formula.  It isn't
> a general formula which used to calculate slope.  I need to
> calculate the value of a specific point on the MA, not the actual
> close price of the stock at the corresponding time (i.e., close
> price per bar).
>
> I also searched AFL library, but I haven't find any related
> contents which involve how to calculate the value of a specific
> point on the MA.
>
> Any help is appreciated.
>
> Robert.
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>> a search on slope would give you the answers, but in a anutshell
>> slope = (Y2-Y1)/(X2-X1);
>> just substitute the values for the X's and Y's
>>
>>
>> On 8/7/05, cstdc5588 <cstdc5588@xxxx> wrote:
>> > Hi All,
>> >
>> > I want to calculate the slope of the tangent line at the crossing
>> > point of 2 moving averages.  Suppose there are 2 MAs, 10wma and
> 20
>> > wma.  K10wma = the slope of the line tangent to the 10wma at the
>> > crossing point.
>> >
>> > K10wma = (A1P1-A2P2-A3P3+A4P4)*n, where a is a constant,
>> >        P4 = the value of 10 wma at the crossing point,
>> >        P3 = the value at the point just before the crossing
> point,
>> >        P2 = the value at the point before P3,
>> >        P1 = the value at the point before P2,
>> >        and n = the coefficient of the prices at the y-axis.
>> >
>> > I need to stress that `P' is the value of a specific point on
>> > the wma, not the actual close price of the stock at the
>> > corresponding time.
>> >
>> > My question is:  if I use a 5-minute real-time chart, then how
> can I
>> > use AFL to calculate the value of P?
>> >
>> > Any help is 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
>> AB-Write >< Professional AFL Writing Service
>> Yes, I write AFL code to your requirements
>> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
>
>
>
> 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
>
>
>
>
>
>
>




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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software Stock investment software


YAHOO! GROUPS LINKS