I wondering how do I can determine the source code value if someone want to buy it ?
For example, for $1000 product, how much is the source code value ?
You can not determine the value of your source code by the price you sell it for.
Source code value is based on what the product is worth to the person buying it. This worth varies based on things like:
The simplest way to set up a cost/effort estimate (which would ultimately lead to a value calculation) is to use the CoCoMo or the Constructive Cost Model. Though there are various methods to calculate the price of a source code, I prefer the CoCoMo model.
In order to learn more about the COCOMO model and the calculation method, click here.
Apart from putting the values from the buyer perspective as enumerated by Gary, you need to calculate your opportunity cost as well.
If you are selling a piece for $1000 and there is a market for 10 units in a month, you make $10,000. You can take a cut say 20% for the maintenance of your website and other supports. This is profit lost by you. This should be calculated in a somewhat conservative manner and very optimistic manner. Typically you should account for 24 months of profit lost in such cases.
It may so happen, that you have spent $20000 worth of effort on the product, and ultimately fees that it is not worth that much, you have to take a call based on lost profit basis.
It is better to create a spreadsheet with all the cost, possible profit and other scenario. This will give you a clarity and help you in taking a decision.