OPEN-SOURCE SCRIPT

Position Size for ATR Trailing Stop

Updated
This indicator will calculate your position size, short or long, based on the ATR Trailing Stop indicator of mine, and are needed to be used together. General risk management suggests risking just 1 percent of your equity and using low leverage.
Release Notes
Changed the Equity to be Float with no minimum value so you can set it to XBT Satoshi value.
Release Notes
This new version allows you to set Manual Entries rather than the current price in case you want to set Limit Orders, and Manual Stops in case you want to override the ATR Trailing Stop and set your own instead. It thus becomes a general purpose Position Size Calculator.
Release Notes
The original version was designed with XBTUSD on BitMex in mind, this new premium version deals with BTC pairs on Mex, or equity that is valued in USD(T) like Bitfinex. It also includes fees within the risk percentage, and you can set what percentage for fees based on whether you are using a market order and paying the Taker fee for entry, or a limit order and receiving the Maker rebate, though I suggest assuming a Stop Market gets hit for dealing with worst case scenario on total risk.
Release Notes
Added ETHUSD on BitMex position sizing, which has an unusual contract size.
ATRpositionpositionsizeSIZEstopsVolatility

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer