OPEN-SOURCE SCRIPT

Scalper's toolkit - ATR Widget

Обновлено
Widget specifically designed for scalping. Many settings to fit the instrument and view preferences to make it fit into your chart window how you like, even on mobile.

** I have 5 other features to add into this in the very near future, as I use this as my primary tool for Risk reward. This script will be updated in the near future as more features are coded into it. See bottom for notes on plans

Features:

Displays a quick view of the ATR value on the chart, in decimal PIPs or directly in Points - a key value for scalping using the DOM for point value settings and one click trading on fast time frames.

Automatic calculation of stop and target distance for a predetermined Risk Reward Ratio (Set with the settings panel), and then also displayed in PIPs or Points for easy use in quick trading.

Works on most all instruments/pairs/cryptos with multiple precision levels for correct values to be shown in the widget.

Fully customizable -
ATR period Base setting, just like a normal ATR indicator
Display in : PIPs or Points
ATR based stop distance, using a multiplier. 2 is the most common multiplier used, and the default setting.
Risk Reward Calculation using the Stop Loss value.
-Quickly helps with proper target and stop sizing for the volatility in the price on the current trade entry point.
-Set to any ratio you wish, from 1:0.1 all the way to 1:100 or more, unlimited R ratio settings to fit your strategy and risk tolerances.
Position anywhere on the chart window with 9 preset locations available (Pine script limitation)
Show as a column layout or a row layout
Customize the Size, with 5 preset widget sizes, from tiny to huge (Pine script limitation)
-Mobile Friendly - Tiny or Small may be too small on PC, but can be used for Mobile so the widget does not become too large over the chart.
Custom text, background, and boarder colors
Custom Boarder Size - 0 size is no boarder

Set up:

-Open the settings panel.
First section is the basic settings for the ATR - the length (Default is 14) and to use a PIP value display, or Point value display.
Here you also see a "Precision" Setting. **Because each instrument returns different precision ATR values, it is difficult to determine with code what those values will be ahead of time to do the math in the background. Even some 2 decimal instruments return 5 decimal ATR values, so this setting filters that** Just use the dropdown and choose how many decimal places the instrument has from 2 - 5 decimals

The second section is for risk and reward calculations, and can be disabled if you do not want to see these values.
The first value is the "ATR Multiplier" Typically, a 2x multiplier is used on the ATR to determine how far away to place your stop loss from the entry, placing it out of harm's way from normal market activity.
The second value is the Reward target distance, based from the stop loss size. This quickly calculates your target to match your intended reward ratio, saving some manual work to calculate this by hand every trade.

** Note: because of the math used in the code, you may see odd values on some instruments, like indexes. If you have the precision correct, try changing the "Show in Pips" to "Show in Points", as this may solve the issue.

The last two sections are purely for how the widget looks and how/where it shows on the screen. These can be set however you like. To have no boarder, just set the "Frame size" value to 0.


Additional Updates planned:
Pip value calculation (2 feature uses)
-This will serve 2 purposes. The widget will calculate the value of the trade based on the lot size. It will also have a risk limit, so if the ATR get's too high for the current risk settings, It will show red to warn you of a high risk situation before you trade.
Example, you have a set limit of 3 dollars per trade using .02 lot sizing. If the ATR get's too high, The Stop value will be more risk than you would like to use at that trade sizing. Reduce the trade size, or wait for ATR to come lower.
Purpose 2: lot size calculation, so if you wanted to maximize the use of risk available. If you wanted to risk 600 for example, it would use the ATR you have set for the risk, and determine the proper lot size for the amount of volatility in the market. This way, you Risk Exactly, or as close as possible to 600 for the the current trade conditions.

Extra use for this value: Show the Current trade amounts at risk and for gain in money values on the side of the pip/point value. Know what you're risking and also trading for in monetary value.

ATR candle Comparison- Early momentum Detection (2 feature uses)
Will show an additional section on the bottom of the widget to show how each candle compares to the one before, up to the last 5, and show if ATR went down, up, or stayed the same over the last 5 candles.
Show an additional symbol to indicate the current candle status in comparison to the close of the last candle. Real time of if the ATR is getting larger, smaller, or staying the same.
Информация о релизе
Updated the math, Automatic for everything now :)

Added an override, for those that want to still see actual atr data.

Still has pip or point option, and auto calculates the differences.

Updated the name, still mostly ATR for now, but as more things get added, the script will change to become just "Scalper's Toolkit"

I will add pip value and max lot/max risk alert/color change next
Информация о релизе
Redo of the math, finding the universal formula to account for all assets is quite a challenge. Will need to add some more math to account for e-mini and other instruments where 1 point is not 1 point value (e mini 25 per point for example)

Re organized the options and changed the override to just be a standard option

Streamlined and reduced the code to be smoother and more optimized.

Will try to add the pip value/trade value math next, once market reopens I tend to binge watch the price action and not work much on the script, so I'll try to get it before we open again :)
Информация о релизе
Risk Calculator -

Super Major Update!

Can be almost entirely automatic, or take control and manually set the values to calculate a trade.

Now supports a dynamic ATR multiple or fixed point size Stop loss

Works on all time frames

Now does a lot more math:

Forex:
Calculate the pip value and lot sizing automatically for your risk tolerance and account currency.
Use a manual lot size and Fixed Stop size to pre calculate a trade easily, and see the value of the outcomes

Stocks:
Automatic calculation for max number of shares for your risk tolerance (will use the amount of risk for total shares, not account value)
Shows values of the stops and targets
(*Risk coloration may not be entirely correct, still needs a test or 2 for the correct triggers to work out correctly, but I have reached a checkpoint of getting to the next working stage of the script, and unfortunately a bit tired with forex market open coming up ...)

Coming soon:
Crypto/Indices/E-Mini/Futures/Custom

Stock risk math will need a slight bit more work, but can be repurposed to figure other instruments in the future. It may show "Over risk" if you can not afford to buy 1 share of the stock at it's current price, will not be affected by stop or target values (yet....)

Please see tooltip explanations for how to use the additional settings.

VERY IMPORTANT:
You must agree to the Risk Warning for the values to show. Because of various factors from different broker settings to simple rounding, and just the number of currencies in the world, the values can not be 100% accurate. I did get accurate results checking the major 28 with USD/EUR/GBP account currency, and stocks seemed to work as well (They calculate to USD only), but some exotic pairs or non common trading account currencies may cause the numbers to be wrong. Please be familiar with the instruments you trade, as I do not want to be responsible for a "Your indicator said..." situation. Values are for reference only.
ATRAverage True Range (ATR)calculatorriskmanagementtoolriskrewardriskrewardratioscalpingtool

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?

Отказ от ответственности