Trailing
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 .
Trade Manager (Open Source Version)Hello my young padawans looking for the FORCE to get richer on your next trade
I got pinged at least three times today asking where the hell is the indicator of the day. You asked, I delivered :)
Here's your free open-source Trade Manager Version. My associates might kill me for sharing that one... anyway this is a real GIFT.
I won't share such quality indicators too often for FREE so hope you'll appreciate its value. It can really help with your day to day trading (on top of making your charts looking more awesome)
This is an even better version compared to my previous Trade Manager Trade-Manager . It's basically a standalone version, meaning you'll have to update with 2 lines your own indicator and follow my educational post from yesterday (pasted it below also) to learn how to do it
Please read this educational post I published for you before proceeding further : How-to-connect-your-indicator-with-the-Trade-Manager
From here you normally connected the data source of your own indicator to the Trade Manager. If not, here's a reminder of the article mentionned above
Step 1 - Update your indicator
For the screenshot you see above, I used this indicator : Two-MM-Cross-MACD/ . "But sir are you really advertising your other indicators here ??" ... hmmm.... YES but I gave them for free so ... stop complaining my friend :)
Somewhere in the code you'll have a LONG and a SHORT condition. If not, please go back to study trading for noobs (I'm kidding !!!)
So it should look to something similar
nUP = ma_crossover and macd_crossover
nDN = ma_crossunder and macd_crossunder
What you will need to add at the very end of your script is a Signal plot that will be captured by the Trade Manager. This will give us :
// Signal plot to be used as external
// if crossover, sends 1, otherwise sends -1
Signal = (nUP) ? 1 : (nDN) ? -1 : na
plot(Signal, title="Signal")
The Trade Manager engines expects to receive 1 for a bullishg signal and -1 for bearish .
Step 2 - Add the Trade Manager to your chart and select the right Data Source
I feel the questions coming so I prefer to anticipate :) When you add the Trade Manager to your chart, nothing will be displayed. THIS IS NORMAL because you'll have to select the Data Source to be "Signal"
Remember our Signal variable from the Two MM Cross from before, now we'll capture it and.....drumb rolll...... that's from that moment that your life became even more AWESOME
The Engine will capture the last signal from the MM cross or any indicator actually and will update the Stop Loss, Take Profit levels based on the parameters you set on the Trade Manager
It should work with any indicator as long as you're providing a plot Signal with values 1 and -1 . In any case, you can change the Trade Manager you'll find a better logic for your trading
Now let's cover the different parameters of the tool
It should be straightforward but better to explain everything here
+Label lines : if unchecked, no SL/TPs/... will be displayed
+Show Stop Loss Signal : Will display the stop loss label. You have the choice between three options :
By default, the Stop Loss is set to NONE. You'll have to select a different option to enable the Stop Loss for real
++Percentage : Will set the SL at a percent distance from the price
++Fixed : SL fixed at a static price
++Trailing % : Trailing stop loss based on percentage level
The following is a KEY feature and I got asked for it many times those past two days. I got annoyed of getting the same request so I just did it
++Trailing TP: Will move the Stop Loss if the take profit levels are hit
Example: if TP1 is hit, SL will be moved to breakeven. If TP2 is hit, SL will be moved from TP1 to TP2
+Take Profit 1,2,3 : Visually define the three Take Profit levels. Those are percentage levels .
Meaning if you set TP1 = 2, it will set the TP1 level 2% away from the entry signal
Please note that once a Take profit level is reached, it will magically disappear. This is to be expected
I'll share in the future a way more complete version with invalidation, stop loss/take profits based on indicator, take profit based on supports/resistances, ...
I believe is such a great tool because can be connected to any indicator. I confess that I tried it only with a few... if you find any that's not working with the Trade manager, please let me know and I'll have a look
PS
I want to give a HUUUUUUUGE shoutout to the PineCoders community who helped me finishing it
Wishing you all the best and a pleasant experience with my work
David
Supertrend collectorHello traders
This is an example of how you can add multiple indicators into a unique one
In this instance, I added two supertrend multitimeframes and draw them on a different timeframe chart
Enjoy
David
Boxes TrailUsing Trail system and volume trail combination we can make this indicator
buy is when the box is blue , sell when box is red
the length here is 100 , you can make it shorter if you want it to buy more or sell more
it easy trailing system with signals and alerts
ATR for Trailing StopAn 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.
ATR for Trailing StopThe 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.
Parabolic SARThis is a redesign of the built-in Parabolic SAR indicator. I added a proper input system, an option to highlight initial points for both lines and an option to choose points width. So, customize it as you want.
Parabolic SAR was originally developed by J. Welles Wilder and described in his book "New Concepts in Technical Trading Systems" (1978). It is a trend-following indicator that can be used as a trailing stop loss.
To know which settings for PSAR are the most profitable on your instrument and timeframe you can use this tool
Profitable Parabolic SAR
SuperTrendThis is a redesign of the SuperTrend indicator. It removes stupid transitions between SuperTrend states and highlights initial points for both lines.
SuperTrend is a moving stop and reversal line based on the volatility (ATR).
Linear Regression (Backtest / Trailing Stop)A Strategy with Backtest and Trailing Stop for Long/Short
Credits: Study by RafaelZioni - Thanks buddy!
SuperTrend ATR + RSI with signalThis is an updated version of Crée par J.Dow's very interesting indicator- myself and Squiggles added the alert function in there. The original description and explanation can be seen here.
Some settings work better than others on different timeframes- have a play around, I'd be interested in seeing what optimum settings you might be able to find.
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.
Trailing Resistance Indicator by KıvanÇ fr3762TRAILING RESISTANCE INDICATOR is a helpful tool for traders to help one of the common problems that they face: where to buy/sell?
by using trailing resistance you can easily decide and see possible upward movements and understand if you are in a safe zone.
Using Trailing Resistance is just simple:
Go long/ Buy when price crosses above the indicator,
Stay on short position if prices are below the indicator.
The indicator is calculated from previous Lows and doesn't the value won't change until prices makes higher lows.
Simple Trailing stopSince 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.
CDC ATR Trailing Stop V1Based on the standard ATR trailing stop indicator.
A few minor tweaks as used in Chaloke.com's community
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..