Have you ever wondered how to properly track your trading performance based on risk rather than just profits? This template solves that problem by implementing R-multiple tracking directly in TradingView's strategy tester.
This script is a tool that you must update with your own trading entry logic.
Quick notes
Before we dive in, I want to be clear: this is a template focused on R-multiple calculation and visualization. I'm using a basic RSI strategy with dummy values just to demonstrate how the R tracking works. The actual trading signals aren't important here - you should replace them with your own strategy logic.
R multiple logic
Let's talk about what R-multiple means in practice. Think of R as your initial risk per trade. For instance, if you have a $10,000 account and you're risking 1% per trade, your 1R would be $100. A trade that makes twice your risk would be +2R ($200), while hitting your stop loss would be -1R (-$100). This way of measuring makes it much easier to evaluate your strategy's performance regardless of account size.
Whenever the SL is hit, we lose -1R Proof showing the strategy tester whenever the SL is hit: i.imgur.com/y4GxZAt.png
The magic happens in how we calculate position sizes. The script automatically determines the right position size to risk exactly your specified percentage on each trade. This is done through a simple but powerful calculation:
This ensures that if your stop loss gets hit, you'll lose exactly the amount you intended to risk. No more, no less. Well, could be more or less actually ... let's assume you're trading futures on a 15-minute chart but in the 1-minute chart there is a gap ... then your 15 minute SL won't get filled and you'll likely to not lose exactly -1R This is annoying but it can't be fixed - and that's how trading works anyway.
Features
The template gives you flexibility in how you set your stop losses. You can use fixed points, ATR-based stops, percentage-based stops, or even tick-based stops. Regardless of which method you choose, the position sizing will automatically adjust to maintain your desired risk per trade.
To help you track performance, I've added a comprehensive statistics table in the top right corner of your chart. It shows you everything you need to know about your strategy's performance in terms of R-multiples: how many R you've won or lost, your win rate, average R per trade, and even your longest winning and losing streaks.
Happy trading!
And remember, measuring your performance in R-multiples is one of the most classical ways to evaluate and improve your trading strategies.
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.