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

Re: [amibroker] Re: How to code a Adaptive StDev()



PureBytes Links

Trading Reference Links

Hello,

Everything in AmiBroker is written in C++. The maths internally are done
using FPU (floating point unit) that uses 80 bit registers (more than double precision), only end results
are stored as 32 bit IEEE.
And no, there is no penalty for calling functions in the plugin.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "brian_z111" <brian_z111@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, June 15, 2009 12:43 AM
Subject: [amibroker] Re: How to code a Adaptive StDev()


> Thanks.... much appreciated.
> I guessed I would come up with some options if I just googled but I ran out of time.
> 
> So is the AFL StDev written in C++ or what?
> I guess your aim with the builtin functions would be to maintain integrity of the math to many decimal places?
> 
> Is there a time penalty to get code from a plugin compared to builtin functions?
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@xxx> wrote:
>>
>> This formulation is in every algebra book and used in school often
>> because it is quicker even for human to calculate that way.
>> 
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>> ----- Original Message ----- 
>> From: "brian_z111" <brian_z111@xxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Monday, June 15, 2009 12:06 AM
>> Subject: [amibroker] Re: How to code a Adaptive StDev()
>> 
>> 
>> > Nice work Bruce.
>> > 
>> > I was trying to make up my own algebraic equivalent in lieu of a reference source, or sources.
>> > 
>> > 
>> > Did you get 'your' version of StDev from a reference of is it your own work?
>> > 
>> > --- In amibroker@xxxxxxxxxxxxxxx, "bruce1r" <brucer@> wrote:
>> >>
>> >> Herman, Mike, all - just checking in and think I can offer a quick
>> >> suggestion and some code that I have handy.
>> >> 
>> >> 1.  StDev() is a function that is not implemented as a variable period
>> >> function, but can be with a slight caveat.  Because this uses an
>> >> alternative, but algebraically equivalent formulation, that employs a
>> >> "data^2" term, it loses precision at about the 5th significant digit. 
>> >> That is close enough for most work, though.  So, anyway, this one liner
>> >> function will give a fast, variable period StDev ( IOW, vper can be a
>> >> varying array) -
>> >> 
>> >> function StDevVarPer( data, Vper )
>> >> {
>> >> return  sqrt( MA( data ^ 2, vper ) - MA( data, vper ) ^ 2 );
>> >> }
>> >> 
>> >> 2.  This is fast even with large numbers of 1 minute bars, but it is
>> >> usually best to control QuickAFL with a statement like the following as
>> >> the LAST STATEMENT in the program to yield maximum performance -
>> >> 
>> >> SetBarsRequired( 500, 0 );
>> >> 
>> >> Remember that with QuickAFL in an indicator, the first execution after
>> >> an edit or insert passes the entire array to set the bar requirement,
>> >> then QuickAFL is in force on a subset.
>> >> 
>> >> -- BruceR
>> >>
>> > 
>> > 
>> > 
>> > 
>> > ------------------------------------
>> > 
>> > **** IMPORTANT PLEASE READ ****
>> > This group is for the discussion between users only.
>> > This is *NOT* technical support channel.
>> > 
>> > TO GET TECHNICAL SUPPORT send an e-mail directly to 
>> > SUPPORT {at} amibroker.com
>> > 
>> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>> > http://www.amibroker.com/feedback/
>> > (submissions sent via other channels won't be considered)
>> > 
>> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> > http://www.amibroker.com/devlog/
>> > 
>> > Yahoo! Groups Links
>> > 
>> > 
>> >
>>
> 
> 
> 
> 
> ------------------------------------
> 
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
> 
> TO GET TECHNICAL SUPPORT send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
> 
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> Yahoo! Groups Links
> 
> 
> 


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/