Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

math rounding function Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
anderton
Posted : Friday, October 19, 2012 11:42:52 PM
Registered User
Joined: 11/27/2004
Posts: 85

http://forums.worden.com/default.aspx?g=posts&t=23816

I have searched through the info on the above thread link but could not find a rounding function or operand. I also did a search on round / rounding but didn't come up with anything.

Is there one available that I am missing? 

Thanks

anderton
Posted : Sunday, October 21, 2012 8:30:30 PM
Registered User
Joined: 11/27/2004
Posts: 85

A little more information on what I am trying to do.

I would like to find stocks that are trading within a few cents +/- or the whole dollar or half dollar price.

Example:  price at 101.02 or 100.96 or  52.53 or 51.45

Using the round function I could find the whole dollar figure then subtract the price from the rounded number and determine if the remainder was within the paramerter/s wanted.

Thanks

Bruce_L
Posted : Monday, October 22, 2012 11:30:59 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The Personal Criteria Formula Language does not have a built in rounding function. I think you can use a combination of division, integer division and multiplication to do what you want however. For example, the following should only return true when price is within five cents of a fifty cent boundary.

ABS((C - (C / .5) \ 1 * .5)) < .055



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
anderton
Posted : Monday, October 22, 2012 12:31:43 PM
Registered User
Joined: 11/27/2004
Posts: 85

Hello Bruce,

Thanks for the reply.

I will see how it plays.

 

Bruce_L
Posted : Monday, October 22, 2012 12:32:37 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.