PROTECTED SOURCE SCRIPT

Position Calculator Magic Auto Long/Short (Crypto)

186
This tool was built by a trader, for traders. The idea comes from how we actually look at the market — whether you’re going long or short, the process should be simple and clear.

In TradingView, we have a built-in position size calculator, but I often found myself running into problems. For example, whenever I wanted to switch between long and short trades, I had to manually switch btw long / short RR PS calculator, and sometimes I even got confused with icon. On top of that, when switching btw long /short each time it personally made me so frustrated , which made the process slower to caculated the Position size | Position value for particularly for Crypto trading

That’s why I created this tool: to solve those problems and make Crypto trading smoother.

Here’s how it works:
• If you want to enter at the current market price, just drag the tool and set your stop-loss.
• It will automatically calculate your targets according to your chosen risk–reward ratio.
• For example, if you trade with 1:3, you just set it to 3, and the tool handles the rest. If you trade with 1:2, set it to 2, and it calculates accordingly.

The real magic I built into this script is the draggable function. Instead of changing tools for long and short positions, you just drag it to the opposite side: it switches automatically between buy and sell mode while keeping your risk–reward intact.

Let’s take an example. Suppose you’re entering a short position at $113,745 with a stop-loss at $115,000. The tool instantly adjusts your position size and calculates the correct risk–reward based on your settings.

Personally, I risk 1% per trade. So if my account is $1,000, that’s a $10 risk. The tool calculates the position size automatically

Switching to long is just as simple: drag your stop-loss below entry, and the tool flips into long mode.drag your stop-loss above entry, and the tool flips into short mode.

I also added a manual TP override feature. Normally, I trade 1:3 risk–reward, but sometimes I want to target a specific high or low that doesn’t fit into a fixed RR. With manual override, you just enable it, drag your take-profit where you want it, and the tool recalculates everything. For example, you might end up with a 1:5.8 setup instead of a fixed 1:3.

So whether you stick with fixed RR or want the flexibility to adjust, this tool makes the process much easier.

I hope you find it useful and that it helps you trade with more clarity and confidence.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.