# How to programmatically define financial leverage?

Financial leverage could be easily described as the tool that allows traders to multiply returns at the cost of multiplying also the risk involved in every trade. So, for instance, if a stock today costs 10\$and tomorrow it appreciates up to 11\$, the trader would experience a return of: $$R = (\frac{11}{10} -1)*100 = 10\%$$

While, by using a leverage of - let's say 2x - the return would still be: $$R = (\frac{22}{20} -1)*100 = 10\%$$