Same coding only coloring and information panel was added. CDC ATR Trailing Stop V2.1 (2013) //Barcolor Green = Trail1 > Trail2 and close > Trail2 and low > Trail2 Blue = Trail1 > Trail2 and close > Trail2 and low < Trail2 Red = Trail2 > Trail1 and close < Trail2 and high < Trail2 Yellow = Trail2 > Trail1 and close < Trail2 and high > Trail2 //It gives White...
=========== Percent Trailing Stop (%) - { FOR STUDY SCRIPTS } =========== Wow - this is an example of how to implement Alerts relating to a Trailing Stop (%) within your Study Script. It's taken a bit of effort to get this working but I think we got there! Alerts include Open Long/Short, Trailing Stop Hit, and (the most important one) Movement of Trailing...
ATR Trailing Stoploss Buy=crossover(close,TS) Sell=crossunder(close,TS)
An ATR (Average True Range) can be used to position a trailing stop In this script, the true range of today is calculated based on the low of yesterday in order to be more stable. It only goes up, as a trailing stop should do. It only goes down when the trailing stop is reached by the price.
The calculation of this ATR is based on the low of yesterday in order to not change continuously during the day. You can use this indicator to create a trailing stop taking into account volatility on the nATRPeriod previous days. It also always go up as a trailing stop should. It only goes down the price reaches the trailing stop.
Since my exchange doesn't support trailing stop I made a script for it. It is fully configurable, which means you can set the bars for calculation, the offset and sources for trigger and calculation. The original purpose for me was to send a command to my bot. If you like it please comment and check out my other scripts.
Based on the standard ATR trailing stop indicator. A few minor tweaks as used in Chaloke.com's community