Moving Stop-Loss mechanism + alerts to MT4/MT5"How to code moving stop-loss mechanism", is one of the most often repeating questions in private messages I receive, so just to focus on this mechanism, I made a spin-off from my previous script: TradingView-Alerts-to-MT4-MT5-dynamic-variables-NON-REPAINTING .
The logic here moves the stop-loss each time a trade is running and a new pivot high/low is detected. When such event occurs (UpdateLongStopLoss or UpdateShortStopLoss), stoploss_long or stoploss_short mutable variable is modified. And it needs to be coded inside strategy.exit() line as "stop=stoploss_long" or "stop=stoploss_short". Entries are pretty straightforward - on Stoch crosses.
Last lines of the script show how to wrap information about such updates and send send alerts to MetaTrader via TradingConnector for execution in Forex/indices/commodities/crypto markets via MetaTrader. Please note that "tradeid=" variable must be passed with each alert, to let MetaTrader know which trade to modify. SLMOD, TPMOD are recently added commands, along with BE (as in "move stop-loss to breakeven" - but that's another topic).
Please disregard strategy backtest results, as this script is for coding education purposes only. However, it seems with the stop-loss mechanism enabled, the results are even better, than in original version of the script :)
Strategy!
RSI Cross [xaurr]This is simple but profitable rsi cross strategy, to find optimal values you can change rsi and ema periods.
Good Luck!
TradePro's Trading Idea Cipher Divergence EMA Pb StrategyHere I present you on of Trade Pro's Trading Idea: Cipher B+ Divergence EMA Pullback Strategy.
Optimized the crypto pairBTC/USDT in the 30 minute chart.
There is the possibility to switch between short and long positions.
You can choose between 2 different take profit/stop loss types: The Lowest Low/ Highest High Stop Loss/ Take Profit and the ATR Take Profit/ Stop Loss.
-----------------------------------------------------------------------------------
How does the strategy work?
ENTRY
Long
The price must be above the 200 EMA .
The price needs to make a pullback into the 50 EMA .
Right after that, the Cipher B indicator must give a buy signal, it must be below the zero line and the Money Flow cloud must be green.
Short
Contrary to the premise of long positions.
EXIT
Lowest Low/ Highest High Exit
The Lowest Low (long) / highest high (short) serves as the stop loss. The TP is formed on the basis of a factor.
(Long for example: *Lowest Low* multiplied by *Profitfactor* = TP).
ATR Exit
The value of ATR at the time of buying is multiplied by the value entered in "Profit factor ATR" and "Stop factor ATR". As soon as the price reaches this value, it is closed.
Important
The script must be optimized for each coin or currency pair. However, only the values for the profit factor, the stop loss and Lowest Low / Highest High are relevant.
Also, by changing the Chanel Length and the Chanel Average, you can create strong profit changes.
The results of the strategy are without commissions and leverage.
If you have any questions or feedback, please let me know in the comments.
If you need more information about the strategy and want to know exactly how to apply it, check out my profile. There I have created a tutorial for the function of the script.
Backtest Service Program (BASE) [FAF-Software-Solutions]{Deutsche Beschreibung folgt der englischen Beschreibung}
█ OVERVIEW
With BASE you can quick and easy create, test or optimize seasonal trading strategies. Seasonality is a strong, if not the strongest, trading approach to making money in the capital markets over the long term. Whether individually or in combination with other strategies, seasonality is a tool for your trading that should not be underestimated.
We have packed this script with everything you need for a meaningful seasonal analysis. Define entry and exit times according to day of the week, day of the month and the month itself, very easily via the settings window. Determine the period to be evaluated and, if desired, add a stop loss and / or a take profit to add a healthy risk and money management to your strategy. Since this is a pine strategy script, the usual trading view strategy parameters such as account size, commission, slippage, etc. are also available and you can set up your backtest even more realistically and therefore more truthfully.
Would you like to evaluate the behavior of a certain share over the turn of the year, would you like to find out which day of the week in gold has been the most profitable over the past 50 years or just check the "Sell in May" effect? This is exactly what we created this script for. With just a few clicks you can evaluate approaches such as the "Sell in May" effect or the "Santa Claus Rally", you can check which day of the week, which day of the month or which month is the strongest in an instrument and develop individual strategy systems from this.
█ FEATURES
The script input window has the following setting options:
• Backtest start / Backtest end: Set your Backtast Range here.
• Trade direction: Decide whether your strategy should open buy or sell positions.
• Pyramiding Indicates how many positions can be open at the same time (maximum 10 positions)
• Stop Loss / Take Profit: In order to optimize your strategy, you have the option of adding profit and loss levels (visible in the chart) to your open positions.
This enables you to adapt your trading system to your risk and money management. The stop and take profit levels are freely selectable.
• Entrys / Exits: Divided into days of the week, days of month and months itself, you can individually choose when you want to open and close a position.
• Advanced Filter: Seasonally, the 4-year election cycle of the US presidential election has a strong impact on the markets.
In order to be able to develop analyzes in connection with this cycle, there is an advanced filter to be able to filter the different election years.
█ HOW TO USE
After the script has been added to the chart, the input window opens immediately and you can easily select your strategy parameters. After confirming your selection, all trades will be added to the chart and you will find the key metrics for your system in the Tradingview Strategy Tester. If you have added a stop or profit level, you can also see this graphically in the chart and thus analyze every trade in the chart very precisely.
The entry and exit fields can be selected individually to be activated. If no selection is made, e.g. no selection for the weekday entry, then there is no longer any filtering and entry / exit is possible on any weekday. As soon as a selection is made under the entry / exit parameters, the system filters according to the criteria made during the selection. A position is always opened / closed at the closing price (close) of the candle, at which all selected criteria match.
█ LIMITATIONS
This script is just a tool for your trading. You dont receive any finished trading strategy or backtest, but a program with which you can create and optimize your own seasonal trading strategies without any programming knowledge.
This script was developed for seasonal back tests over a long history and therefore works best in a time resolution greater than or equal to the daily chart (1D).
█ IMPORTANT
The strategy results shown here were made with the default script settings in the SPX symbol. In order to test the pure seasonality, no slippage and commission are included in the default inputs. By default, 100% of the capital is used to open a position. These settings allow a quick check of seasonality without the distortion from commissions, slippage or margin calls, but to get a real strategy you need to add these things later. If you have identified a seasonal phase and want to build a trading strategy from it, you have to add realistic commission and slippage and adjust the positionsize. The backtesting results shown here are chosen randomly and are not a real strategy. The strategy key metrics are therefore not relevant and the chart is only used to illustrate the script design
Use the link below to get more information
═════════════════════════════════════════════════════════════════════════
█ ÜBERSICHT
Mit der BASE kannst Du schnell und unkompliziert saisonale Handelsstrategien erstellen, testen oder optimieren. Die Saisonalität ist ein starker, wenn nicht sogar der stärkste Handelsansatz, um langfristig Geld an den Kapitalmärkten zu verdienen. Ob nun einzeln oder in Kombination mit anderen Strategien, die Saisonalität ist ein nicht zu unterschätzendes Hilfsmittel für deinen Handel.
Dieses Skript haben wir mit allem vollgepackt was du für eine aussagekräftige saisonale Auswertung benötigst. Definiere Ein- und Ausstiegszeitpunkte nach Wochentag, Tag des Monats und dem Monat selbst, ganz einfach über das Einstellungsfenster. Bestimme den auszuwertenden Zeitraum und ergänze wenn gewünscht einen Stop Loss und/oder einen Take Profit um deiner Strategie ein gesundes Risiko- und Moneymanagement hinzuzufügen. Da es sich hierbei um ein Pine-Strategieskript handelt stehen Dir die üblichen Tradingview Strategieparameter wie Kontogröße, Kommission, Slippage usw. ebenfalls zur Verfügung und Du kannst deinen Backtest noch realistischer und damit auch wahrheitsgemäßer aufstellen.
Du möchtest das Verhalten einer bestimmten Aktie über den Jahreswechsel auswerten, möchtest herausfinden welcher Wochentag in Gold über die letzten 50 Jahre der profitabelste war oder einfach mal eben den "Sell in May" Ansatz überprüfen? Genau hierfür haben wir dieses Skript erstellt. Mit wenigen Klicks kannst Du Ansätze wie den "Sell in May" Effekt oder die "Santa Claus Rally" auswerten, kannst prüfen welcher Wochentag, welcher Tag des Monats oder welcher Monat der stärkste in einem Instrument ist und daraus ganz individuelle Strategie-Systeme entwickeln.
█ EIGENSCHAFTEN
Das Eingabefenster des Skripts hat folgende Einstellungsmöglichkeiten:
• Backtest start / Backtest end: Hier legst Du fest für welchen Zeitraum dein Backtest erstellt werden soll.
• Trade direction: In diesem Feld wird bestimmt ob die Positionen in Long- oder Short-Richtung eröffnet werden sollen.
• Pyramiding Gibt an wie viele Positionen zu selben Zeit offen stehen können (maximal 10 Positionen möglich)
• Stop Loss / Take Profit: Um deine Strategie optimieren zu können hast Du die Möglichkeit Gewinn- und Verlustlevel (sichtbar im Chart) zu deinen offenen Positionen hinzuzufügen.
Dadurch ist es Dir möglich dein Handelssystem an dein Risiko- und Moneymanagement anzupassen. Die Stop Loss und Take Profit Level sind frei wählbar.
• Entrys / Exits: Unterteilt in Wochentage, Kalendertage und Monate kannst Du hier ganz individuell auswählen zu welchem Zeitpunkt Du eine Position eröffnen und schließen möchtest.
• Advanced Filter: Saisonal betrachtet beeinflusst der 4-jährige Wahlzyklus der US-Präsidentschaftswahlen die Märkte stark.
Um Analysen im Zusammenhang mit diesem Zyklus entwickeln zu können gibt es hierfür einen erweiterten Filter um die verschiedenen Wahljahre filtern zu können.
█ ANWENDUNG
Nachdem das Skript auf den Chart aufgerufen wurde öffnet sich sofort das Eingabefenster in welchem Du deine Strategieparameter auswählen kannst. Nach dem Bestätigen der Auswahl kannst du sofort deine Trades auf dem Chart erkennen und hast über den Tradingview Strategie-Tester die Auswertung zu deinem System vorliegen. Wenn du ein Stop Loss oder Take Profit Level hinzugefügt hast kannst Du auch dieses grafisch auf dem Chart erkennen und so jeden Trade im Chart ganz genau analysieren.
Die Entry und Exit Felder können einzeln angewählt und somit aktiviert werden. Ist in einer Reihe wie beispielsweise den Wochentagen keiner der Tage ausgewählt so wird nicht mehr nach den Wochentagen gefiltert und ein Einstieg/ Ausstieg ist zu jedem Wochentag möglich. Sobald unter den Entry/ Exit Parametern eine Auswahl getroffen wird filtert das System nach den in der Auswahl getroffenen Kriterien. Es wird immer zum Schlusskurs (Close) der Kerze eingestiegen bei der alle ausgewählten Kriterien übereinstimmen.
█ EINSCHRÄNKUNGEN
Dieses Skript stellt ausschließlich ein Hilfsmittel für deinen Handel dar. Du erhältst keine fertigen Handelsstrategien oder Backtests sondern ein Tool mit welchem Du ohne Programmierkenntnisse in der Lage bist eigene saisonale Handelsstrategien zu erstellen und zu optimieren.
Das Skript wurde für saisonale Backtests über eine lange Historie entwickelt und arbeitet daher am besten in den Zeitfenstern größer oder gleich dem Tageschart (1D).
█ WICHTIG
Die hier gezeigten Strategieergebnisse wurden mit den Standard-Skripteinstellungen im SPX-Symbol erstellt. Um die reine Saisonalität zu testen, sind in den Standardeingaben keine Slippage und Provision enthalten. Standardmäßig wird 100% des Kapitals verwendet, um eine Position zu eröffnen. Diese Einstellungen ermöglichen eine schnelle Prüfung der Saisonalität ohne Verzerrungen durch Provisionen, Slippage oder Margin Calls. Um eine handelbare Strategie zu erhalten müssen die Angaben zu Slippage, Kommission und Positionsgröße aber später unbedingt ergänzt werden. Die hier gezeigten Backtesting-Ergebnisse wurden zufällig ausgewählt und sind keine echte Strategie. Die Strategiekennzahlen sind daher nicht relevant und das Chartbild dient nur zur Veranschaulichung des Skriptdesigns
Verwende den untenstehenden Link für mehr Informationen
BTC Volatility Band StrategyThis script/strategy is a pullback system designed for securities with high volatility so naturally Bitcoin is an excellent choice for trading this. This could be used both on a daily chart or on lower timeframes (I found good results on 3hr timeframe but haven't tested it on anything under 1hr).
A volatility band is created by comparing the candle close price of the previous 2 candles and and it uses this change in price to create a moving average. A band is wrapped around the moving average with a standard deviation of 1 for the inner band and 2 for the outer band. If the price is above a pre-set MA (moving average filter) then it is determined we are in an uptrend so the strategy will issue a buy signal when we are in an uptrend and there is a pullback which causes the lower inner deviation band to be spiked, but if the price continues and falls through the outer deviation band then a buy signal will not issue as this detriments that the volatility spike is to great. You can see a spike "buy" event occur on the indicator where the background is coloured green. For a short/sell then there will be a spike on the upper inner band and we are below the pre-set MA filter, for this it shows with red background on the indicator.
The user can change the date range they wish to test, the moving average period for the volatility tracking and the inner and outer band deviations. On BTC I left the inner deviation and outer deviation bands on standard settings but found the 3 period volatility tracking to be good for trading 1 day chart and the 5 period volatility tracking good for the 3hr chart. Since this is not a buy and hold strategy then for trading you would probably want to stick with the most liquid coins so you can get in and out very fast on any exchange. If you wanted to tray this on less volatile markets then changing the inner deviation band to ~0.75 would work okay in various futures markets likely stocks as well. The take profit and stop loss levels are based on a multiple of the trading range looking back the past 7 candles.
Attached result is trading 1 BTCUSDT contract on Binance.
CryptoKillerCryptoKiller is a trend following trading system. It provides entry and exit points, a money management system and a trade management system.
The entry points (fuchsia line) are determined by CryptoKiller Oscillator (see other published script to understand how the oscillator works).
The trade management system provides the exit points in profit and in loss. This script works with multiple take profits (green lines), the initial position is liquidated little by little as the trend reaches the profit targets. Trade management also provides trailing stop exits to save the remaining profits.
Stop loss (red line) take into account the recent past of the chart to be determined, while take profits are fixed and have been calculated based on historical volatility.
The money management system is very simple, it plans to enter a position with a fixed percentage with respect to equity.
CryptoKiller, during an operation, also draws supports and resistances on the chart - determined by the oscillator (orange lines) these supports and resistances are used as a filter to understand where there is the greatest probability of trend development (some entry points provided by the oscillator will therefore not be considered by CryptoKiller as entry points, as in disagreement with the traced supports / resistances).
We know that an error appears in the backtest calculation, where the script is said to suffer from a bias, so the backtest calculation may not be accurate. Actually this happens in high times like H4 or daily, but CryptoKiller is not designed for these timeframes. it is a short-term strategy.
For more information read the author's instructions to contact us, we will send a PDF file with a more complete explanation of the strategy accompanied by screenshots.
Access to this script is granted along with access to CryptoKiller Oscillator.
mark strategy2 divergence bot v0.5 for xbtusdHi first of all thanks for read this.
This is my second strategy for make trading, I optimized it for xbtusd with 30 min charts.
You can personalize some setting for reach a better result then me, these are the setting:
this script is only for long trade, so bearish divergence don't work
1)ema1
U can change this value for use another ema and use a faster or slower trend
2)ema2
U can change this value for use another ema and use a faster or slower trend
3)pivot right
U can change this value for watch a number of bar on your right
4)pivot left
U can change this value for watch a number of bar on your left
5)high range
U can change this value for watch a max number of bar
6)low range
U can change this value for watch a min number of bar
7)bullish
U can change this value for enable signal with bullish divergence
8)hidden bullish
U can change this value for enable signal with hidden bullish divergence
9)bearish
U can change this value for enable signal with bearish divergence
10)hidden bearish
U can change this value for enable signal with hidden bearish divergence
11)profit 1 %
U can change this value for the first take profit target
12)profit 2 %
U can change this value for the second take profit target
13)qty target 1 %
U can change this value for close a % of your trade at target 1
14)loss %
U can change this value for close the trade at a % of loss
Have nice day and send me a message if u will earn with my strategy.
If u want my code send me a message
for info send me a message
RSI Strategy w/ Trailing SL / TP Optimized for Crypto [Strategy]This strategy is designed to use the RSI and EMA filters. A 200 period EMA is used for short / long filters, and the 50 period EMA is used to determine the direction of the short term trend.
In addition, the script uses "rate of change" for the fast EMA (trend), volume , RSI (momentum), and price (volatility) and only takes trades when all are in optimal conditions.
I.E., the EMA is in an uptrend, the volume is increasing, price is in an uptrend, and the RSI is in an uptrend, so we will place a Long trade.
This strategy uses EMAs as a trailing stop loss and take profit. As this is a trend following strategy, the idea is to maximize profits when correct and minimize losses when
wrong.
It was designed specifically using crypto pairs, and was optimized for the 10 minute chart.
My goal was to get the best use out of the RSI indicator. I was originally an MACD fanboy, but have recently converted.
Want to help me improve this code or strategy? Have suggestions for improvement? Leave them in the comments below.
Thanks for using my script! I hope it works well for you and good luck in the markets.
If you have any questions, please leave them in the comments and I'll do my best to respond.
This script does not repaint as it only relies on close data to make a decision to enter a trade.
How to use this strategy:
___________________________
Enable Long Entries? - Used to enable or disable the strategy from executing long entries.
Enable Short Entries? - Used to enable or disable the strategy from executing short entries.
How Many Bars To Look Back for Hi/Lo: - This is used for the Stop Loss and Take Profit targets. An integer of bars is used to look back and calculate the values.
RSI Length (Rec: 8) - The length of the RSI
Source - The RSI Source
Use Slow EMA? - If checked, a 200 period EMA will be used to filter entries long or short (only take shorts when the price is below, long when above). In addition, the script will close any trades that cross the 200 period EMA. By default this is disabled.
EMA Slow - the period of the Slow EMA (200 by default)
EMA Slow Src - what to use to calculate the Slow EMA (high by default)
EMA Fast - The Fast EMA (50 period) is used to calculate the direction of the short term trend. This also factored into the Rates of Change.
EMA Fast Src - what to use to calculate the Fast EMA
ATR Length - If used, the ATR length is used to calculate the Stop Loss and Take Profit targets.
SL Multiplier - The distance away from the initial value to multiply the Stop Loss
TP Multiplier - The distance away from the initial value to multiply the Take Profit.
Use EMA as SL / TP? - If true (default) a 3 period EMA is used to calculate Stop Loss and Take Profit targets. Else, an ATR is used to calculate these values.
Stop Loss / Take Profit Offset - Default: 3 - this is used to shift the EMA / ATR Stop Loss and Take Profit lines to the right X bars. This is to ensure that they are hit properly and not exceeded.
Short Len Vol - Use to calculate the volume of the short length, used in rate of change calculations
Long Len - Use to calculate the volume of the long length, used in rate of change calculations
RSI Long Entry Val - Minimum RSI crossover value to enter a trade Long. If the RSI is below this value, trade entries are not valid.
RSI Long Cutoff Threshold - Long entry RSI value cutoff to no longer enter trades. If the RSI is above this value, trades entries are not valid.
RSI Short Entry Val - Minimum RSI crossover value to enter a trade Short. If the RSI is above this value, trade entries are not valid.
RSI Short Cutoff Threshold - Short entry RSI value cutoff to no longer enter trades. If the RSI is below this value, trades entries are not valid.
ROC Fast EMA - Calculates the rate of change between the Fast Ema now and 'X' bars ago. For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
ROC Price - Calculates the rate of change between the most recent price close and 'X' bars ago. For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
ROC RSI - Calculates the rate of change between the RSI now and 'X' bars ago. For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
Use Close for SL - Default = Off - If checked, when a candle hits the stop loss, the trade will close on the next candle. If unchecked, the trade will remain open until the candle closes at or beyond the stop loss lines.
Custom Message Boxes - Primarily used for bots, but can be used to also insert your own messages for your trading alerts.
PMax on Rsi w/T3 *Strategy*Profit Maximizer Indicator on RSI with Tillson T3 Moving Average:
PMax uses ATR calculation inside, for this reason users couldn't manage to use PMax on RSI because RSI indicator doesn't have High and Low values in bars, but ATR needs that values. So I personally calculate RSI in a different way to have High and Low values of RSI wrt price bars.
IMPORTANT:
Because of the sudden movements and divergences on RSI , this indicator must firstly optimized for the charts before using. Optimization can be held by users for the meaningful parameters for each chart.
3 parameters are critical when optimizing:
First: Multiplier
Second: Tillson T3 Length
Third: T3 Volume Factor
Says, Kıvanç Özbilgiç. Here's the strategy version for you to backtest & optimize properly.
Enjoy.
Position size optimizer RNR_0// 1. When market volatility is severe, the use of equal weight systems is eliminated.
// 2. It is a bad strategy to concentrate bets since they drive the short position, which ultimately influences the whole book of trade.
// 3. Expect your short positions to get squeezed by at least 10% during the next five trading days.
// 4. When there are bear markets, the correlation goes to 1. Allow for the fact that both Longs and Shorts will go against you at the same time.
// 5. Unprofitable trades increase in magnitude rapidly.
// 6. Unlike in an up-trending market, there are no 2-3 wins. Winners shrink and contribute less. So, there is an opposite tendency toward oversized positions.
// 7. In contrast to a bull market, in contrast to the long. The winners shrink in size and contribute less. As a result, there is an inverse trend toward oversized positions.
// 9. The winners shrink in size, while the losers grow exponentially The challenge is to size positions in such a manner that they contribute favorably when successful but do not completely obliterate performance when unsuccessful.
Randomly select enter and exit
```
longCondition = bar_index % 33 == 0
if (longCondition and afterStartDate )
strategy.entry("buy", strategy.long, qty = qty)
shortCondition = bar_index % 44 == 0
if (shortCondition)
strategy.close("buy")
```
Know Sure Thing and EMA Strategy by JLXThis is a simple strategy based in Know Sure Thing indicator and an Exponential moving average,
Rules are as follow:
- You can go long when the KST cross signal bellow 0 and price closes above the target EMA
- You can go short when the KST cross signal above 0 and price closes bellow the target EMA
I include a trailing stop loss, default its 0.5%
Hope you enjoy it
EMAC - Exponential Moving Average CrossEMAC - Exponential Moving Average Cross
This strategy is based in part on original 10ema Basic Swing Trade Strategy by Matt Delong: www.tradingview.com
Link to original 10ema Basic Swing Trade Strategy:
This is the Original EMAC - Exponential Moving Average Cross strategy built as a class for reallifetrading dot com and so has all the default settings and has not been optimized. I would not recommend using this strategy with the default settings and is for educational purposes only. For the fully optimized version please come back around the same time tomorrow 6/16/21 for the EMAC - Exponential Moving Average Cross - Optimized
If you have any questions feel free to reach out to me with a comment and I will try to get back to you quickly with a reply.
Crypto Strategy for Bearish Markets (Binance, FTX, Futures...)BINANCE:BTCUSDTPERP
Even in months like May '21 you can win by going long on Bitcoin. This strategy proves it and is not overwhelmed by Elon's ...
The backtest was carried out during the month of May of this year and, as you can see, all the long operations opened during the fall were successful.
So if we are going to continue to have a bear market for some time, why not take advantage of it while we remain bulls?
This strategy uses Dollar-Cost-Average (DCA) to average the entry price. Thanks to this, it is able to close profitable trades even in times of great volatility and bearish pressure.
It includes alerts that can be configured that will be sent every time the conditions to operate are met. These alerts can also be linked with 3commas for a fully automatic operation.
For Leverage Futures or Margin traders, all you have to do is divide the initial capital by the leverage used.
Enjoy!
BTC|scanner|LONG|SHORT|30min STRATEGY- This strategy based on BTC|Scanner| v0.6b INDICATOR.
- Stop loss and take profit settings are available.
- This strategy can be used on a 30m timeframe and does not require fine tuning.
Detailed description of the strategy:
-According to the terms of the strategy:
-The initial deposit is $ 1000.
-The entry into the trade is carried out with the leverage from x3 to x8.
-Each entry/exit is shown by up/down arrows on the chart, the number of arrows shows the size of the leverage in the trade.
-Enter the trade with 100% of the deposit.
-All of the above suggests that with the input signal and the indication of the three arrows, an entry in the amount of$3000 will be made. If the shooter is 5, then$5000.
-Exit from the long/short position under the strategy conditions is carried out by 33% of the initial position volume on all TP (you can specify an unrealistic value of TP3, then the exit of 33% will be due only to an increase in the risk of further holding the position, but this can both increase profit and reduce it).
-To avoid distortion of the strategy indicators due to compound interest, it is recommended to take a period of a month to view statistics.
-The "Enter Confirm" field displays the confirmation of the trade, if several signals appear sequentially, the trade will be executed, and if the signal appears once, the trade will be skipped.
-The "ratio" field indicates the coefficient of change in activity on the current bar from the previous bar.
-The "Corner" field changes the angle of the stop loss correction depending on the time in the direction of reducing the loss.
-The "Short trigger" field indicates from which phase of activity you can open a short trade, conditionally this is a sinusoid with a lower limit of 0 and an upper limit of 100, but the sinusoid itself does not necessarily reach 0 and 100, the activity can stop at 80 and go towards 0 (initially the value 65 is specified).
-The "TP and Stop loss" fields are the percentage of profit / loss multiplied by 10. (the value 35 corresponds to 3.5%, 20-2% , and so on).
-The "cross action" field includes closing the trade when the activity sinusoid reaches the value of 99, regardless of any other calculations.
-The stop loss is displayed on the chart with orange and white dots.
The indicator and strategy can be applied not only to BTC , but it often has poor statistics on illiquid instruments.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- Эта стратегия основана на индикаторе BTC|Scanner| v0.6b.
- Доступны настройки стоп-лосса и тейк-профита.
- Эта стратегия может быть использована на 30-минутном таймфрейме и не требует тонкой настройки.
Подробное описание стратегии:
-Начальный депозит составляет 1000 долларов.
-Вход в сделку осуществляется с кредитным плечом от х3 до х8.
-Каждый вход/выход отображается стрелками вверх/вниз на графике, количество стрелок показывает размер кредитного плеча в сделке.
-Вход в сделку на 100% депозита.
-Все вышесказанное говорит о том, что с помощью входного сигнала и индикации трех стрелок будет совершен вход на сумму 3000 долларов. Если стрелок 5, то 5000 долларов.
-Выход из длинной/короткой позиции по условиям стратегии осуществляется на 33% от объема начальной позиции по всем ТП (можно указать нереальное значение ТП3, тогда выход на 33% будет обусловлен только увеличением риска дальнейшего удержания позиции, но это может как увеличить прибыль, так и уменьшить ее).
-Чтобы избежать искажения показателей стратегии из-за сложных процентов, рекомендуется использовать месячный период для просмотра статистики.
-В поле "Enter Confirm" отображается подтверждение сделки, если последовательно появится несколько сигналов, сделка будет выполнена, а если сигнал появится один раз, сделка будет пропущена.
-Поле "ratio" указывает коэффициент изменения активности на текущем баре по сравнению с предыдущим баром.
-Поле "Corner" изменяет угол коррекции стоп-лосса в зависимости от времени в направлении уменьшения убытка.
-Поле "Short trigger" указывает, с какой фазы активности вы можете открыть короткую сделку, условно это синусоида с нижней границей 0 и верхней границей 100, но сама синусоида не обязательно достигает 0 и 100, активность может остановиться на 80 и пойти в сторону 0 (изначально указано значение 65).
-Поля "TP и Stop loss" - это процент прибыли / убытка, умноженный на 10. (значение 35 соответствует 3,5%, 20-2% и так далее).
-Поле "cross action" включает закрытие сделки, когда синусоида активности достигает значения 99, независимо от любых других расчетов.
-Стоп-лосс отображается на графике оранжевыми и белыми точками.
Индикатор и стратегию можно применить не только к BTC , но зачастую он имеет плохую статистику на неликвидных инструментах.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Ichimoku EMA RSI - Crypto only long StrategyHey there!
Here I show you an Ichimoku Cloud Strategy.
I discovered the strategy on a YouTube channel and tried to transfer it as a strategy into a script.
He said in his video that you would make more profit with this strategy than holding the coin.
Tested with the crypto pair ETH/USDT in the four hour chart.
Period: beginning of 2017 until today.
The strategy should also work with foreign exchange. But then the settings have to be adjusted.
There is the possibility to activate two EMA's and a Stochastic RSI .
-----------------------------------------------------------------------------------
How does the strategy work?
ENTRY
The green Ichimoku lead line must above the red Ichimoku lead line - only the two lead lines are activated.
A green candle must closed above the green lead line.
EXIT
A red candle must close below the green Ichimoku lead line.
OPTIONAL ENTRY
EMA
Once you activate the EMA , long positions will only be taken once the EMA1 is above the EMA2.
Thereby I could observe a significant increase of the profit as well as a decrease of the maximum drawdown.
RSI
As soon as you activate the Stochastic RSI , long positions are only taken when the K line is above the D line.
In the future, I may add an oversold - undersold parameter.
The results of the strategy are without commissions and levers.
If you have any questions or feedback, please let me know in the comments.
If you need more information about the strategy and want to know exactly how to apply it, check out my profile.
I wish you good luck with the strategy!
EMA+RSI Pump & Drop Swing Sniper (SL+TP) - StrategyThis is the strategy version of the 'EMA-RSI-Pump-Drop-Swing-Sniper-With-Alerts':
Some additions with this strategy:
~Added Stop loss & Take profit control. In Settings > Inputs if the Stop Loss is at .051 that means it's 5.1% and the Take Profit at .096 is 9.6%. If you wish to remove the TP and SL just change the value to 1.00 and it would be the same as it being 100% TP and SL which is likely to never be hit.
~Added Backtesting by changing the month/date/year in Settings > Inputs
~Added a 2nd EMA line to assist with the long entry signals. I only use this for long entry & exits, though you could use the long exits as Short entries too. I just personally don't do short trading on Bitcoin.
This is using an EMA and RSI with slightly modified settings to give good entry and exit points while looking at Bitcoin. I use this on a 1-hour and 4-hour chart and with other indicators to find good positions to enter a trade or exit if things are turning red.
It's important to know this strategy was made as a request by another user that was using the indicator version. I don't use this as a trading strategy by itself, I use the visuals it gives as a confirmation with other indicators to find the best possible entry and exit positions.
If you click on the EMA line it will color the bars of the chart based on if they are above or below the EMA - This is just visually helpful for me to see the active trend.
Make sure you hover over or click on the EMA line to see the colors of the candles change - it's not visible by default or without doing this.
MACD/RVSI/Stoch/RSI/EXP(Drawdown)I have been trying for several months to get a script to work on the 1min and this one gives some good backtest results. This script will also work on higher timeframes however, I've not extensively tested on higher timeframes. My aim was to get results on about 20 crypto coins then run the 1min bots in parallel looking for small frequent profits across all the coins. If you would like me to try and fit backtest results to any coin or pair on any timeframe please do get in touch anytime.
It's based on several indicators which are combined and then a newish way for the stop loss to implement based on an exponential rising which limits the time in each trade unless the price moves in the direction of the trade. The other useful feature is drawdown minimization which previously made all of my 1minute bot attempts non-practical due to differences between backtesting and actually running the bot(s) live.
Its possible at the top to paste in strategy comments which can be used through web-hooks for auto trading bots. Leaving these blank just defaults to the pre-programmed comments that provide some indication of why a trade was exited.
It is possible to select for Short and/or Long trades. Note however, that there are exponential markers on the charts for both long and short trades in any setting. I found that this way the bot worked well with regards to timing.
The next part of the user interface settings gets a bit tricky so try and use the sample parameters provided below. For example, select a crypto coin then try some of the options below until a reasonable backtest result in obtained (or select the best from the parameter groups tested) then move down the settings interface to optimise with the remaining settings.
So 'Use MACD/RVSI', 'RSI clause' and 'Use Stochastic' are set to true for the below sample settings (1min timeframe).
MACD/RVSI Confluence Resolution (1min, 2min, 5min, 10min, 1hour)
Timeframe RSI (1min, 2min, 3min, 15min, 1hour)
FastStoch, SlowStoch (1min, 45min: 5min, 30min: 1min, 1hour: 5min, 1hour)
Eg. for FTX:ETHPERP (MACD/RVSI Confluence Resolution=1hour, Timeframe RSI= 1min, FastStoch = 1min, SlowStoch = 45min)
Setting the timings is tricky - there is a lot going on. Have a look at the chart and select/deselect the options. The MACD/RVSI Confluence Resolution shows red and green vertical regions on the chart background. The Timeframe RSI colors the candle bodies red and green. These go green if the RSI crossed over 31% or red in the RSI crossed under 69%. The MACD/RVSI Confluence Resolution is explained in more detail in one of my other scripts. Then the Slow Stoch colors above and below the price action with red or green lines depending if on an uptrend or downtrend (approximately). Where there is also an up/down trend on the faster timeframe stoch there are vertical shaded fill regions between the slow stop above/below lines.
With all the above conditions selected to represent the data (looking at strategy backtest results whilst adjusting) there is a reasonable approximation to a credible trade.
So once an ok backtest result is obtained by selecting timing settings. Its ontot the Stop Ramp Settings. This is an exponential line which rises rapidly after a period of time thus exiting the trade or going upwards with the trade. It kind of limits the maximum time a trade will stay in position which forms part of the timing aspect of this bot. Look at the chart exponential red lines and adjust the settings, along with the backtest results to select a good timing.
Then its the Drawdown Catcher and the Take Profit Setting. Start with the drawdown catcher disabled i.e. set to zero. Put in a conservative Take Profit, for example if a Take Profit at 6% gives the best backtest results, go for 4% to account for differences between backtest results and actual live bot performance.
Then start to increase the Drawdown Catcher. This shades a lime region where the bot will not enter a trade. I found that with most trades using this bot, if the price action moved in the direction of the trade (long or short) at the onset - this gave most of the good results (high probability of positive trade). Also if a trade entered at the start price and when south, the accumilated drawdown from these failing trades made all previous 1min bot attempt non=profitable in practice (even with good backtest results). The exp timing and also this drawdown reduction strategies seem to be the thing which makes this approach credible.
Try to go for settings that give a very high change of positive trade. For example, an 85% profitable trades will probably provide say 55% positive trades in practice as its always highly possible to just fit the parameters to the exact position/trade timings - and in reality going forwards these don't play out the same. Also a Profit Factor of 2 is about the minimum I would accept - again this provides for example a Profit Factor of 1.2 in practive.
However all being said - I think its possible with this bot on the 1min across lots of coins - with regularly updating settings - to make profits. (Not financial advice)
Please do get in touch if you would like me to fit this bot to anytimeframe to any trade.
MoonFlag PhD
Yusram Mount MaV - Day MaV CrossOver Strgty
This indicator shows the comparison between the 7-day fast simple average and the monthly slow average of 5 bars. The red line indicates the monthly green and blue lines the daily average. If the Green-Blue line crosses the red upwards, it is a buy signal and the opposite is a sell signal. As soon as it turns green blue without waiting for the sell signal, a sell signal is created. If you are trading fast, you can consider turning green to blue as an opportunity. In the long run, the red intersection can be interpreted as a Stop point.
I hope it will be useful to everyone.
You can also find the strategy indicator with the same name.
I got the name of this indicator from my daughter's name. The meaning of the name Yüsra means "convenience". I hope this indicator will help you.Yüsram Mount HO - Day HO
MACD Signal with RSI Indicating StrategyThis strategy looks for MACD signal crossover and RSI confirmation of oversold/overbought condition.
Tune to your crypto/stock for best results using the strategy and sent an alert. Currently set up to use 25% of equity at each buy signal and will sell 1/3 of position at each sell signal. Initial investment is $1000, but adjust as necessary.
Currently tuned to DOGEUSD on 30min chart.
If you like/use/profit, follow me or shoot me a donation. If you are looking for a script design, I can help.
SignalCAVE Strategy BuilderYou can create strategies without writing single line of Pine Script code!
Do backtesting, set alerts and explore algorithmic trading with using SignalCAVE Strategy Builder on TradingView.
SignalCAVE Strategy Builder for TradingView
SignalCAVE is a tool that help you to create strategies in TradingView. SignalCAVE offers flexible strategy builder panel enabling users to backtest and set alerts with custom conditions (selected indicators and parameters).
CAPABILITIES
You can define rules and conditions for “Long” and “Short” signals.
“Stop Loss” or “Take Profit” functions can be activated with providing percentage values.
“Only Long”, “Only Short” or both “Long and Short” signals can be used at the same time.
Available Indicators
EMA, SMA, WMA, HMA, RSI, MACD, Stochastic, Bollinger Bands, SuperTrend, Parabolic SAR, DMI, ATR, CCI, CMF, ROC, Ichimoku, OHLC Prices
How to Set Strategy Rules?
On SignalCAVE strategy settings screen, there are four types of input groups. You can populate these input boxes based on your strategy.
A: First indicator’s parameter and index value selection area
First Input: First indicator selection.
Second Input: First indicator’s parameter selection. If you want to use default parameters, select “Default Parameters”. If you want to use custom parameters, select “Custom Parameters”. If your selection was custom, then you need to fill “P:A” input boxes to assign your custom parameter.
Third Input: First indicator’s index selection. Default parameter is “0”, If you want to get previous value of indicator/price, you can type positive numbers.
?: Condition and Interval selection area.
You can select “Upper (>), Lower (<), Upper or Equal (>=), Lower or Equal (<=), CrossOver (⬆), CrossUnder (⬇)” conditions and time frame interval for calculation both first (A:) and second (B:) indicator.
B: Second indicator’s parameter and index value selection area
First Input: Second indicator selection.
Second Input: Second indicator’s parameter selection. You may use either default parameters, or custom parameters. If your selection was custom, then you need to fill “P:B” input boxes to assign your custom parameter.
Third Input: Second indicator’s index selection. Default parameter is “0”, If you want to get previous values of indicator/price, you can type positive numbers.
P:A First indicator’s custom parameter settings. If selected indicator has less then four parameters, you can fill unnecessary fields with “0” value.
P:B Second indicator’s custom parameter settings. If selected indicator has less then four parameters, you can fill unnecessary fields with “0” value.
DASHBOARD
After you build the strategy with SignalCAVE, you can see rules and conditions on dashboard with chart view screen.
Hint: By adding multiple times of SignalCAVE strategy on your chart screen, you can build more then one strategy.
STRATEGY TESTER / BACKTEST RESULTS
You can see strategy backtest results from “Strategy Tester” panel.
By changing parameters or strategy rules (strategy optimization), you may get better results. These results does not guarantee a success for future trades.
ALERT SETTINGS
If you want to get notify about your strategy outputs (Long Entry, Long Exit, Short Entry, Short Exit, Stop, Take Profit) you can set an “Alert”.
You can click “Alert” button to create a new alert. Make sure on “Conditions” selection must be “SignalCAVE” strategy.
Paste to “Message” field exactly the text below.
{{strategy.order.alert_message}}
Hint: By setting a single alarm, you can get notifications for all outputs.
Do your alerts modifies when you change the strategy conditions or parameters?
While the strategy got updated, its alerts still use the strategy’s state from the time when we made the alert (TradingView Wiki, 2018b).
This has the advantage that, once we made a script alert, we can change the script’s input options, change chart settings, or remove the script from to the chart. All of that won’t affect our existing alert. That gives a lot of flexibility to keep interacting with the chart and script.
But there’s also a disadvantage: if we do want our script’s alerts to change, we first need to remove the existing alerts. Then we have to create and configure new alerts based on the indicator’s updated code or settings.
MACD Trendprediction Strategy V1A trend following indicator based on the MACD and EMA. In this case, signals are not generated by crossing the signal lines as with the MACD, but as soon as the distance between the signal lines increases or decreases. A profit factor of 1.6-3.5 is achieved.
Ein Trendfolge-Indikator, auf der Basis des MACD und EMA. Dabei werden Signale nicht wie bei dem MACD per Kreuzung der Signallinien generiert, sondern sobald ein der Abstand der Signallinien zu oder abnimmt.
Dankland Playground Moneymaker - V2“version 2” of my playground bot script. Its essentially a powerhouse suite of strategies. Although it is similar to the previous script, it nets different results as sections have been changed. Such as the somewhat reluctant removal of the Chande Momentum... The RSIs have also been updated, this was one of the main changes. RSIS now include a Moving Average cross of RSI to generate signals above and below the given thresholds instead of simply on crossing a threshold. This should give greater functionality overall. Most functions including Moving Averages have been updated to include a wider range of kinds of moving averages. This includes not just the moving average cross, but MACD and RSIs as well. I tried to perform the same upgrade on the %B, Stochastics and SMI, but hit the unpacked code limit of 60,000 lines... So, more “versions” will have to come for future “upgrades”, with the recognition that there will be cases where the old, “downgraded” versions may perform better and that some people (like myself) may continue to use them on some markets until I/we devise superior settings on the new ones for said markets. For instance, instead of replacing my 1 hr BTCUSD bot (where I used the now deleted Chande to pretty pleasing affect...) I made a new one for LINKUSD 10 min so I can have both running for now and work on replacing the BTCUSD later.
How it works basically is this... you have 16 oscillators which can all be used as independently as you wish. They can be split up into different groups or ran all together.
When in separate groups they should not be able to sell eachothers positions without triggering a full stop loss by turning the Independence/Stop All switches on. Every single oscillator has its own entry and exit position sizing which can be stated as either a percent of balance or a flat amount of contracts (or both combined). Each oscillator has a minimum amount of profit you can tell it to sell it, which is calculated from the average cost of your current position, which does include all groups. This works out to help you average out better entry and exit prices, essentially a method of DCAing.
You can set the minimum sale amount, which is to keep it from placing orders below your exchanges minimum dollar trade cost.
All this functionality combined also ensures more accurate back tests by ensuring that the script simply cannot spend money it doesn't see as in the balance, whereas other scripts will use a percentage of equity, and once 100% of your equity is in BTC for instance, it will keep buying more BTC for free and thus spoof up backtest numbers. If you look through the strategies here, many people claim to have amazing scripts and then you look into it and this is happening and skewing their numbers. These people are either very ignorant or what they made or scam artists and trolls in my opinion.
This version also includes On Bar Close switches for each oscillator. When switched on, signals are only allowed to generate on Bar Close. This helps to prevent retriggering from live signals, which when you are running this many oscillators, will become a problem! However, in most cases, you do not need to generate signals intrabar, as backtests will show, ignoring intrabar buys and sells (intrabar stop losses can still be very important though!) won't exactly keep you from high profitability strategies, but rather, allowing elements of chaos from live indicators moving up and down intrabar will, in fact, drift your actual results further and further from the backtest. You want an accurate backtest though. So choose wisely when you turn these off and you will do better.
The included oscillators are as follows:
NO MORE Chande Momentum cross – REMOVED – I was hitting PINE code limits here so I had to make choices and this one simply had to go. Begone!
Moving Average Cross
MACD cross
%B Bollinger cross
Stochastic cross + region filter
Stochastic RSI cross + region filter
SMII cross and region filter
Three RMIs
Know-Sure-Thing line-cross
Coppock Curve line-cross
TRIX line-cross
RSI of MA w/ MA cross
RSI of MA of KST w/ MA cross
RSI of MA of Coppock Curve w/ MA cross
RSI of MA of Trix w/ MA cross
So the idea is that this is essentially multiple strategies combined into one backtestable house. Balance is calculated for all position sizes in order to try to prevent false entries that plague so many scripts (IE, you set pyramiding to 2, each buy $1000, initial balance $1000, and yet it buys two orders off the bat for $2000 total and nets 400% profit because the second was considered free, happens on 90+% of scripts on Tradingview if you aren't very very careful!)
You tune each indicator and position size them so that they work together as well as you can and in doing so you are able to create a single backtest that is capable of running a bot, essentially, between multiple strategies - you can run a slower Moving Average cross, a faster SMI cross or MACD , or Bollinger that grabs big moves only, all the while having MACD trade small bonuses along the way. This way you can weight the Risk to Reward of each against eachother.
I will not try to claim this is something you can open and with no work have the best bot on the planet. This scripts intention is to take a lot of relatively common trading strategies and combine them under on roof with some risk management and the ability to weigh each against eachother.
If you are looking for a super advanced singular algorithm that tries to capture every peak and valley exactly on the dot, this is not for you. If you are looking for a tool with a high level of customizability, with a publisher who intends to update it to the best of his ability in accordance to seeking to make the best product that I personally can make for both myself and the community (because I will be using this myself of course!) that was specifically designed with the intention of performing well in spot markets by averaging low entry costs and high exit costs, this is for you! That is the exact intention here. It can certainly work with margin, but you will have to take extra care in setting your stop losses. I intend to make a version capable of going short which will be included as part of the package. It may take some work to keep all of the risk management working as well for shorts though. There will be more scripts added to the “package” as I hit the limit on this one a few times and have had to keep some ideas out already.
The current backtest shown is hand-optimized by myself for Link /USD 10min market (Binance US – shouldn't need much work to fit to other exchange markets) with multiple stop losses.
Bear & Bull Zone Signal StrategySince I love to mix and match, here is something fresh and that actually works on the breakout of Ethereum without losing your ass on lagging indicators.
It blends some of the nice parts of my previous scripts while moving to big boy pants with a twist on the Fibonacci retracement using SMA and EMA at multiple levels to do a sanity check.
Is it too good to be true? Nope, just what happens when a Solution Architect starts messing around with crypto and applies engineering and mathematics to the mix. You get a strategy that really doesn't have high profit losses when you tweak it just the right way.
What's the right tweak you ask?
1. Start with a 30 minute timeframe and set your window start date to the date the market began the bear or bull run
2. Make sure you can see your strategy performance window (not the graph one)
3. Set Stop Loss and Target Profit to 50%
4. Use your mouse wheel or up and down arrows and mess around with the RSI, go down one at a time but no lower than 7. Whichever value displayed the highest long or short gain is the one to pick.
5. Now select long or short only based on whichever one shows the highest gain.
6. Now go to K and D, leave K as 3 and check what happens when D is 4 or 5. Leave D at the value that gives you the highest gain.
7. Now go to EMA Fast and Slow Lengths. Leave Fast at 5 and check what happens when the Slow is moved up to 11 or 12, do the gains go up. If not, check what happens when Slow is moved down to 9, 8, or 7. Whichever gives you the highest gain, leave it there. Now go mess with the fast length, keep in mind that fast must always be less than slow. So check values down to 3 and up to 6. Same concept, mo money...leave it be.
8. Now go mess with the Target Profit, I start at 5, hit enter, then go to 7, hit enter, then 9...up by 2 until I get to 21 to make sure I don't hastily pick a low one and always keep in mind between which values the gain switched from high to low. For example, in this example I published at 11 it was $5k and at 13 it was $3700 for the gains. So after I got up to 21 I went back to 11 and started going up by 0.01 steps until the value dropped, which was at 11.19 so I set it at 11.18.
9. Now stop loss is trickier, you've maximized the gains, which means if you set the stop loss at a low value you will sacrifice gains. Typically by this point your loss is less than 10% with this script. So, my approach is to find the value where the stop loss doesn't change what I've tweaked already. In this example, I did the same start at 5 and go up by 2 and saw that when I went to 17 it stopped changing. So I started going back down by 0.5 and saw at 15.5 the gains went lower again. Now I started going back up in steps of 0.01 and at 15.98 it went back to the high gain I already tweaked for. I kept stop loss there and unleashed the strategy on ETH.
So far so good, no bad trades and it's been behaving pretty well.