# How to dynamically update/calculate the price if we have the following values?

Need to update/calculate the price, the given values are:

1. Reserve (Stock) (higher the price can be lower)
2. Cost (the higher, the price can be higher)
3. Sales Speed (the higher, the price can be higher)
4. The pieces were sold at the current price (the higher, the price can be higher)
5. Views (the higher, if the Add to Shopping Cart or Buy now is lower, the price can be lower)
6. Add to Shopping Cart (the higher without buy, the price can be lower)
7. Buy now (direct buy) (the higher, the price can be higher)
8. Success Purchase (the higher, the price can be higher)

What my idea is: the price can be calculated independently in some values e.g: 1, 2 and 3. and about others can be calculated together, because they have relationship with each other, e.g: Views and Add to Shopping Cart or Add to Shopping Cart and Buy now which Buy now indicates the price can be higher etc... So I do not know if the idea is correct, or if there will be more better way to calculate the price from these values.

For example:

• Current item price is: 150\$
• Cost is: 100
• Reserve (Stock) is: 1000 peaces
• Sales Speed is: 12 peaces/day
• The pieces were sold at the current price is: 70 peaces
• Views is: 950 times
• Add to Shopping Cart is: 150