Below is the Python code for a Forward Contract n Python. The code is in PDF format (for copy paste)t and in ipynb form.
This code isfor figuring out how much an oil trade will cost. You give it two basic pieces of information: the price of one barrel of oil and how many barrels you want to buy.
Then you can add extra costs like shipping fees, insurance, or storage. The code also lets you apply discounts (if you're buying a lot), add taxes, include broker fees, and even convert the final price to a different currency. It calculates everything step-by-step and shows you each cost as it goes, then gives you the final total price for your oil purchase.