Trailing EngulferTrailing Engulfer is a price action strategy that uses trailing orders that makes use of any timeframe although shorter timeframes are typically used with price action trading. due to it being price action related, there are some differences needed when trading with different assets. This strategy is recommended to be used for stocks and futures only although it can be used on others. There are two specific inputs that pertain to futures: trailing trigger and trailing offset. Futures price changes in ticks and tick values are supposed to be used here, whereas the percentage fields are primarily for stocks.
Inputs:
Futures: Trailing Trigger - used for futures only and the value represents the number of ticks you wish for a trailing order to enter. For example: if set to 4 ticks, the trailing stop will not be created until after 4 ticks of profit has been reached.
Futures: Trailing Offset - used for futures only and the value represents the number of ticks you wish the stop to trail the price. For example: if set trigger is set to 4 and offset is set to 3, then the trailing stop order will be created once a profit of 4 ticks has been reached and the trailing stop will be 3 ticks against you.
Max Loss (%) - used for stocks only and the value represents the maximum loss you are willing to take in case the trailing stop hasn't yet been made. For example: you wish the trailing stop to be created once it has made 1% profit. If it never reaches that, it will close at this Max Loss value.
Trailing Trigger (%) - used for stocks only. It works similar to the futures trigger other than the fact that it uses % rather than ticks.
Trailing Offset (%) - used for stocks only. It works similar to the futures trigger offset other than the fact that it uses % rather than ticks.
Futures also have a "Max Loss" but it is not user defined. For futures, the max loss is not based on a tick loss but rather entirely on the asset's price action.
Futures also makes use of shorting.
Trailing
Percent Trailing Stop %===========
Percent Trailing Stop %
===========
Another Stop Loss Indicator today - our last Fixed SL/TP script went down quite well, this one is for adding a Percent Trailing Stop from Entry Price to your own strategy.
You can ignore the actual entry/exit orders - they're based on a simple MA cross and are therefore NOT relevant, NOT profitable and NOT recommended!
You should be using this code as a way of adding a % Trailing Stop to your own scripts - hope it helps!
You should also notice that a generally considered losing strategy (a simple MA cross) could actually become profitable with careful money management - try combining this Trailing Stop script with our Fixed Stop/Take Profit script for really accurate management of your capital.
-----------
Good Luck and Happy Trading!
MTF Trailing SL Strategy [QuantNomad]This is a Multi-Timeframe version of my Trailing SL Strategy.
Few weeks ago I published Trailing SL Strategy. There I used only basic Trailing SL to enter positions.
It worked pretty well so I tried to work on it a bit. I thought what if you can use the same ATR TSL on different timeframes and combine them into one signal.
In this strategy you can use only ATR stops and choose 3 other higher timeframes in addition to your current timeframe.
You'll see Trailing SL plotted on the chart form all these timeframes.
Entry Long position if all 4 time-frames agree on long signal.
Exit Long positions when at least 2 time-frames disagree on long signal.
Entry to Short position if all 4 time-frames agree on Short signal.
Exit from Short positions when at least 2 time-frames disagree on Short signal.
Here is the link to my basic Trailing SL Strategy:
XPloRR S&P500 Stock Market Crash Detection Strategy v2XPloRR S&P500 Stock Market Crash Detection Strategy v2
Long-Term Trailing-Stop strategy detecting S&P500 Stock Market Crashes/Corrections and showing Volatility as warning signal for upcoming crashes
Detecting or avoiding stock market crashes seems to be the 'Holy Grail' of strategies.
Since none of the strategies that I tested can beat the long term Buy&Hold strategy, the purpose was to detect a stock market crash on the S&P500 and step out in time to minimize losses and beat the Buy&Hold strategy. So beat the Buy&Hold strategy with around 10 trades. 100% capitalize sold trade into new trade.
With the default parameters the strategy generates 10262% profit (starting at 01/01/1962 until release date), with 10 closed trades, 100% profitable, while the Buy&Hold strategy only generates 3633% profit, so this strategy beats the Buy&Hold strategy by 2.82 times !
Also the strategy detects all major S&P500 stock market crashes and corrections since 1962 depending on the Trailing Stop Smoothness parameter, and steps out in time to cut losses and steps in again after the bottom has been reached. The 5 major crashes/corrections of 1987, 1990, 2001, 2008 and 2010 were successfully detected with the default parameters.
The script was first released on November 03 2019 and detected the Corona Crash on March 04 2020 with a Volatility crash-alert and a Sell crash-alert.
I have also created an Alerter Study Script based on the engine of this script, which generates Buy, Sell and Volatility signals.
If you are interested in this Alerter version script, please drop me a mail.
The script shows a lot of graphical information:
the Close value is shown in light-green. When the Close value is temporarily lower than the Buy value, the Close value is shown in light-red. This way it is possible to evaluate the virtual losses during the current trade.
the Trailing Stop value is shown in dark-green. When the Sell value is lower than the Buy value, the last color of the trade will be red (best viewed when zoomed)
the EMA and SMA values for both Buy and Sell signals are shown as colored graphs
the Buy signals are labeled in blue and the Sell signals are labeled in purple
the Volatility is shown below in green and red. The Alert Threshold (red) is default set to 2 (see Volatility Threshold parameter below)
How to use this Strategy?
Select the SPX (S&P500) graph and add this script to the graph.
Look in the strategy tester overview to optimize the values Percent Profitable and Net Profit (using the strategy settings icon, you can increase/decrease the parameters), then keep using these parameters for future Buy/Sell signals on the S&P500.
More trades don't necessarily generate more overall profit. It is important to detect only the major crashes and avoid closing trades on the smaller corrections. Bearing the smaller corrections generates a higher profit.
Watch out for the Volatility Alerts generated at the bottom (red). The Threshold can by changed by the Volatility Threshold parameter (default=2% ATR). In almost all crashes/corrections there is an alert ahead of the crash.
Although the signal doesn't predict the exact timing of the crash/correction, it is a clear warning signal that bearish times are ahead!
The correction in December 2018 was not a major crash but there was already a red Volatility warning alert. If the Volatility Alert repeats the next weeks/months, chances are higher that a bigger crash or correction is near. As can be seen in the graphic, the deeper the crash is, the higher and wider the red Volatility signal goes. So keep an eye on the red flag!
Here are the parameters:
Fast MA Buy: buy trigger when Fast MA Buy crosses over the Slow MA Buy value (use values between 10-20)
Slow MA Buy: buy trigger when Fast MA Buy crosses over the Slow MA Buy value (use values between 21-50)
Minimum Buy Strength: minimum upward trend value of the Fast MA Buy value (directional coefficient)(use values between 10-100)
Fast MA Sell: sell trigger when Fast MA Sell crosses under the Slow MA Sell value (use values between 10-20)
Slow MA Sell: sell trigger when Fast MA Sell crosses under the Slow MA Sell value (use values between 21-50)
Minimum Sell Strength: minimum downward trend value of the Fast MA Sell value (directional coefficient)(use values between 10-100)
Trailing Stop ATR: trailing stop % distance from the smoothed Close value (use values between 2-20)
Trailing Stop Smoothness: MA value for smoothing out the Trailing Stop close value
Buy On Start Date: force Buy on start date even without Buy signal (default: true)
Sell On End Date: force Sell on end date even without Sell signal (default: true)
Volatility EMA Period: MA value of the Volatility value (default 15)
Volatility Threshold: Threshold value to change volatility graph to red (default 2)
Volatility Graph Scaler: Scaling of the volatility graph (default 5)
Important : optimizing and using these parameters is no guarantee for future winning trades!
BEST Trailing Stop StrategyHello traders
Here we go again.... with the second strategy snippet.
Reminder: the first snipper was a Trailing Profit strategy script
What's on the menu?
A trailing stop is designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor.
The order closes the trade if the price changes direction by a specified percentage or dollar amount.
Trigger me I'm famous
I developed many trading strategies in my career and often I've been asked to trigger a trailing-stop once a certain % move has been made.
On the screenshot below, the SL trigger is plotted in maroon.
Once the price goes past that level for the first time, I'll start trailing the trailing stop level.
In other words, when we see a price makes an interesting move in percentage value - we decide to trail the stop for at least not losing any more
All the BEST
Dave
BEST Trailing Take Profit StrategyHello traders
Hope you enjoyed your weekend on my behalf. Was staying home working ... ^^
This is my first strategy educational post I'm doing ever
While I'm generally against posting strategies because it's very easy to fake performance numbers... I cannot prevent myself from sharing a few cool strategy snippets anyway.
So from now on, I'll be sharing a few strategies also - generally not to showcase performance but only to show what pinescript can do.
As once again strategy performance can be faked is so many ways... :)
What's on the menu?
We all know what a trailing-stop is. right? right? Ok... sharing the definition here :)
A trailing stop is designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor. The order closes the trade if the price changes direction by a specified percentage or dollar amount.
But...do you know what a trailing profit is?
Short definition : Well the same but with your profit limit order.
Long definition : A trailing profit is designed to increase your gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor. The order closes the trade if the price hits the trailing profit level specified percentage or dollar amount.
Some trading strategies used both a trailing stop AND trailing profit. Not making any recommendation here - only sharing what's possible in the realm of trading and pinescripting
Trigger me I'm famous
I developed many trading strategies in my career and often I've been asked to trigger a trailing-stop or trailing-profit once a certain % move has been made.
I integrated here a Take Profit trigger - once hit, it will activate the trailing profit
On the screenshot below, the TP trigger is plotted in orange. Once the price goes past that level for the first time, I'll start trailing the profit level.
In other words, when we see a price makes an interesting move in percentage value - we decide to offset the profit as we concluded that once it reached such distance - then it leads often to more profit
Of course, using only a trailing profit without stop/trailing-stop/invalidation isn't smart and the surest way to kiss goodbye a trading capital and trading and your good mood
See you tomorrow for another strategy snippet
All the BEST
Dave
[STRATEGY] SuperTrendA private strategy from the Profitable SuperTrend preview for backtesting purposes.
TRAILING STOP LOSS TO LONG AND SHORT##THIS SCRIPT IS ON GITHUB
This TradingView strategy it is designed to integrate with other strategies with indicators.
It performs a trailing stop loss from entry and exit conditions.
In this strategy you can add conditions for long and short positions.
The strategy will ride up your stop loss when price moviment 1%.
The strategy will close your operation when the market price crossed the stop loss.
Also is possible to select the period that strategy will execute the backtest.
The strategy has the following parameters:
+ **INITIAL STOP LOSS** - Where can isert the value to first stop.
+ **POSITION TYPE** - Where can to select trade position.
+ **BACKTEST PERIOD** - To select range.
## DISCLAIMER
1. I am not licensed financial advisors or broker dealers. I do not tell you when or what to buy or sell. I developed this software which enables you execute manual or automated trades multiple trades using TradingView. The software allows you to set the criteria you want for entering and exiting trades.
2. Do not trade with money you cannot afford to lose.
3. I do not guarantee consistent profits or that anyone can make money with no effort. And I am not selling the holy grail.
4. Every system can have winning and losing streaks.
5. Money management plays a large role in the results of your trading. For example: lot size, account size, broker leverage, and broker margin call rules all have an effect on results. Also, your Take Profit and Stop Loss settings for individual pair trades and for overall account equity have a major impact on results. If you are new to trading and do not understand these items, then I recommend you seek education materials to further your knowledge.
**YOU NEED TO FIND AND USE THE TRADING SYSTEM THAT WORKS BEST FOR YOU AND YOUR TRADING TOLERANCE.**
**I HAVE PROVIDED NOTHING MORE THAN A TOOL WITH OPTIONS FOR YOU TO TRADE WITH THIS PROGRAM ON TRADINGVIEW.**
## NOTE
I accept suggestions to improve the script.
If you encounter any problems I will be happy to share with me.
+ Authors: @exit490
+ Revision: v1.0.0
+ Date: 03-Aug-2019
+ Pinescript version: 4
## LICENSE
Copyright 2019 Mauricio Pimenta / exit490
Trailing Stop Loss script may be freely distributed under the MIT license .
Cyatophilum Bands Pro Trader V4 [BACKTEST]This version includes a new feature, engineered to increase profitability.
About the backtest below:
Short + Long Strategy
0.05% Commission
10% of 10 000% equity per trade. Net Profit can be increased with a bigger % of equity.
Strategy data from 01/11/2019 to 30/04/2019
The Cyatophilum Bands, Trailing Stop Loss and Take Profit System are explained in the last version:
The access to this indicator and its Alert Setup version are included in the Cyatophilum Indicators pack available on my website blockchainfiesta.com
To get a free trial, leave a comment, thank you.
Linear Regression (Backtest / Trailing Stop)A Strategy with Backtest and Trailing Stop for Long/Short
Credits: Study by RafaelZioni - Thanks buddy!
Trailing Stops/Choose a Day of the WeekThis would be my second ever published strategy. It is almost the same as my first ever published script . I've been working primarily on UGAZ and DGAZ .
This is basically a statistical trade. It buys every morning near market open (or by choosing a "time constraint"), then immediately places a trailing stop at a specified amount in ticks (if used on UGAZ a tick = $0.01, if used on NG at tick = $0.001). I've found between 2% and 3% works well for the trailing stop (ie. if UGAZ = $75, a 3% trailing stop = $2.25)
-----What is different from my first strategy?------
You can test the trailing stop strategy one 1 day of the week. Days of the week are assigned numbers. Sunday=1, Monday=2, Tuesday=3 and so on. Just choose a number that correlates to the day of the week you want to test. The Trailing stop may go past that day, that's a good thing if it's making money.
-- Go long/Short is just that, it will buy shares/contracts or short them.
-- Trades per day. This may not be a good choice, when left on "2", it will trade once per day. If set above 2 and there is time left for another trade, an order will enter on the open of the next candle. I'm am still working on ideas for this.
-- Time constraints. When you select this check box, the strategy will limit an entry to the time specified below the "Use Time Constraints" check box. An Exit order will still continue past this window of time until it is stopped out.
---- very important ----
Due to decay, leveraged ETFs will give false results if the price gets far out of range. For example, your ETF is trading around $20 and you choose a 1 hour chart, it may back test back to a time before a reverse split. If the price gets to be too large, like $200, or $1200, the movement on the chart creates false indication of profit/loss.
--- Most important. ---
Do not trade off this strategy, you may lose lots of money. This is for educational use only.
Good luck
ATR Trailing Stop Bands Strategy [R] Originally based on a script by HPotter for an ATR Trailing Stop, which itself was based on an article by Sylvain Vervoort, but I adapted it to add Bands, to add extra optional Wick Protection, and have now made it a Strategy. It's not great for entries/exits, but as a Trailing Stop that can let winners ride, it's great.
Trailing Stops Only - For Leveraged ETFs (UGAZ/DGAZ)Looking for Statistical trades that work. This one seems to work on some Leveraged ETFs with a lot of noise like UGAZ/DGAZ. It can also be used on Futures Contracts, but be sure to change up the type of investment from % of equity to contracts. Also one point I'm trying to make with this strategy is the trades are best made in the morning around market open. When used with Contracts, be sure to make use of the time settings. It will limit buying between the hours set. Selling will occur at any time the trailing stop is triggered.
This Strategy is best used on 5min or 15min charts.
!!!! very important !!!!
Due to decay, leveraged ETFs will give false results if the price gets far out of range. For example, your ETF is trading around $20 and you choose a 1 hour chart, it may back test back to a time before a reverse split. If the price gets to be too large, like $200, or $1200, the movement on the chart creates false indication of profit/loss.
Most important. Do not trade off this strategy, you may lose lots of money. This is for educational use only.
BitMex Trailing Stop StrategyThis script is designed for those who want to use BitMex's trailing stop. It's not meant to be used as entry exits, but rather to get an idea of how wide the trailing stop needs to be. I suggest you backtest with different values. The script can also be integrated into an existing strategy which does give entry/exits to act as its stop loss.
Simple Trailing Buy & Stop StrategyAllows you to backtest a simple percentage based trailing stop, with a trailing buy. Experiment with different percentages on different timeframes for different charts.
For BTCUSD, on daily 4.3% stop and 1.9% buy works well, while on 4hr a 1.5% stop and 1.9% buy works best.
Please comment with any other combos that work well for you on different markets or timeframes.
5 min eth with trailing stopHere is a new version of the 5 min btc/eth/bch trader with a trailing stop. Also it will only work until august. It will work on other pairs with adusted timeframes, stop losses and take profits.
GunbotXT TSSLSimulation of GunbotXT TSSL (trailing stop / stop limit) strategy useful for fine tuning settings and backtesting.
Once you have been granted access, you will receive notification in TradingView (Bell).
Then right click on Chart area -> click "Insert Indicator..." -> click "Invite-Only Scripts" -> click "GunbotXT TSSL" -> Add To Chart
At bottom -> click "Strategy Tester" -> click the "Gear" icon (Format) -> Input your desired settings to test.
Red = SellSTEP
Purple = SellGAIN
Red = SellSTOP
Blue/Yellow (changes) = FLowMA (lowest of 2 EMA's)
Blue = FastMA (off by default)
Yellow = SlowMA (off by default)
Orange = BuyPROTECT (BUY_LEVEL)
Green = BuySTOP
Green = BuySTEP
NOTICE: By requesting access to this script you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
Hausky Simple MA Strategy EURUSD 1HHere is my simple Moving Average crossover strategy for EURUSD 1H
CamarillaStrategy -V1 - H4 and L4 breakout - exits addedExits added using trailing stops.
2.6 Profit Factor and 76% Profitable on SPY , 5M - I think it's a pretty good number for an automated strategy that uses Pivots. I don't think it's possible to add volume and day open price in relation to pivot levels -- that's what I do manually ..
Still trying to add EMA for exits.. it will increase profitability. You can play in pinescript with trailing stops entries..