TradingView
elScipio
24 mai 2022 10:58

Risk Management & Position Size Dashboard 

BTCUSDT SPOTBybit

Description

Risk Management and Position Size Calculator

This indicator is designed to assist traders by instantly providing the necessary information to execute orders based on defined risk parameters. This is not an indicator that tells you WHEN to buy or sell, but HOW MUCH to buy or sell based on your risk appetite. The indicator is compatible with any strategy and any instrument

The indicator uses some great pinescript features, allowing you to drag and drop your levels directly on the chart for instant feedback from the risk management dashboard. Huge timesaver.

Instructions:
1. The first time you add the indicator to your chart, you will be asked to identify your Entry, Stop and Target levels by clicking on them directly on the chart. You can at any point adjust these levels directly on the chart, or you can manually enter them in settings

2. Setup your risk profile in the indicator settings:
(a) Current Capital: Enter the current value of your trading account
(b) Max Risk Per Trade: Enter the maximum % of your Capital you want to risk per trade
(c) Max Leverage: Enter the maximum leverage you want applied to your account. This comes in handy when you trade on very low timeframes where position sizes can become very large. No matter what you enter here, position size will never exceed Max Risk Per Trade
(d) Stop Ticks: Number of ticks to use above/below the identified high/low for stops
(e) Use Current Price as Entry (Market Orders): By default, the system will use the entry level you have selected for limit orders. If you want to use the system to display data based on current price for market orders, select “Use Current Price as Entry (Market Orders)”

3. Based on your stop and target levels, the system will automatically display the dashboard for Longs (bottom of screen) or Shorts (top of screen). The levels will also be displayed to the right of the current price bar

4. Display Free Trade Level: toggle this on to display the level you should exit 50% of your position to make the trade risk free

5. Dashboard / Text size and level colours and positions are customisable

The Dashboard displays the following information at all times:

1. Entry
2. Stop
3. Trade Risk (%): Percentage price difference between Entry and Stop
4. Max Risk ($): Currency value of loss if the trade is stopped out
5. Size: Position Size to execute your trade based on your risk profile/appetite
6. Size($): Position Size in currency value
7. P&L($): Potential profit to your Capital in currency value
8. P&L(%): Potential profit to your Capital in %
9. R:R: Risk to Reward Ratio
10. % to Target: Percent price needs to move to achieve your target

Hope this helps you with your trading. I built this as I was tired of wasting time opening up spreadsheets or calculators to execute trades - especially on lower timeframes. Making the code open source so if you do make improvements to this I'd love to hear from you. Also open to suggestions.

Happy Trading!

Notes de version

updated screenshot

Notes de version

Aesthetic Update:
Added option to colour fill :
- trade risk to entry; and
- entry to target levels
Adjustable in settings

Notes de version

Added ability to adjust the levels position on the chart - allowing for multiple instances of the indicator to be applied simultaneously. Useful for hedging.

Notes de version

Bug fix

Notes de version

Updated to include fee per trade as an input. Used to:
- Calculate and Display Net Target P&L
- Calculate the actual Free Trade level

Notes de version

fixed incorrect calculation for free trade using fees

Notes de version

- Added "Risk to Account" to the dashboard. This is the total risk to your account factoring in fees. This is useful to keep an eye on especially if leverage is high. If Risk to Account is greater than your Max Risk Per Trade appetite, then you want to consider reducing your position size before pulling the trigger

- Fixed a bug in the free trade level.

Notes de version

A multi timeframe Three moving averages indicator
Commentaires
fronk_pachonk
Hey @aj7919, did you just accidentally replace all the code with 24 lines of "three moving averages"?
bubblyAnalyst6866
@fronk_pachonk, I believe so xd
BarneyG
Hey dude, for some reason its not displaying the risk free zone?
finsterwu
This is really helpful! Just a couple of questions:
1. Colors of the lines and the free trade line do not appear. How can I change this?
2. In my case Trading fee is set at 0.06%. Is this round trip? So Entry and exit cumulative?
elScipio
@finsterwu, hi you can change the colours in settings ... and yes factors in entry and exit fees
Qxlar
Hey I put the max leverage at 1 and at 0 and the risk to account % kept going up if you dropped your stop loss to near the entry like it would with other amounts of leverage is this a mistake or have I been thinking about it wrong

Thank you in advance
elScipio
@Qxlar, hi - yeah the risk to account will increase as the position size increases due to fees regardless of leverage. If Risk to Account is greater than your Max Risk Per Trade appetite, then you want to consider reducing your position size before pulling the trigger
ElevenMay2022
Kindly add the option to change the text color and size for light background users. thanks
elScipio
@ElevenMay2022, Hi, this is already available in settings. "Text" under colours will change the text colours on the chart. "Text Size" will change the text size.
Plus