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

Re: [amibroker] Price-to-nearest-tick alogrithm



PureBytes Links

Trading Reference Links

Hello,
 
// TickSize = ... defines tick size
 
PriceRounded = floor( Close / TickSize ) * TickSize; // rounding down
PriceRounded = ceil( Close / TickSize ) * TickSize; // rounding up
 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: cstrader
Sent: Wednesday, October 31, 2007 7:25 PM
Subject: [amibroker] Price-to-nearest-tick alogrithm

For someone who is smarter than me, I have a question:
 
I would like to find an algorithm that locates the nearest tick (up or down, as specified) to a given price. 
 
for instance, if the price is 106.76, and the tick is 1.00, then I'd like to find either 106 or 107, as requested
 
Similarly, if the price is 1500.91, and the tick is .25, then I'd like to find either 1500.75 or 1501.00.
 
I'm sure it's simple....
 
tia
 
chuck
 
__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___