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

Re: [amibroker] rounding the buyprice



PureBytes Links

Trading Reference Links

Yuki,
	it's in 

http://groups.yahoo.com/group/amibroker/files/PLUGIN DLL/ASXtick.zip

but since you really only want the docs, here they are.

	Nigel


On Mon, 3 Mar 2003 08:52 pm, Yuki Taga wrote:
> Hi Nigel,
>
> Sounds interesting, but I cannot seem to locate that particular file
> in the files section.  I can't find anything at all posted by you,
> however there are a number of ASX-specific files posted, but none I
> see by the name of ASXtick.zip.
>
> Yuki
>


AmiBroker Indicator Plugin -- ASXtick.dll

Utility functions for manipulating prices in terms of ASX ticks

ASX rules for tick size.
    - price <= 10c, tick is 0.1c  ($0.001)
    - 10c < price <= 50c, tick is 0.5c  ($0.005)
    - 50c < price, tick is 1c  ($0.01)
        
Additional rules implimented in the plugin.
    - price < $0.00, tick is undefined, price will be adjusted to 0.00.
    - price == {Null} (AmiBroker undefined value), any {Null} input value
      will cause the return to also be {Null}.
    - price > $21,474,834 it's gunna give the wrong answer.  I don't care!!



nrASXTICK
============
Syntax:     nrASXtick(ARRAY, [delta=0], [round=0])
            
Returns:    ARRAY

Function:   Converts supplied array to legal ASX values (eg 0.103 -> 0.105)
            It adds (constant) 'delta' ticks, and returns the result.
            If you need to add time variant ticks, use to toticks() and
            fromticks() functions.  See below.
            
            If round=0 (the default), the supplied array is rounded to the 
            nearest tick; if -ve, to it's floor; if +ve, to it's ceil.
            
Example:    MAt = nrASXtick( MA(C,22) );
            Rounds MA(C,22) to tick values.
            
            Trailingstop = nrASXtick(Ref(L,-1), -2, -1);
            Sets Trailingstop to 2 ticks less than yesterday's low.
            (Nb. 0.105 - 2 ticks is 0.099, 1 tick of 0.005 and one of 0.001.)


nrASXTICKDIFF
=============
Syntax:     nrASXtickdiff(ARRAY1, ARRAY2, [round=0])
            
Returns:    ARRAY

Function:   Converts the supplied arrays to legal ASX values and returns
            the difference between them in ticks.
            
Example:    ROCtick = nrASXtickdiff(C, Ref(C,-1)); Gives the ROC in ticks.
            And nrASXtickdiff(0.75, 0.05) is
                  25*0.01  +  80*0.005  +  50*0.001  =  155 ticks


nrASXTOTICKS
============
Syntax:     nrASXtoticks(ARRAY, [round=0])

Returns:    ARRAY

Function:   Converts a price array to number of ticks above 0.

Example:    To calculate the stdev *measured in ticks* of close
            Tickstdev = stdev(nrASXtoticks(Close), 14);
                    
            I'm not sure how statistically valid this is, but....

            
nrASXFROMTICKS
==============                            
Syntax:     nrASXfromticks(array)
    
Returns:    ARRAY

Function:   Inverse of nrASXtotick().  Coverts a tick array back to prices.

Example:    A psuedo-bollinger-band, based on movement in ticks.

                pBBcenterT = nrASXtoticks(MA(C,20));  // MA converted to ticks
                pBBstdevT = stdev(pBBcenterT, 20);
                pBBtop = nrASXfromtick( pBBcenterT + (2 * pBBstdevT));
                // Nb. pBBbottom will be truncated at zero. (It cannot be 
-ve.)
                pBBbottom = nrASXfromtick( pBBcenterT - (2 * pBBstdevT));

            If the previous example is sus' this one is even more so...
                    
                    





------------------------ Yahoo! Groups Sponsor ---------------------~-->
New Yahoo! Mail Plus. More flexibility. More control. More power.
Get POP access, more storage, more filters, and more.
http://us.click.yahoo.com/Hcb0iA/P.iFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/