Leverage support in Long and Short Position tools

Oct 27

We keep improving our charting tools, and today we’re introducing leverage settings for Long and Short Position tools.

With leverage, you can make your trades better reflect real-life conditions by linking your position size to your account balance. This update allows you to set leverage so that your position size stays aligned with, or within, your available budget.

To configure leverage, open the tool’s settings, find the Leverage field, and enter the desired value. For example, setting 500.0 corresponds to 500:1 leverage.

How position size is calculated

With the introduction of leverage, the logic behind position size calculation has been updated. The final position size (Qty) is determined like this:

  1. Calculating QtyRisk based on the defined risk level:
    1. For long positions:  QtyRisk = (Risk size / ((Entry price – Stop price) * Point value)) / Lot size
    2. For short positions:  QtyRisk = (Risk size / ((Stop price – Entry price) * Point value)) / Lot size
  2. Calculating QtyLvg based on the account size and leverage: QtyLvg = (Account size * Leverage / Entry price) * Point value / Lot size
  3. Determining the final position size by selecting the smaller of the two values: Qty = min(QtyRisk, QtyLvg)

This means that risk defines the maximum position size, while leverage ensures the proposed position remains proportionate to your account balance.

For example, you can place a long position as shown below. 

In a standard setup (without leverage), the calculated position size might exceed your available account balance. However, with leverage — for example, 5:1 — the position size decreases, becoming more consistent with your set budget while still respecting the defined risk limit.

We hope this update makes working with Long and Short Position tools even more convenient and realistic. As always, we welcome your feedback — keep sharing your ideas to help us make the platform better.

Team TradingView

Look first Then leap

TradingView is built for you, so make sure you're getting the most of our awesome features