Dagger V1 strategyThe "Dagger V1 strategy" strategy is used for the backtest of the "Dagger V1 indicator & alerter" indicator. Their algorithm is identical. Further, all descriptions of the settings are the same for the strategy and the indicator.
Dagger is used for trading on the cryptocurrency spot market, but it can also be used for any other fairly volatile pairs.
Dagger shows the best results on the H1 timeframe, but you can experiment with other timeframes.
The logic of Dagger's work is based on the search for the optimal entry point into the market and the best moment to close a deal. Stochastic oscillator and exponential moving EMA are used for this. Also, the exit from the transaction can be optimized using several parameters.
The strategy can use trailing up to one or more red bars in order not to miss the sharp growth of the currency.
Осцилляторы
inside bar strategy Wıth SL-TP Based on strat bars to enter trades, you can use it with very low stop loss level and try all coins in daily frequency
TemaVWAPRSI StrategyExchange: Kraken
Timeframe: 5m
Pair: ETH/USD
If you use this for any other exchange or pair, you'll have to tweak the settings, most importantly are the trailing stop ticks. This strategy is currently in what I would call beta mode. It uses the volume weighted average price indicator, rate of change, two triple exponential moving averages and the relative strength index to find buy and sell signals.
Trend AlgoA NRTH_ Premium Momentum Based Strategy
Comes included with the Premium Package.
Indicator features
Built-In Alerts
Visual Risk Management
Customizable Entry Rules
Usage Tips
This strategy works on timeframes as low as 5m, great for scalping or day trading.
The algo identifies price momentum with strict entry signal settings (can be made more or less sensitive).
Works for all markets with the ability to customize to your liking.
Backtesting Results Info
Period 1/1/2021-1/10/2021
Entry value at $1000 with 10x leverage
Binance standard taker fee rate (0.04%)
ATR Exits : 1:2 RR
-------------------------------------------
Disclaimer
Copyright NRTH_ Indicators 2021.
NRTH_ and all affiliated parties are not registered as financial advisors. The products & services NRTH_ offers are for educational purposes only and should not be construed as financial advice. You must be aware of the risks and be willing to bear any level of risk to invest in financial markets. Past performance is not necessarily indicative of future results. NRTH_ and all individuals associated assume no responsibility for your trading results or investments.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, or individual’s trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
MA&AOThat is quit simple strategy, which combines only two indicators: AO and MA. The logic of trades is also clear, when AO is bullish; slow ma is under the close price; fast ma > slow ma - buy.
TemaRSI StrategyThis strategy uses a triple exponential moving average (Tema) and RSI to find buy points and uses stops, trailing stops and take profit to exit. Draft 1.
Take Profit On Trend (by BHD_Trade_Bot)The purpose of strategy is to detect long-term uptrend and short-term downtrend so that you can easy to take profit.
The strategy also using BHD unit to detect how big you win and lose, so that you can use this strategy for all coins without worry about it have different percentage of price change.
ENTRY
The buy order is placed on assets that have long-term uptrend and short-term downtrend:
- Long-term uptrend condition: ema200 is going up (rsi200 greater than 51)
- Short-term downtrend condition: 2 last candles are down price (use candlestick for less delay)
CLOSE
The sell order is placed when take profit or stop loss:
- Take profit: price increase 1 BHD unit
- Stop loss: price decrease 2 BHD units
The strategy use $15 and trading fee is 0.1% for each order. So that, in the real-life, if you are using trade bot, it will need $1500 for trading 100 coins at the same time.
Pro tip : The 1-hour time frame for altcoin/USDT has the best results on average.
RSI+CMO Hybrid StrategyThis strategy is based on the RSI+CMO Hybrid Index I created. I modified both the original RSI and CMO so that the RSI+CMO Index value ranges from -100 to +100 and defined as follows. When the RSI+CMO Hybrid Index values close above the Bull Level and below the Bear Level, the strategy will trigger long and short signals respectively. This newly defined hybrid RSI+CMO indicator showed better win rates and better profits than the original CMO strategy. The default setting for this strategy is optimized for an 8-hour candle. For candles at different times, try to find the optimal value yourself.
* I was going to open the script, but recently there was a case of stealing my script and publishing it without permission, so I decided not to disclose it.
▶ Modified RSI = Original RSI - 50
Therefore,
Original RSI (0 ~ 100) → Modified RSI (-50 ~ +50)
▶ Modified CMO = Original CMO * 0.5
Therefore,
Original CMO (-100 ~ +100) → Modified CMO (-50 ~ +50)
▶ RSI+CMO Hybrid Index = Modified RSI + Modified CMO
Therefore,
RSI+CMO Hybrid Index (-100 ~ +100)
________________________________________________________
이 전략은 기존의 RSI와 CMO 지표를 수정하여 새롭게 정의한 하이브리드 RSI+CMO 지표를 기반으로 만들어졌습니다. 지표 값의 범위가 -100에서 100의 범위를 가질 수 있도록 기존의 RSI와 CMO를 수정하여 만들었습니다. RSI+CMO Hybrid Index 값이 Bull Level 이상과 Bear Level 아래에서 봉마감을 하면 이 전략은 각각 롱과 숏 신호를 트리거합니다. 이렇게 새롭게 정의된 RSI+CMO 지표는 기존 CMO 전략 대비 승률과 수익이 더 우수합니다. 이 전략의 세팅 기본값은 8시간봉에 최적화 되어있습니다. 다른 시간대 봉에서는 최적값을 직접 찾아보십시오. 그리고 이전략은 RSI+CMO Hybrid Index와 함께 사용하면 Long과 Short 신호를 예측할 수 있어 편리합니다.
* 최근에 제 스크립트를 도용/표절하여 무단으로 퍼블리쉬한 사례가 발생하여 더 이상 스크립트는 공개하지 않기로 하였습니다.
PSAR + EMA/TEMA/RSI/OBVThe Parabolic Stop-and-Reservse (PSAR) is a trend indicator, intended to capture reversal signals and show entry and exit points. The PSAR is bullish when the PSAR is below the candle body (usually indicated by a dot) and bearish when the PSAR is above the candle body. The PSAR generally only moves in the direction of the trend, making it useful for markets with an upward or downward trend, as well as swing markets. It is weaker when the market it sideways, as it can be prone to frequent flips (bull-to-bear or vice versa) in markets where a predominant trend is not present.
In order to combat the tendency for rapid swings in the PSAR, it is commonly paired with a second indicator. Often, this is a moving average (MA) to confirm the PSAR signal. Here is a common example:
PSAR + 2 EMAs: A trade would consider entering long when the PSAR is bullish and the fast EMA is above the short EMA.
PSAR + 3 EMAs: As above, but the trader could also add a very long EMA (200, for example) and use that as an additional filter.
In addition to using EMA, other MAs can be used and may be more appropriate to certain instruments and timeframes. Using TEMA, for example, may result in less lag but introduce more noise. Likewise, the Ehler's MAMA is an option.
Some traders use other indicators as PSAR confirmation signals, such as the relative strength index (RSI) on on-balance volume (OBV). The strategy is similar:
bullish PSAR + RSI oversold = consider long entry
bullish PSAR + OBV oscillator > 0 = consider long entry
The strategy presented here is based on my PSAR + EMA + TEMA study. Any of the above strategies are supported by this script:
1. The PSAR is the primary signal.
2. Confirmation is provided by any of the following: EMA , TEMA , Ehler's MAMA , RSI , or OBV.
3. You may use a third EMA (set to 200 as the default) to filter entries -- if used, the strategy will only show signals if the price is above the third (additional) EMA .
For example, a normal long signal would be a bullish PSAR + fast EMA > slow EMA + price > ema 200.
In addition, you may use a SL, which is set to the PSAR dots shown. You may also limit the backtesting dates. (Please note in the chart above, I do not have a limit on the trading dates. I believe this exaggerates the success of the strategy, but the house rules demand I not limit the timeframe to show you a more accurate picture.)
3Commas DCA Bot Strategy v1.0Introduction
The strategy attempts to implement a majority all of the settings found on the 3Commas DCA Bot setting page that can be implemented within a TradingView indicator. Specifically, it will implement the "Open new trade ASAP" and "Trading View Custom Signal" deal start conditions. In this way, you can leverage the power of TradingView's backtester to model your settings and analysis past performance as well as leverage TradingView's alert notification subsystem to send Deal Start and Close signals to 3Commas using almost any of the thousands of scripts found in the Public Library (see "What does it do and how does it do it?" section below for more information on how to do this using the RSI indicator as an example).
How is it original and useful?
This strategy is unique in that it's the only one (as of the initial publications) that can handle 28 out of 32 bot settings (88% coverage) that are found on the 3Commas bot settings page. In addition, because it is a TradingView script, you will benefit from the following:
Model your bot's configuration using the backtester on any timeframe and evaluate its performance using the chart's history.
View a table of detailed statistics pertaining to deals started and completed, win/loss rates, daily P&L, true max drawdown, and detailed statistics on bars in deal along with safety orders filled.
View a table of "Used amount for each step" as presented in 3Commas as well.
Ability to link to almost any TradingView chart indicator that provides a single data point for buy/sell signals.
Make use of the 3Commas TA Start Conditions indicator to emulate the 3Commas built-in indicators for further performance evaluation with the backtester.
How does it compare to other scripts in the Public Library?
This strategy offers a very detailed, comprehensive settings and maybe the only one (as of the initial publication) that can handle 28 out of the 32 bot settings that are found on the 3Commas bot settings page (that can be handled within TradingView, because some cannot be modeled due to chart and language constraints). Specifically, the following 3Commas bot settings and inputs are addressed with asterisks denoting specific limitation due to TradingView's platform architecture and/or constraints:
Main settings
✅ Name
❌ Exchange* (Not handled since it is inherited from chart)
⚠ Bot type* (Only Single-pair because you simply apply the indicator to as many pairs you desire in separate charts to simulate a Multi-pair setting)
Pairs
❌ Pairs* (Not handled since it is inheriting the symbol from the chart)
Strategy
✅ Strategy
❌ Profit currency* (Not handled since there is no equivalence in TradingView)
✅ Base order size / unit
✅ Safety order size / unit
✅ Start order type
Deal start condition
⚠ TradingView* (You can modify the "Technical Rating" indicator by TradingView to output a signal yourself like @TheTradingParrot has done in the TV signal for DCA backtest script)
⚠ QFL* (See Quickfingers Luc's Base Breaking Strategy v2.5 - 3Commas Edition for an alternative)
❌ Manually/API* (Not handled since there is no equivalence in TradingView)
✅ Trading View custom signal
✅ Open new trade asap
Take profit
✅ Take profit (%)
✅ Take profit type
✅ Trailing
⚠ Trailing deviation* (modified to handle TradingView's broker emulator properly)
Stop loss
✅ Stop Loss (%)
✅ Stop Loss action
⚠ Stop Loss timeout* (modified to use "bars" as the unit of measure)
Safety orders
✅ Max safety trades count (a total of 100 safety orders are supported!)
⚠ Max active safety trades count* (Not handled since there is no equivalence in TradingView)
✅ Price deviation to open safety orders (% from initial order)
✅ Safety order volume scale
✅ Safety order step scale
Advanced settings
✅ Don't start deal(s) if the daily volume is less than
✅ Minimum price to open deal
✅ Maximum price to open deal
⚠ Deal start delay (QFL and standard TV signals only)* (modified to use "bars" as the unit of measure)
✅ Cooldown between deals
✅ Open deals & stop
Close deal after timeout
⚠ The time after which, deal will be closed automatically* (modified to use "bars" as the unit of measure)
In addition to the above inputs, the script will also support the same output data points that are found on the bot settings page, which are:
Assistant
✅ Balance
✅ Max amount for bot usage (Based on current rate)
✅ Max safety order price deviation
✅ % of available balance to be used by the bot
Table (Used amount for each step)
✅ Order No.
✅ Deviation %
✅ Order Size (Base currency)
✅ Order Volume (Quote currency)
✅ Price
✅ Average price
✅ Required price
✅ Required change
✅ Total Size (Base currency)
✅ Total Volume (Quote currency)
What does it do and how does it do it?
When applied to the chart for the first time, the default settings will work to execute the "Open new trade asap" deal start condition using a take profit of 4%, a base order size of 1.335% of equity (initial capital + net profit), a safety order size of 2.003% of equity (initial capital + net profit), a safety order volume scale of 1.5, a safety order step scale of 1.21, and a max safety trades count of 8. With these settings, as you scroll through the chart's history you should see price action crossing the DCA layers (denoted with blue triangles), and a green take-profit price line will render (with green triangle denoting the crossings). Lastly, in the upper-right corner of the chart the table of DCA statistics will render showing you all the gathered data that took place since the chart's starting history until the current time.
Using the "TV Custom Signal" section will allow you to "link" other chart indicators to supply "Start" and "Close" signals for the script. For example, here's how you can use the standard RSI indicator to generate an entry signal:
1) Add the stock RSI indicator and configure it to your desire.
2) Select the "RSI" indicator in the "Chart/Indicator Data Point" input.
3) Select "Chart/Indicator Data Point" in the "Start Deal When" input.
4) Select "Less Than" in the "Is" input.
5) Select "Custom Value(s)" in the "The Value Of" input.
6) Enter "25" in the "Custom Value 1 (Single or Lower Bound)" input.
7) Select "Trading View Custom Signal" in the "Open new trade" input (in the DEAL START CONDITION section).
8) Lastly, check the checkbox with a horizontal straight line above the "Start Deal When" input.
This means that the indicator will start a deal when the "RSI indicator" is "Less Than" the value of "25".
Strategy Results
The default settings are designed to ensure that the indicator will render chart elements when first loaded as well as to allow the backtester to gather order executions and display performance summary. The chart above is is using $10,000 initial capital, a commission rate of 0.1% for both entries and exits, and a 1 tick slippage setting. It is also using 3.22581% of the equity for the Base Order Size, 6.45161% of equity for the first Safety Order Size. The Maximum Safety Trade Count is 4 with a Safety Order Volume Scale of 2, a Safety Order Step Scale of 1.53, Price Deviation To Option Safety Orders at 5.3, and a take profit of 4.5% with Trailing turned on at a deviation of 1.5%. All other settings are defaults.
It is recommended that the indicator be "tuned" for your specific market in order to best implement the strategy and obtain better desirable results. You do so by using the backtester and statistics table and observe the output values and learn how the indicator is performing in the chart history. Using this information, you can adjust the settings accordingly until you find the settings acceptable to your trading goals and risk tolerance.
Always keep in mind that past performance may not be indicative of future results. Settings that seem favorable for one market may be found to be disastrous in another. Therefore, do take the time needed to understand how the settings will behave with the given chart symbol.
Enjoy! 😊👍
How to obtain access to the script?
You have two choices:
Use the "Website" link below to obtain access to this indicator, or
Send us a private message (PM) in TradingView itself.
Go_up vwap-rsiIt is the popular RSI indicator with VWAP as a source instead of close.
VWAP (Volume Weighted Average Price) is one of the derived moving average indicators that takes volumes into account in price averaging. VWAP stands for Volume Weighted Average Price.
//LOGIC ENTRY:
Length RSI+VWAP
Oversold - bottom line RSI-VWAP
//EXIT SETTING:
Take profit and stop loss when a certain percentage is reached
//Settings next entry and grid:
Allow signal lower than,% - the next entry into a trade from logic occurs only when a decrease by a certain percentage
Allow grid,% - when the price drops by the percentage specified in the settings, the entry will take place, but only on the next bar.
//DATA RANGE:
-Testing results for any period of time
//PS:
For this strategy, we use pyramiding, we adjust the number of inputs in the "properties" section, by default left 20.
Look at the results in the past and adjust the settings for your capabilities and pitfalls. The default costs 25 entries for $ 400
Change the settings - find better results. share in the comments
[TVExtBot]Heikinashi Upswing Strategy(30m&1h&2h)The Heikin-Ashi Upswing Strategy is a trend-following strategy suitable for short-term trading that utilizes Heikin-Ashi to follow an upward trend and realizes profits only in a rising market.
하이킨아시 업스윙 전략은 하이킨아시를 활용하여 상승하는 추세를 따라가며 상승장에서만 수익을 실현하는 단기매매에 적합한 추세추종 전략입니다.
* Buy Signal
The close price of the Heikin-Ashi candle was higher than the open price, and a golden cross occurred in the short-term EMA.
하이킨아시 캔들의 종가가 시가보다 크고 단기 EMA에 골든클로스가 발생.
* Sell Signal
The open price of the Heikin-Ashi candle is higher than the close price, the short-term EMA is dead cross, and overbought occurs.
하이킨아시 캔들의 시가가 종가보다 크고 단기 EMA가 데드클로스이고 과매수가 발생.
※Long만 사용가능한 전략입니다.(This is a strategy that only Long can use.)
Default Options(기본설정)
Short-Term Volatility (단기변동성) : 96 (※1)
Long-Term Volatility (장기변동성) : 97 (※1)
Take Profit (%) (익절) : 15%
Trailing Stop(%) (트레일링 스탑) : 10%
(※1) The lower the value, the more aggressive the buy.(값이 낮을수록 매수가 공격적입니다.)
Hophop Reversion Strategy
█ OVERVIEW
Mean reversion is a financial term assuming that an asset's price will tend to converge to the average price over time.
Due to the trending nature of the crypto markets, mean reversion on a high timeframe could be pretty dangerous. When it comes to running mean reversion strategy on low timeframe, commission and slippage may cost more than strategy gains.
In this strategy, I tried to achieve being conservative in the trending market while avoiding trades if necessary and trading high probability reversion opportunities .
█ CONCEPTS
Strategy is build based on the combination of the momentum and the historical / implied volatility; when the price exceeds the potential volatility range, the strategy places the orders, and the target point is the mean of the expected range high and range low.
The range low and high lines displayed on the chart shows where to short or long, to make sure that the orders are limit orders; orders are placed 0.5% above/below the ranges!
Key information about the strategy
• All the orders are limit entry
• 0.02% commission is included in the backtest
• 30 ticks set for Verify Price Limit for Orders
• 30 ticks set for Slippage
• Initial version does not include the money management and hard stops hence you need to be extra cautious in trending markets
• Restricted to be used for BTC and ETH for 15 min timeframe
█ Ozet
Ortalamaya dönme, bir varlığın fiyatının zaman içinde ortalama fiyata yakınsama eğiliminde olacağını varsayan bir finansal terimdir.
Kripto piyasalarının trend egilimli doğası nedeniyle, yüksek zaman diliminde ortalamaya dönüş oldukça tehlikeli olabilir.
Ortalama geri dönüş stratejisini düşük zaman diliminde calistirmak söz konusu olduğunda, komisyon ve kayma, strateji kazanımlarından daha pahalıya mal olabilir.
Bu stratejide, gerektiğinde alım satımlardan kaçınırken ve yüksek olasılıklı ortalamaya dönüş fırsatlarını degerlendiren, trend olan piyasada ise isleme girerken temkinli olmasi uzerine calistim
█ Aciklama
Strateji, momentum ve tarihsel / zımni oynaklığın birleşimine dayalı olarak inşa edilmistir; fiyat potansiyel oynaklık aralığını aştığında, strateji emirleri verir ve hedef nokta, beklenen yüksek aralığın ve düşük aralığın ortalamasıdır.
Grafikte görüntülenen aralık alt ve üst satırları,
Stratejiye ait onemli bilgiler/b]
• Tüm emirler limit emirdir girişlidir
• Backtest performansinda %0.02 komisyon dahildir
• Limit Emir fiyat dogrulamasi icin 30 tick bekleme kullanilmistir
• Slippage için 30 tick bekleme kullanilmistir
• İlk sürüm para yönetimini ve stoploss içermez, bu nedenle trend olan piyasalarda ekstra dikkatli olmanız gerekir.
• 15 dakikalık zaman dilimi ile BTC ve ETH için kullanımla sınırlıdır
Emirlerin limit emir olduğundan emin olmak için nerede short veya long isleme girilecegini gosteren cizgilerin %0.5 üstünde/altında verilir!
Combo Backtest 123 Reversal & T3 Averages This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This indicator plots the moving average described in the January, 1998 issue
of S&C, p.57, "Smoothing Techniques for More Accurate Signals", by Tim Tillson.
This indicator plots T3 moving average presented in Figure 4 in the article.
T3 indicator is a moving average which is calculated according to formula:
T3(n) = GD(GD(GD(n))),
where GD - generalized DEMA (Double EMA) and calculating according to this:
GD(n,v) = EMA(n) * (1+v)-EMA(EMA(n)) * v,
where "v" is volume factor, which determines how hot the moving average’s response
to linear trends will be. The author advises to use v=0.7.
When v = 0, GD = EMA, and when v = 1, GD = DEMA. In between, GD is a less aggressive
version of DEMA. By using a value for v less than1, trader cure the multiple DEMA
overshoot problem but at the cost of accepting some additional phase delay.
In filter theory terminology, T3 is a six-pole nonlinear Kalman filter. Kalman
filters are ones that use the error — in this case, (time series - EMA(n)) —
to correct themselves. In the realm of technical analysis, these are called adaptive
moving averages; they track the time series more aggres-sively when it is making large
moves. Tim Tillson is a software project manager at Hewlett-Packard, with degrees in
mathematics and computer science. He has privately traded options and equities for 15 years.
WARNING:
- For purpose educate only
- This script to change bars colors.
EMR Strategy [H1 Backtesting]EMR Strategy base on EMA, MACD and RSI to supply signal on time frame H1.
Details of Rule as below:
===
1.EMA
+ Time frame: H1
+ Periods: 25, 100 (~ EMA 25 H4), 600 (~ EMA 25 D1)
===
2.MACD
+ Time frame: H1
+ Periods: 12,26,9
===
3.RSI
+ Time frame: H1
+ Periods: 14
===
4.Trading Rule
4.1.Long Position
+ MACD>0 and RSI>50 and close price moving above EMA 25
+ Close price crossed EMA 100 or crossed EMA 600 at the first time
4.2.Short Position
+ MACD<0 and RSI<50 and close price moving below EMA 25
+ Close price crossed EMA 100 or crossed EMA 600 at the first time
===
5.Money Management
+ This strategy concentrate into winrate.
+ So use trailing stop to protect your profits.
+ And use stoploss to avoid big loss on trades.
MACD + BB + RSI Strategy [Alorse]A very simple and highly effective strategy that combines 3 famous indicators:
MACD
Bollinger Bands
RSI
Entry conditions are:
The MACD line crosses over the signal line.
RSI less than 50
Price below the BB baseline
Exit conditions are:
RSI greater than 70
Closing price higher than the upper BB
Or when the price hits the Stop Loss defined by you (Feature).
Combo Backtest 123 Reversal & Stochastic Crossover This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This back testing strategy generates a long trade at the Open of the following
bar when the %K line crosses below the %D line and both are above the Overbought level.
It generates a short trade at the Open of the following bar when the %K line
crosses above the %D line and both values are below the Oversold level.
WARNING:
- For purpose educate only
- This script to change bars colors.
Webhook Starter Kit [HullBuster]
Introduction
This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins.
The source code is written in a self documenting style with clearly defined sections. The sections “communicate” with each other through state variables making it easy for the strategy to evolve and improve. This is an excellent place for Pine Language beginners to start their strategy building journey. The script exhibits many Pine Language features which will certainly ad power to your script building abilities.
This script employs a basic trend follow strategy utilizing a forward pyramiding technique. Trend detection is implemented through the use of two higher time frame series. The market entry setup is a Simple Moving Average crossover. Positions exit by passing through conditional take profit logic. The script creates ten indicators including a Zscore oscillator to measure support and resistance levels. The indicator parameters are exposed through 47 strategy inputs segregated into seven sections. All of the inputs are equipped with detailed tool tips to help you get started.
To improve the transition from simulation to execution, strategy.entry and strategy.exit calls show enhanced message text with embedded keywords that are combined with the TradingView placeholders at alert time. Thereby, enabling a single JSON message to generate multiple execution events. This is genius stuff from the Pine Language development team. Really excellent work!
This document provides a sample alert message that can be applied to this script with relatively little modification. Without altering the code, the strategy inputs can alter the behavior to generate thousands of orders or simply a few dozen. It can be applied to crypto, stocks or forex instruments. A good way to look at this script is as a webhook lab that can aid in the development of your own endpoint processor, impress your co-workers and have hours of fun.
By no means is a webhook required or even necessary to benefit from this script. The setups, exits, trend detection, pyramids and DCA algorithms can be easily replaced with more sophisticated versions. The modular design of the script logic allows you to incrementally learn and advance this script into a functional trading system that you can be proud of.
Design
This is a trend following strategy that enters long above the trend line and short below. There are five trend lines that are visible by default but can be turned off in Section 7. Identified, in frequency order, as follows:
1. - EMA in the chart time frame. Intended to track price pressure. Configured in Section 3.
2. - ALMA in the higher time frame specified in Section 2 Signal Line Period.
3. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
4. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
5. - DEMA in the higher time frame specified in Section 2 Trend Line Period.
The Blue, Green and Orange lines are signal lines are on the same time frame. The time frame selected should be at least five times greater than the chart time frame. The Purple line represents the trend line for which prices above the line suggest a rising market and prices below a falling market. The time frame selected for the trend should be at least five times greater than the signal lines.
Three oscillators are created as follows:
1. Stochastic - In the chart time frame. Used to enter forward pyramids.
2. Stochastic - In the Trend period. Used to detect exit conditions.
3. Zscore - In the Signal period. Used to detect exit conditions.
The Stochastics are configured identically other than the time frame. The period is set in Section 2.
Two Simple Moving Averages provide the trade entry conditions in the form of a crossover. Crossing up is a long entry and down is a short. This is in fact the same setup you get when you select a basic strategy from the Pine editor. The crossovers are configured in Section 3. You can see where the crosses are occurring by enabling Show Entry Regions in Section 7.
The script has the capacity for pyramids and DCA. Forward pyramids are enabled by setting the Pyramid properties tab with a non zero value. In this case add on trades will enter the market on dips above the position open price. This process will continue until the trade exits. Downward pyramids are available in Crypto and Range mode only. In this case add on trades are placed below the entry price in the drawdown space until the stop is hit. To enable downward pyramids set the Pyramid Minimum Span In Section 1 to a non zero value.
This implementation of Dollar Cost Averaging (DCA) triggers off consecutive losses. Each loss in a run increments a sequence number. The position size is increased as a multiple of this sequence. When the position eventually closes at a profit the sequence is reset. DCA is enabled by setting the Maximum DCA Increments In Section 1 to a non zero value.
It should be noted that the pyramid and DCA features are implemented using a rudimentary design and as such do not perform with the precision of my invite only scripts. They are intended as a feature to stress test your webhook endpoint. As is, you will need to buttress the logic for it to be part of an automated trading system. It is for this reason that I did not apply a Martingale algorithm to this pyramid implementation. But, hey, it’s an open source script so there is plenty of room for learning and your own experimentation.
How does it work
The overall behavior of the script is governed by the Trading Mode selection in Section 1. It is the very first input so you should think about what behavior you intend for this strategy at the onset of the configuration. As previously discussed, this script is designed to be a trend follower. The trend being defined as where the purple line is predominately heading. In BiDir mode, SMA crossovers above the purple line will open long positions and crosses below the line will open short. If pyramiding is enabled add on trades will accumulate on dips above the entry price. The value applied to the Minimum Profit input in Section 1 establishes the threshold for a profitable exit. This is not a hard number exit. The conditional exit logic must be satisfied in order to permit the trade to close. This is where the effort put into the indicator calibration is realized. There are four ways the trade can exit at a profit:
1. Natural exit. When the blue line crosses the green line the trade will close. For a long position the blue line must cross under the green line (downward). For a short the blue must cross over the green (upward).
2. Alma / Linear Regression event. The distance the blue line is from the green and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 6 and relies on the period and length set in Section 2. A long position will exit on an upward thrust which exceeds the activation threshold. A short will exit on a downward thrust.
3. Exponential event. The distance the yellow line is from the blue and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 3 and relies on the period and length set in the same section.
4. Stochastic event. The purple line stochastic is used to measure overbought and over sold levels with regard to position exits. Signal line positions combined with a reading over 80 signals a long profit exit. Similarly, readings below 20 signal a short profit exit.
Another, optional, way to exit a position is by Bale Out. You can enable this feature in Section 1. This is a handy way to reduce the risk when carrying a large pyramid stack. Instead of waiting for the entire position to recover we exit early (bale out) as soon as the profit value has doubled.
There are lots of ways to implement a bale out but the method I used here provides a succinct example. Feel free to improve on it if you like. To see where the Bale Outs occur, enable Show Bale Outs in Section 7. Red labels are rendered below each exit point on the chart.
There are seven selectable Trading Modes available from the drop down in Section 1:
1. Long - Uses the strategy.risk.allow_entry_in to execute long only trades. You will still see shorts on the chart.
2. Short - Uses the strategy.risk.allow_entry_in to execute short only trades. You will still see long trades on the chart.
3. BiDir - This mode is for margin trading with a stop. If a long position was initiated above the trend line and the price has now fallen below the trend, the position will be reversed after the stop is hit. Forward pyramiding is available in this mode if you set the Pyramiding value in the Properties tab. DCA can also be activated.
4. Flip Flop - This is a bidirectional trading mode that automatically reverses on a trend line crossover. This is distinctively different from BiDir since you will get a reversal even without a stop which is advantageous in non-margin trading.
5. Crypto - This mode is for crypto trading where you are buying the coins outright. In this case you likely want to accumulate coins on a crash. Especially, when all the news outlets are talking about the end of Bitcoin and you see nice deep valleys on the chart. Certainly, under these conditions, the market will be well below the purple line. No margin so you can’t go short. Downward pyramids are enabled for Crypto mode when two conditions are met. First the Pyramiding value in the Properties tab must be non zero. Second the Pyramid Minimum Span in Section 1 must be non zero.
6. Range - This is a counter trend trading mode. Longs are entered below the purple trend line and shorts above. Useful when you want to test your webhook in a market where the trend line is bisecting the signal line series. Remember that this strategy is a trend follower. It’s going to get chopped out in a range bound market. By turning on the Range mode you will at least see profitable trades while stuck in the range. However, when the market eventually picks a direction, this mode will sustain losses. This range trading mode is a rudimentary implementation that will need a lot of improvement if you want to create a reliable switch hitter (trend/range combo).
7. No Trade. Useful when setting up the trend lines and the entry and exit is not important.
Once in the trade, long or short, the script tests the exit condition on every bar. If not a profitable exit then it checks if a pyramid is required. As mentioned earlier, the entry setups are quite primitive. Although they can easily be replaced by more sophisticated algorithms, what I really wanted to show is the diminished role of the position entry in the overall life of the trade. Professional traders spend much more time on the management of the trade beyond the market entry. While your trade entry is important, you can get in almost anywhere and still land a profitable exit.
If DCA is enabled, the size of the position will increase in response to consecutive losses. The number of times the position can increase is limited by the number set in Maximum DCA Increments of Section 1. Once the position breaks the losing streak the trade size will return the default quantity set in the Properties tab. It should be noted that the Initial Capital amount set in the Properties tab does not affect the simulation in the same way as a real account. In reality, running out of money will certainly halt trading. In fact, your account would be frozen long before the last penny was committed to a trade. On the other hand, TradingView will keep running the simulation until the current bar even if your funds have been technically depleted.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that the endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Webhook Integration
The TradingView alerts dialog provides a way to connect your script to an external system which could actually execute your trade. This is a fantastic feature that enables you to separate the data feed and technical analysis from the execution and reporting systems. Using this feature it is possible to create a fully automated trading system entirely on the cloud. Of course, there is some work to get it all going in a reliable fashion. Being a strategy type script place holders such as {{strategy.position_size}} can be embedded in the alert message text. There are more than 10 variables which can write internal script values into the message for delivery to the specified endpoint.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that my endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Here is an excerpt of the fields I use in my webhook signal:
"broker_id": "kraken",
"account_id": "XXX XXXX XXXX XXXX",
"symbol_id": "XMRUSD",
"action": "{{strategy.order.action}}",
"strategy": "{{strategy.order.id}}",
"lots": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"comment": "{{strategy.order.alert_message}}",
"timestamp": "{{time}}"
Though TradingView does a great job in dispatching your alert this feature does come with a few idiosyncrasies. Namely, a single transaction call in your script may cause multiple transmissions to the endpoint. If you are using placeholders each message describes part of the transaction sequence. A good example is closing a pyramid stack. Although the script makes a single strategy.close() call, the endpoint actually receives a close message for each pyramid trade. The broker, on the other hand, only requires a single close. The incongruity of this situation is exacerbated by the possibility of messages being received out of sequence. Depending on the type of order designated in the message, a close or a reversal. This could have a disastrous effect on your live account. This broker simulator has no idea what is actually going on at your real account. Its just doing the job of running the simulation and sending out the computed results. If your TradingView simulation falls out of alignment with the actual trading account lots of really bad things could happen. Like your script thinks your are currently long but the account is actually short. Reversals from this point forward will always be wrong with no one the wiser. Human intervention will be required to restore congruence. But how does anyone find out this is occurring? In closed systems engineering this is known as entropy. In practice your webhook logic should be robust enough to detect these conditions. Be generous with the placeholder usage and give the webhook code plenty of information to compare states. Both issuer and receiver. Don’t blindly commit incoming signals without verifying system integrity.
Setup
The following steps provide a very brief set of instructions that will get you started on your first configuration. After you’ve gone through the process a couple of times, you won’t need these anymore. It’s really a simple script after all. I have several example configurations that I used to create the performance charts shown. I can share them with you if you like. Of course, if you’ve modified the code then these steps are probably obsolete.
There are 47 inputs divided into seven sections. For the most part, the configuration process is designed to flow from top to bottom. Handy, tool tips are available on every field to help get you through the initial setup.
Step 1. Input the Base Currency and Order Size in the Properties tab. Set the Pyramiding value to zero.
Step 2. Select the Trading Mode you intend to test with from the drop down in Section 1. I usually select No Trade until I’ve setup all of the trend lines, profit and stop levels.
Step 3. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale). Remember that the profit is taken as a conditional exit not a fixed limit. The actual profit taken will almost always be greater than the amount specified. The stop loss, on the other hand, is indeed a hard number which is executed by the TradingView broker simulator when the threshold is breached.
Step 4. Apply the appropriate value to the Tick Scalar field in Section 1. This value is used to remove the pipette from the price. You can enable the Summary Report in Section 7 to see the TradingView minimum tick size of the current chart.
Step 5. Apply the appropriate Price Normalizer value in Section 1. This value is used to normalize the instrument price for differential calculations. Basically, we want to increase the magnitude to significant digits to make the numbers more meaningful in comparisons. Though I have used many normalization techniques, I have always found this method to provide a simple and lightweight solution for less demanding applications. Most of the time the default value will be sufficient. The Tick Scalar and Price Normalizer value work together within a single calculation so changing either will affect all delta result values.
Step 6. Turn on the trend line plots in Section 7. Then configure Section 2. Try to get the plots to show you what’s really happening not what you want to happen. The most important is the purple trend line. Select an interval and length that seem to identify where prices tend to go during non-consolidation periods. Remember that a natural exit is when the blue crosses the green line.
Step 7. Enable Show Event Regions in Section 7. Then adjust Section 6. Blue background fills are spikes and red fills are plunging prices. These measurements should be hard to come by so you should see relatively few fills on the chart if you’ve set this up as intended. Section 6 includes the Zscore oscillator the state of which combines with the signal lines to detect statistically significant price movement. The Zscore is a zero based calculation with positive and negative magnitude readings. You want to input a reasonably large number slightly below the maximum amplitude seen on the chart. Both rise and fall inputs are entered as a positive real number. You can easily use my code to create a separate indicator if you want to see it in action. The default value is sufficient for most configurations.
Step 8. Turn off Show Event Regions and enable Show Entry Regions in Section 7. Then adjust Section 3. This section contains two parts. The entry setup crossovers and EMA events. Adjust the crossovers first. That is the Fast Cross Length and Slow Cross Length. The frequency of your trades will be shown as blue and red fills. There should be a lot. Then turn off Show Event Regions and enable Display EMA Peaks. Adjust all the fields that have the word EMA. This is actually the yellow line on the chart. The blue and red fills should show much less than the crossovers but more than event fills shown in Step 7.
Step 9. Change the Trading Mode to BiDir if you selected No Trades previously. Look on the chart and see where the trades are occurring. Make adjustments to the Minimum Profit and Stop Offset in Section 1 if necessary. Wider profits and stops reduce the trade frequency.
Step 10. Go to Section 4 and 5 and make fine tuning adjustments to the long and short side.
Example Settings
To reproduce the performance shown on the chart please use the following configuration: (Bitcoin on the Kraken exchange)
1. Select XBTUSD Kraken as the chart symbol.
2. On the properties tab set the Order Size to: 0.01 Bitcoin
3. On the properties tab set the Pyramiding to: 12
4. In Section 1: Select “Crypto” for the Trading Model
5. In Section 1: Input 2000 for the Minimum Profit
6. In Section 1: Input 0 for the Stop Offset (No Stop)
7. In Section 1: Input 10 for the Tick Scalar
8. In Section 1: Input 1000 for the Price Normalizer
9. In Section 1: Input 2000 for the Pyramid Minimum Span
10. In Section 1: Check mark the Position Bale Out
11. In Section 2: Input 60 for the Signal Line Period
12. In Section 2: Input 1440 for the Trend Line Period
13. In Section 2: Input 5 for the Fast Alma Length
14. In Section 2: Input 22 for the Fast LinReg Length
15. In Section 2: Input 100 for the Slow LinReg Length
16. In Section 2: Input 90 for the Trend Line Length
17. In Section 2: Input 14 Stochastic Length
18. In Section 3: Input 9 Fast Cross Length
19. In Section 3: Input 24 Slow Cross Length
20. In Section 3: Input 8 Fast EMA Length
21. In Section 3: Input 10 Fast EMA Rise NetChg
22. In Section 3: Input 1 Fast EMA Rise ROC
23. In Section 3: Input 10 Fast EMA Fall NetChg
24. In Section 3: Input 1 Fast EMA Fall ROC
25. In Section 4: Check mark the Long Natural Exit
26. In Section 4: Check mark the Long Signal Exit
27. In Section 4: Check mark the Long Price Event Exit
28. In Section 4: Check mark the Long Stochastic Exit
29. In Section 5: Check mark the Short Natural Exit
30. In Section 5: Check mark the Short Signal Exit
31. In Section 5: Check mark the Short Price Event Exit
32. In Section 5: Check mark the Short Stochastic Exit
33. In Section 6: Input 120 Rise Event NetChg
34. In Section 6: Input 1 Rise Event ROC
35. In Section 6: Input 5 Min Above Zero ZScore
36. In Section 6: Input 120 Fall Event NetChg
37. In Section 6: Input 1 Fall Event ROC
38. In Section 6: Input 5 Min Below Zero ZScore
In this configuration we are trading in long only mode and have enabled downward pyramiding. The purple trend line is based on the day (1440) period. The length is set at 90 days so it’s going to take a while for the trend line to alter course should this symbol decide to node dive for a prolonged amount of time. Your trades will still go long under those circumstances. Since downward accumulation is enabled, your position size will grow on the way down.
The performance example is Bitcoin so we assume the trader is buying coins outright. That being the case we don’t need a stop since we will never receive a margin call. New buy signals will be generated when the price exceeds the magnitude and speed defined by the Event Net Change and Rate of Change.
Feel free to PM me with any questions related to this script. Thank you and happy trading!
CFTC RULE 4.41
These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
RSI Rising Crypto Trending StrategyThis is crypto and stock market trending strategy designed for long timeframes such as 4h+
From my tests it looks like it works better to trade crypto against crypto than trading against fiat.
Indicators used:
RSI for rising/falling of the trend
BB sidemarket
ROC sidemarket
Rules for entry
For long: RSI values are rising, and bb and roc tells us we are not in a sidemarket
For long: RSI values are falling, and bb and roc tells us we are not in a sidemarket
Rules for exit
We exit when we receive an opposite direction.
Cuation: Because this strategy uses no risk management, I recommend you takje care with it.
If you have any questions, let me know !
RSI Centered PivotsJust a simple RSI central pivot strategy I made for a friend.
Backtested on BYBIT:BTCUSD, 155m.
DISCLAIMER : Please do your own research into anything you use before using it to trade.
RSI Strategy with alerts via TradingConnector to ForexSoftware part of algotrading is simpler than you think. TradingView is a great place to do this actually. To present it, I'm publishing each of the default strategies you can find in Pinescript editor's "built-in" list with slight modification - I'm only adding 2 lines of code, which will trigger alerts, ready to be forwarded to your broker via TradingConnector and instantly executed there. Alerts added in this script: 12 and 17.
How it works:
1. TradingView alert fires.
2. TradingConnector catches it and forwards to MetaTrader4/5 you got from your broker.
3. Trade gets executed inside MetaTrader within 1 second of fired alert.
When configuring alert, make sure to select "alert() function calls only" in CreateAlert popup. One alert per ticker is required.
Adding stop-loss, take-profit, trailing-stop, break-even or executing pending orders is also possible. These topics have been covered in other example posts.
This routing works for Forex, indices, stocks, crypto - anything your broker offers via their MetaTrader4 or 5.
Disclaimer: This concept is presented for educational purposes only. Profitable results of trading this strategy are not guaranteed even if the backtest suggests so. By no means this post can be considered a trading advice. You trade at your own risk.
If you are thinking to execute this particular strategy, make sure to find the instrument, settings and timeframe which you like most. You can do this by your own research only.
Ultimate Scalper by @DaviddTechThis script turns out to be a great scalper for Crypto.
Long
* Looks for a pullback in MACD
* EMA 50 over EMA 200
Short
* Looks for a pullback in MACD
* EMA 50 below EMA 200
VWAP and RSI can be used for confluence.
WARNING:
- For purpose educate only - My mission is to debunk fake strategies with code to find THE ONE.
- Plots EMAs and other values on chart.
- This script to change bars colours.
Release Notes: Change the description tabs
MACD 5 iN 1 [Pro-Tool]introducing MACD Which has different indicators inside,
And not only that, five different strategies have also been included in this indicator.
Strategy №1:👉 MACD Crossover Signal Line
Strategy №2:👉 MACD Crossover + MACD Overbought Section (for ignore false Crossover signals)
Strategy №3:👉 MACD Crossover + Market Close should b greater tha MOVING AVERAGE
Strategy №4:👉 MACD Crossover + Market Close should b greater tha MOVING AVERAGE ZONE
Strategy №5:👉 MACD Crossover + RSI Close should b greater tha 50 Level (or whatever level you choose)
also 5 types of MOVING AVERAGE you can choose
1: Simple Moving Average ( SMA )
2: Exponential Moving Average ( EMA )
3: Weighted Moving Average ( WMA )
4: Volume Weighted Moving Average ( VWMA )
5: Relative Moving Average (RMA)
and you can customize MACD Colors + Widths + Signals and MACD lines, and also can Hide or Unhide Histogram / Cross Sign / MACD Zone Color
hope so you like it, 🥰
Investing and trading in cryptocurrencies is very risky, as anything can happen at any time.
***NOT FINANCIAL, LEGAL, OR TAX ADVICE! JUST OPINION! I AM NOT AN EXPERT! I DO NOT GUARANTEE A PARTICULAR OUTCOME I HAVE NO INSIDE KNOWLEDGE! YOU NEED TO DO YOUR OWN RESEARCH AND MAKE YOUR OWN DECISIONS! THIS IS JUST EDUCATION & ENTERTAINMENT! USE ALTCOIN DAILY AS A STARTING OFF POINT!