Trade Helper [Trading Nerd]Position Size Calculator / Lot Size Calculator
Disclaimer: I do my best to avoid wrong calculations and bugs. I provide this indicator without warranties of any kind. You bear all risks associated with the use of this indicator.
Inputs:
Market: Adds a name tag to the Table to keep track of the trades.
Entry Price: The entry Price of the Position.
Entry Time: The entry Time/Candle of the Position. If Stop Loss Type is 'ATR' or 'HH/LL' the Value for this is calculated by this Candle.
Stop Loss Type: Changes the Stop Loss Type.
Direction: Define if the trade direction is 'Long' or 'Short'. Has no effect on Stop Loss Type 'Custom'. For this you can just set the Stop Loss below/above the Entry Price .
ATR Multiplier: Multiplies the ATR Value by this number. Has only an effect on Stop Loss Type 'ATR'.
HH/LL Lookback Length: Lookback length for determine Highest High/Lowest Low value. Has only an effect on Stop Loss Type 'HH/LL'.
Custom SL Price: The Stop Loss Price if the Stop Loss Type is set to 'Custom'.
Risk Reward Ratio: The Risk is multiplied by this number to determine the Take Profit Price.
Balance: Balance Amount and Currency
Contract Size: The Position Size is divided by this number. E.G. in Forex one Lot is 100.000 Contracts. Change this Value depending on your Broker and Market.
Risk in %: Percent that is risked of the Balance for one Trade.
Ortalama Gerçek Aralık (ATR)
ATR Table (SMA)ATR table for select time frames.
Using Simple Moving Average (SMA) to get ATR.
MA periods is based on numbers suggested by Saeed Khakestar (Trigger Price Action)
You can change them in code
5m => 12
15m => 16
1H => 24
4H => 42
1D => 30
1W => 52
RSI is calculated the same way
Configurable Multi MA Crossover Voting SystemThis strategy goes long when all fast moving averages that you have defined are above their counterpart slow moving averages.
Long position is closed when profit or loss target is hit and at least one of the fast moving averages is below its counterpart slow moving average.
The format of the config is simple. The format is : FASTxSLOW,FASTxSLOW,...
Example : If you want 2 moving averages fast=9,slow=14 and fast=20,slow=50 you define it like this : 9x14,20x50
Another example : 5x10,10x15,15x20 => means 3 moving average setups : first wih fast=5/slow=10, second with fast=10/slow=15, last with fast=15/slow=20
You can chose the type of moving average : SMA, WMA, VWMA (i got issues with EMA/RMA so i removed them)
You can chose the source of the moving average : high, close, hl2 etc.
You can chose the period on which ATR is calculated and ATR profit/loss factors.
Profit is calculated like : buy_price + atr_factor*atr
Loss is calculated like : buy_price - atr_factor*atr
Performance in backtest is variable depending on the timeframe, the options and the market.
Performance in backtest suggests it works better for higher timeframes like 1d, 4h etc.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
ATR Bands with QQE [LM]Hello traders,
I would like to present you ATR Bands with QQE. This indicator is different than my other indicators I used QQE oscillator as an entry indicator, and atr bands I have used as an exit indicator.
You can see 2 set of bands with different multiplicator, first is used as first target profit, stop loss and second as a second target
There are two modes that takes, first is static mode that gives you lines with 1st, 2nd target profit and in red color stop loss.
Second mode has static first target and trailing stop loss
Settings:
Genreal settings - basic setting of source for atr bands, line settings,
First atr bands setting
Second atr bands setting
QQE settings
Cheers,
Lukas
Stochastic + Keltner Channels for ScalpingSimple arrow indicator, indicating the direction go the next slight movement. This indicator will work on any time frame or market.
How does this indicator work?
It will use Stochastic and Keltner Channels to detect potential reversals depending on the frequency you choose in the indicator's settings. The higher the frequency, the fewer candles will be used in the calculation.
When to use this indicator?
It will work better in higher time frames for low volatility indicators. You can mix with other indicators like RSI or ADX. This way, you will be able to check if the time selected frame has enough volatility to move the price enough to cover the spreads and fees of your broker.
When to exit the trade after the signal from this indicator?
A good target would be for 1x ATR value and stop-loss 2x the ATR value. Doing trailing stop will reduce your risk and secure some profits, but make sure to use values for possible fakeouts
Can this indicator be used alone as the main source of entry signal for the trades?
You can use it alone, but I recommend mixing with other trend-based indicators, like Moving Averages, so you get the best results. Since it's for scalping purposes, small moments, and reversals, it doesn't have the trend filter, but it can work trading in favor of a significant trend as well
this is a better version of my other script Scalping Arrows
Lot Size by doclribeiroThis script calculate which values should LOT, SL and TP be to trade the pair selected on TM
By default SL and TP are calculated using ATR: timeframe 1H for SL and timeframe 15min for TP.The user can also specify the SL and also the TP, or the amount of pipets to calculate SL or TP.
Kind Regrads
Miguel Campos
Trailing Stop AlertsThis script is designed as an ATR-based trailing stop tool to assist in managing open positions.
Once you're involved in a profitable trade, if you add this script to your chart you'll be prompted to select a bar to begin trailing from.
You can then adjust the candle lookback distance for swing high/lows (7 by default), the ATR multiplier (1.0 by default), and the direction to trail (Long/Short).
You can also adjust the ATR period in the settings menu if you want to (14 period by default).
Once the script is added to your chart, it will begin drawing your trailing stop and you can then set up alerts.
Alert Options:
Any alert() function call : Will trigger an alert for both conditions (trailing stop updated, trailing stop hit)
Alert Conditions : Trailing Stop Update will trigger whenever the stop is updated, Trailing Stop Hit will trigger whenever the stop is hit.
Note: the alerts will only fire once per bar close and the trailing stop will not update on realtime bars.
ATR Bands with vortex indicator [LM]Hello traders,
I would like to present you ATR Bands with vortex indicator. This indicator is different than my others I used not that known vortex indicator as a entry indicator, and atr bands I have used as a exit indicator.
You can see 2 set of bands with different multiplicator, first is used as first target profit, stop loss and second as a second target
There are to modes that takes, first is static mode that gives you lines with 1st, 2nd target profit and in red color stop loss
In the static mode you can also turn off extending line he price reach the level:
Second mode is tracking atr first band with candle offset of your choosing:
The trailing functionality is not working 100% but I as thinking to share it anyway and see maybe some feedback and meantime I will fix the trailing behavior.
Settings:
Genreal settings - basic setting of source for atr bands, line settings,
First atr bands setting
Second atr bands setting
Vortex setting
Cheers and Happy Xmas,
Lukas
Supertraders ATR-RangeThis script calculates the ATR 5 periods daily of previous day and various percentages (5%, 7,5% and 10%) of it that we use to evaluate a possibility to try a break-in of a level. This percentages are expressed in points, ticks and a value in dollars for every contract.
Questo script calcola l'ATR daily 5 periodi del giorno precedente. Calcola anche varie percentuali di esso, in particolare 5%, 7,5% e 10%, utily per verificare lo sforamento in caso di break-in di un livello. Questi valori sono espressi in punti, ticks e valore in dollaro per contratto.
ATR %plot ATR as percentage relative to close price and also shows normal ATR value in datawindow without printing it
Impulse levelsThe indicator detects impulses based on an increase in ATR and volume, and also plots levels based on these impulses.
ATR vs Daily DeltaThis indicator follows the idea of the average true range indicator, but splits red candles from green candles. It also displays daily deltas as a histogram chart. Finally, it allows you to "normalize" the indicator, which displays period percentage moves (shown in decimal form) instead of period deltas, and calculates the ATR from those percentages instead of period deltas.
Supertrend - Ladder ATRThis is a supertrend with slight twisted concept which can be very benefecial in strong trending markets to reduce stop loss distance and exit slightly quicker.
⬜ Concept
▶ When the instrument is trending up, regular ATR shows high values if there are big green candles. This affect the stoploss distance in regular supertrend which leads to wide stops or delayed lagging. When you are in long trade, what matters for stoploss is how much a negative candle can move within bar. Hence, using ATR derived only based on red candles is more beneficial for trailing stops on long signals. Same applies to short trades where using ATR derived from only green candles is more efficient than overall ATR.
▶ ATR will be minimal when the volatility is less and ATR will increase with volatility. That means, once you are in trade, the trailing of stoploss also will vary based on ATR (or volatility). With regular ATR and supertrend, chances of stop loss distance widening is high with increased volatility even though stoploss levels will not move down. This again poses the risk of higher drawdown during trade closure and also keeps in the trade during ranging market. To avoid this, the second trick we are using here is only to reduce the atr stoploss difference when in trade. That is, when in long trade and negative candles ATR is increasing, we will not consider that. We will consider the new ATR only if it is lesser than previous bar ATR.
Effect of these changes on the trending market is quite visual. Lets take example of USDTRY
Settings are quite simple and does not vary much from regular supertrend settings.
Outside DayThis strategy is taken from Perry Kaufman's book "Trading System and Methods".
You can enter on the direction of the candle, or opposite to it. I find that the opposite tends to yield better results in volatile assets, allowing a better reward to risk ratio. There is no stop loss in this strategy, only a fixed take profit and a time limitation.
Hull MA TimeFrame CrossOverHello traders,
Although this strategy is configured on BTCUSDT , with a changing of settings, it can be used on any trading instrument.
Here it is seen, on the 2 hour chart. With Trading Fees included in result (adjust to suit your exchange fees).
The candle crossover is set to Daily timeframe.
That means that the Candle crossover is going to see if todays price is higher than yesterdays price.
If user sets this to 4 hour timeframe, the candle crossover would be when price is higher than the the price 4 hours ago...
The rest is simple, a moving average to detect direction, and an ATR StopLoss (if activated).
There is StopLoss and Take Profit settings which work by percentage.
The periods of the moving average and the ATR can be adjusted, as can the TP % and SL %.
The price is taken from the CLOSE or the OPEN or OHLC4 etc... which can be changed in the settings. OPEN is recommended to avoid repainting.
The moving average also has selectable types (ALMA,SMA,EMA,WMA,HMA)
So if the Price is above the Moving average, and the moving average is above the alternate timeframe value, then a buy is activated
if the Price is below the Moving average, and the moving average is below the alternate timeframe value, then a sell is activated
if OPEN is selected as Price source, then the alternate timeframe value would be the OPEN of the alternate timeframes candle.
the values are all plotted on chart so user can see what is happening when what crosses over what, and then what changes when settings are adjusted.
Have FuN!
if this strategy brings you the epik win......
.... dont forget about me
seaside420 ❤️
Double SupertrendThis strategy is based on a custom indicator that was created based on the Supertrend indicator. At its core, there are always 2 super trend indicators with different factors to reduce market noise (false signals).
The strategy/indicator has some parameters to improve the signals and filters.
TECHNICAL ANALYSIS
☑ Show Indicators
This option will enable/disable the Supertrend indicators on the chart.
☑ Length
The length will be used on the Supertrend Indicator to calculate its values.
☑ Dev Fast
The fast deviation or factor from one of the super trend indicators. This will be the leading indicator for entry signals, as well as for the exit signals.
☑ Dev Slow
The slow deviation or factor from one of the super trend indicators. This will be the confirmation indicator for entry and exit signals.
☑ Exit Type
It's possible to select from 4 options for the exit signals. Exit signals always take profit target.
☑ ⥹ Reversals
This option will make the strategy/indicator calculate the exit signals based on the difference between the given period's highest and lowest candle value (see Period on this list). It's displayed on the chart with the cross. As it's possible to verify in the image below, there are multiple exit spots for every entry.
☑ ⥹ ATR
Using ATR as a base indicator for exit signals will make the strategy/indicator place limit/stop orders. Candle High + ATR for longs, Candle Low - ATR for shorts. The strategy will show the ATR level for take profit and stick with it until the next signal. This way, the take profit value remains based on the candle of the entry signal.
☑ ⥹ Fast Supertrend
With this option selected, the exit signals will be based on the Fast Supertsignal value, mirrored to make a profit.
☑ ⥹ Slow Supertrend
With this option selected, the exit signals will be based on the Slow Supertsignal value, which is mirrored to take profit.
☑ Period
This will represent the number of candles used on the exit signals when Reversals is selected as Exit Type. It's also used to calculate the gradient used on the Fills and Supertrend signals.
☑ Multiplier
It's used on the take profit when the ATR option is selected on the Exit Type.
STRATEGY
☑ Use The Strategy
This will enable/disable the strategy to show the trades calculations.
☑ Show Use Long/Short Entries
Option to make the strategy show/use Long or Short signals. Available only if Use The Strategy is enabled
☑ Show Use Exit Long/Short
Option to make the strategy show/use Exit Long or Short signals (valid when Reversals option is selected on the Exit Type). Available only if Use The Strategy is enabled
☑ Show Use Add Long/Short
Option to make the strategy show/use Add Long or Short signals. With this option enabled, the strategy will place multiple trades in the same direction, almost the same concept as a pyramiding parameter. It's based on the Fast Supersignal when the candle fails to cross and reverses. Available only if Use The Strategy is enabled
☑ Trades Date Start/End
The date range that the strategy will check the market data and make the trades
HOW TO USE
It's very straightforward. A long signal will appear as a green arrow with a text Long below it. A short signal will appear as a red arrow with a text Short above it. It's ideal to wait for the candle to finish to validate the signal.
The exit signals are optional but give a good idea of the configuration used when backtesting. Each market and timeframe will have its own configuration for the best results. On average, sticking to ATR as an exit signal will have less risk than the other options.
☑ Entry Signals
Follow the arrows with Long/Short texts on them. Wait for the signal candle to close to validate the entry.
☑ Exit Signals
Use them to close your position or to trail stop your orders and maximize profits. Select the exit type suitable for each timeframe and market
☑ Add Entries
It's possible to increase the position following the add margin/contracts based on the Add signals. Not mandatory, but may work as reentries or late entries using the same signal.
☑ What about Stop Loss?
The stop-loss levels were not included as a separated signal because it's already in the chart. There are some possible ideas for the stop loss:
☑⥹ Candle High/Low (2nd recommend option)
When it's a Long signal from the entry signal candle, the stop loss can be the Low value of the same candle. Very tight stop loss in some cases, depending on the candle range
☑⥹ Local Top/Bottom
Selecting the local top/bottom as stop loss will give the strategy more room for false breakouts or reversals, keeping the trade open and minimizing noises. Increases the risk
☑⥹ Fast Supertrend (1st recommend option)
The fast supertrend can be used as stop-loss as well. making it a moving level and working close to trail stop management
☑⥹ Fixed Percentage
It's possible to use a fixed risk percentage for the trades, making the risk easier to control and project. Since the market volatility is not fixed, this may affect the accuracy of the trades
☑⥹ Based on the ATR (3rd recommend option)
When the exit type option ATR is selected, it will display the take profit level for that entry. Just mirror that value and put it as stop-loss, or multiply that amount by 1.5 to have more room for market noise.
EXAMPLE CONFIGURATIONS
Here are some configuration ideas for some markets (all of them are from crypto, especially futures markets)
BTCUSDT 15min - Default configuration
BTCUSDT 1h - Length 10 | Dev Fast 3 | Dev Slow 4 | Exit Type ATR | Period 50 | Multiplier 1
BTCUSDT 4h - Length 10 | Dev Fast 2 | Dev Slow 4 | Exit Type ATR | Period 50 | Multiplier 1
ETHUSDT 15min - Length 20 | Dev Fast 1 | Dev Slow 3 | Exit Type Fast Supertrend | Period 50 | Multiplier 1
IOTAUSDT 15min - Length 10 | Dev Fast 1 | Dev Slow 2 | Exit Type Slow Supertrend | Period 50 | Multiplier 1
OMGUSDT 15min - Length 10 | Dev Fast 1 | Dev Slow 4 | Exit Type Slow Supertrend | Period 50 | Multiplier 1
VETUSDT 15min - Length 10 | Dev Fast 3 | Dev Slow 4 | Exit Type Slow Supertrend | Period 50 | Multiplier 1
HOW TO FIND OTHER CONFIGURATIONS
Here are some steps to find suitable configurations
select a market and time frame
enable the Use This Strategy option on the strategy
open the strategy tester panel and select the performance summary
open the strategy configuration and go to properties
change the balance to the same price of the symbol (example: BTCUSDT 60.000, use 60.000 as balance)
go back to the inputs tab and keep changing the parameters until you see the net profit be positive and bigger than the absolute value of the drawdown
in case you can't find a suitable configuration, try other timeframes
Since the tester reflects what happened in the past candles, it's not guaranteed to give the same results. However, this indicator/Strategy can be used with other indicators as a leading signal or confirmation signal.
Average True Range NormalizedIntroduction
This simple script is the normalization of the common ATR indicator. The utility in normalization, in this case, is the contextualization of the absolute movements of the ATR compared to the previous candles. Not finding an indicator that reflected my needs, I created it and decided to make it available to the community.
The oscillator is fully based on the original ATR indicator, once normalized it varies its values between -50 and +50 and has a moving average based on it.
I added alarms:
- crossing of horizontal levels (default +40 -40)
- crossing of the moving average
Settings
ATR period : like a normal ATR indicator, the number of candles on which the ATR calculation is based
Smooth : like normal ATR indicator, type of moving average to smooth true range values
Normalization Period : Number of candles on which ATR normalization is based, it takes the maximum and the minimum values in the last N candles and creates the value -50 and +50, between these two values normalize the others.
MA Period : Period of MA based on ATR, this MA can be used like moving level to find the moment of low volatility
Type : Kind of MA, you can choose only between 3 types ( SMA, EMA, WMA )
Horizontal Lines Value : high and low level for high and low volatility
Alert on crossing Horizontal lines : enable alerts on crossing Horizontal Lines
Alert on crossing MA : enable alerts on crossing Moving Average
How to use
ATR isn't a directional indicator, but volatility is fuel for markets, low ATR values indicate quiet moments or consolidation movements, otherwise high ATR values indicate selling or buying pressure. A reversal in price with an increase in ATR would indicate strength behind that move.
The problem, for me, with normal ATR is that often the values have to be contextualized with older values, on the contrary being normalized you can:
- catch small fluctuations, and anticipate the decline;
- contextualize the values without having to look at the history in the previous candles
So:
- under MA or horizontal line the volatility is too low, it would be advisable to consider not opening positions;
- over MA line the volatility is raising and a reversal in price with an increase in ATR would indicate strength behind that move;
Remember that every statistical indicator is just a tool, it needs to be understood to be used at its best, otherwise, it is just a colored line in a colored graph.
Best delta gridTradingThis indicator help grid traders to chose the best delta in their gridTrading.
The best delta gridTrading indicator is proportional to the Average true range.
Fractal Breakout Strategy [KL]Fractal Breakout Strategy
This strategy will enter into a Long position when (a) bullish fractal is formed, combined with (b) ATR is relatively low. Trailing stop loss is set based on ATR.
Bullish fractal pattern :
A bullish fractal pattern looks like this:
It is formed when lower-low has reached a local minimum followed by higher-lows.
By default, this script plots the pivot point (the local minimum) using green crosses. This line will extend to the right until the next bullish fractal is formed. The local minimum pivot point is considered as key level of support. For long position entry, entry price must be higher or equal to it.
On the other hand, a bearish fractal pattern looks like the exact opposite. Reversing the logic, it is a local maximum indicated by higher-highs followed by lower-highs. This is shown by red crosses.
Why use ATR to confirm entry :
Two reasons to enter when ATR is low:
1) Since trailing stop loss is based on ATR, entering the market when ATR is low means risking less for potentially high reward.
2) Low ATR often signals price consolidation. There are two favorable scenarios, either: (i) period of accumulation, or (ii) bull flag, ideally followed by breakout.
Determining whether ATR is low :
Relative lows are quantified out by using the method in my other script: Modified ATR Indicator
The method involves applying two-tailed hypothesis testing to assess whether ATR (ie. by default lookback period of 5) has greatly deviated from a larger sample size (ie. lookback period of 50). Assuming ATR is normally distributed and variance is known, then test statistic (z) can be used to determine whether ATR5 is within the critical area under Null Hypothesis: ATR5 == ATR50. If z falls below/above the left/right critical values (ie. 1.645 for a 90% confidence interval), then ATR is determined to the relatively low/high respectively. For the purpose of assessing whether ATR is low, the left-tail is the main focus.
Profit taking :
Profits by default are taken over 3 levels based on risk to reward ratio (ie. 1R, 2R, 3R). When a target is met at each level, strategy will close out one third of current position size. Remainders (ie. already taken once at 1R, but not yet reaching 2R or 3R) will eventually be closed at the trailing stop loss price.
Modified ATR Indicator [KL]Modified Average True Range (ATR) Indicator
This indicator displays the ATR with relative highs and relative lows statistically determined.
What is ATR:
To know what ATR is, we need to understand what a True Range (TR) is.
- TR at a given bar is the highest distance between points: a) High vs low, b) High vs Close, and c) Low vs Close.
- ATR is the moving average of TRs over a predefined lookback period; 14 is the most commonly used.
- ATR can be mathematically expressed as:
Why is ATR Important
ATR often used to measure volatility; high volatility is indicated by high ATR, vice versa for low. This is a versatile tool allowing traders to determine entry/exit points, as well as the size of stop losses and when to take profits relative to it.
This is an opinion: Through observations, I have noticed that ATR can also indirectly tell us the levels of relative volume. This intuitively makes sense because in order to increase length of TR, high amounts of capital inflow/outflow is required (graphically speaking, high volume is required in order to make lengths of candle sticks longer). The relationship between ATR and relative volume should hold unless the market is illiquid to the extreme that there is no relationship between volume and price.
That said, knowing the relative lows/highs of ATR is very useful. It can be interpreted as:
- Relative high = high volatility, usually during sell offs
- Relative low = decreasing volume, could indicate price consolidation
Instead of arbitrarily determining whether ATR is high/low, this indicator will determine relative highs and relative lows using a simple statistical model.
How relative high/low is determined by this model
This indicator applies two-tailed hypothesis testing to test whether ATR (ie. say lookback of 14) has greatly deviated from a larger sample size (ie. lookback of 50). Assuming ATR is normally distributed and variance is known, then test statistic (z) can be used to determine whether ATR14 is within the critical area under Null Hypothesis: ATR14 == ATR50. If z falls below/above the left/right critical values (ie. 1.645 for a 90% confidence interval), then this is shown by the indicator through using different colors to plot the ATR line.
Bjorgum Key Levels
Key Levels Aims to capture 3 of the most significant points in price action
Breakouts
False Breakouts (Traps)
Back Checks
These 3 points alone, if properly identified, can be some of the most significant points of movement in the price history of an asset and bring significant gains to traders, if capitalized on. Here are a few examples of these setups
Breakouts
Breakouts can bring significant rallies as the market swings one sided after key levels are breached. This entry type can bring large trending runs to follow. Momentum is on your side, but the trade off is a higher entry.
False Breakouts
Also known as a bull trap or a bear trap, false breaks can lead to swift and significant reversals and potential for a large and sudden move to the opposite side. When a key level breakout fails to hold, parties entering to capitalize on the "epic breakout" can get left holding the bag forcing them to exit at a loss, which can double the force of pressure. Traps can bring swift gains from good entry prices. However, price is still in a larger trend against you so momentum is weak, so price action is susceptible to roll over.
Backchecks
Back checks are pull backs in trend that find middle ground to the 2 areas already described. Both momentum and entry price are decent, but risk is defined as a key level has flipped offering entry with stops below demand, or above supply.
Combining these 3 methods helps to diversify risk, understand trend development, and bring steady gains. This script helps to identify these points to traders with analysis of key levels, price structure, and trend direction, while providing visual signals and alerts for when they occur.
Best of luck in your coding and trading and thank you for your support
node nirvanaThis indicator is suitable for those who have studied Mr. Nirvana's course, as well as those who work in the style of supply and demand.
ATR Trailing Stop v5 One of my favorite stops is the ATR Trailing Stop-loss. With the implementation of PineScript v5, a code update was needed in order to use this stop/exit-strategy with newer strategy scripts. A timeframe selector that was not featured on earlier versions is also included. This new version can be plugged into PineScript v5 strategies, and also has a simpler/cleaner code that makes the code logic easier to follow than prior versions.
For those that are unfamiliar with the ATR Trailing Stop exit strategy; it is a trailing stop that takes into account the volatility of the underlying asset by trailing the price series using a multiple of the Average True Range (ATR). In practice I’ve found that this exit can be more effective than traditional trailing stops, depending on the volatility of the asset you are trading. More detailed information can be found at www.stockopedia.com
How do I use it? Add it to your chart as an indicator to visualize where the ATR stop would be with your settings. Or, copy and add it to your v5 strategy with the addition of a ta.crossunder(close, ATRTrailingStop) or ta.crossover(close, ATRTrailingStop) function. Special thanks and credit to HPotter who coded an earlier version of this in pine!