Ameobea / algobot3

Third iteration of the algorithmic trading bot I've been working on.
5 stars 0 forks source link

Database Number Rounding #4

Open Ameobea opened 8 years ago

Ameobea commented 8 years ago

All data stored in the database should be rounded off to an appropriate number of decimals before being stored.

dalexj commented 8 years ago

+1

Ameobea commented 8 years ago

0/10 bad

nii236 commented 8 years ago

An alternative would be to store all the values as integers. That's how Bitcoin handles all of their transactions as an example (satoshis sent around as integers)

Ameobea commented 8 years ago

@nii236 that's an interesting idea! Could make certain calculations easier.

nii236 commented 8 years ago

It'll be faster and more precise, but you have to remember to convert back and also handle currencies with large denominations (20k Vietnamese Dong (!) to the Dollar for example).