Mayer Multiple StrategyCreated by Trace Mayer, the Mayer Multiple is calculated dividing the current price of Bitcoin by its 200-day moving average. This simple script allows to backtest strategies based on Mayer Multiple levels, which can be easily adjusted. It can be tested on any chart and any timeframe.
Medias móviles
ddosok10 1min start(1볼추 매매법) 1분봉 볼밴 +3% 매매 체크 (유튜버 리또속10)
+거미줄 200틱마다 걸어놓기(익절+3 지정)
상단 볼밴 찍고 중앙선 터치 후
캔들 종가가 중앙선 아래에 있을때
숏 진입 후 하단 볼밴 터치할때쯤 익절(+3% 지정)
(허리에 들어가 무릎에 팔기)
하단 볼밴 찍고 중앙선 터치 후
캔들 종가가 중앙선 위에 있을때
롱 진입 후 상단 볼밴 터치할때쯤 익절(+3% 지정)
(허리에 들어가 가슴에 팔기)
* 포지션 동시 2개들어가서 하나 익절 하나 들고가기도 가능
BEAM DCA Strategy MonthlyThis strategy is based on BEAM bands for BTC. The space between the original BEAM bands is broken up into 10 bands representing levels of risk for investing fresh capital.
The strategy will buy bitcoin when the price is in the bottom 5 bands, increasing the amount investmented as the price approaches the 1400 D SMA.
The strategy will limit sell bitcoin when the price is in the top 5 bands, increasing the amount sold as the price approaches the upper BEAM band.
Best used on Daily timeframe and on a chart with history of price data, i.e. INDEX:BTCUSD or BITSTAMP:BTCUSD
To use the strategy:
Set start date
Set day of month to invest
Set the maximum amount to be invested on any given month
Toggle buy/sell orders
Observe the backtest
You can see how the strategy backtests via the information boxes in the bottom right.
There is also functionality to adjust the bands for diminishing returns. Note, this should be used with great skepticism, as the adjustments were made by simple function fitting and not rigorous statistical processes.
That about sums it up! As you can see, even with just a small amount of capital invested at regular intervals can lead to huge realised gains using this version of BEAM bands!
Combo 2/20 EMA & Adaptive Price Zone This is combo strategies for get a cumulative signal.
First strategy
This indicator plots 2/20 exponential moving average. For the Mov
Avg X 2/20 Indicator, the EMA bar will be painted when the Alert criteria is met.
Second strategy
The adaptive price zone (APZ) is a volatility-based technical indicator that helps investors
identify possible market turning points, which can be especially useful in a sideways-moving
market. It was created by technical analyst Lee Leibfarth in the article “Identify the
Turning Point: Trading With An Adaptive Price Zone,” which appeared in the September 2006 issue
of the journal Technical Analysis of Stocks and Commodities.
This indicator attempts to signal significant price movements by using a set of bands based on
short-term, double-smoothed exponential moving averages that lag only slightly behind price changes.
It can help short-term investors and day traders profit in volatile markets by signaling price
reversal points, which can indicate potentially lucrative times to buy or sell. The APZ can be
implemented as part of an automated trading system and can be applied to the charts of all tradeable assets.
WARNING:
- For purpose educate only
- This script to change bars colors.
Octopus_AlgoGram_IndicatorHello traders!
I have been developing Octopus trading indicator over the last year. This algorithm indicator is based on a set of different strategies, each with its own weight (weighted strategy). The set of strategies that I currently use are 5:
Volume
ADX
MA crossover
Macd
Chaikin Oscillator
Moreover, this indicator includes STOP losses criteria and a taking profit strategy. this indicator must be optimized for the desired asset to achieves its full potential.
Best Time-Frame :
The 10 & 23 Minutes Time frame give good results. The algo has been tested for several asset (same dataframe, different optimization values).
When to Buy & Sell :
Buy Entry & Exit : Take entry when Green Arrow or Buy Trigger on screen & Exit when Purple Arrow or exit trigger on screen
Sell Exit & Exit : Take entry when Red Arrow or Sell Trigger on screen & Exit when Purple Arrow or exit trigger on screen
Important note:
Backtest the algorithm with different data stamps to avoid overfitting results
How it works:
The algorithm is based on a combination of well-documented indicators. First, the algorithm calculated the weight_strategy, which represents a value from 0 to 5 of the number of strategies that are fulfilled (in case the weight of each strategy is the same). To open a position, the value of weight_strategy must be greater than the value of weight_signal, by default 2. Modify the indicator parameters for the desired asset and data frame. Set stop-loss and take profit criteria.
Features:
* The algorithm allows to trade with long, short or both positions.
* Backtest the algorithm over a defined interval (data stamp), e.g., from 2022
* stop loss (SL) orders based on movement of the previous candle source, e.g., close or candle volatility . Only close the position after the candle is close!
* It can moves the stop loss when this indicator takes profit (TP)
* Take profit based on market movement and once all condition true they push exit order
* Define delays to evaluate the strategies of more previous candles:
+ Candle delay Exit is the number of candles the algorithm waits to open a new position.
* Choose if you want to use the weighted strategy or just some of them.
* Choose the weight (relevance) of each strategy.
* Customize the well documented MA cross strategy.
Disclaimer :
AlgoGram Script,Indicator,Strategy,Trading Idea & presentations are only for educational & Research purposes and are not intended as investment advice. I cannot guarantee the accuracy of any information provided above , please take trade with help of your Financial adviser or on your own risk
Cheers! & Best Of Luck
By AlgoGram
Shark_AlgoGram_IndicatorHello traders!
I have been developing Shark trading indicator over the last year. This algorithm indicator is based on a set of different strategies, each with its own weight (weighted strategy). The set of strategies that I currently use are 6:
MACD
Stochastic RSI
RSI
Supertrend
MA crossover
Donchin Channel
Moreover, this indicator includes STOP losses criteria and a taking profit strategy. this indicator must be optimized for the desired asset to achieves its full potential.
Best Time-Frame :
The 30 & 31 Minutes Time frame give good results. The algo has been tested for several asset (same dataframe, different optimization values).
When to Buy & Sell :
Buy Entry & Exit : Take entry when Green Arrow or Buy Trigger on screen & Exit when Purple Arrow or exit trigger on screen
Sell Exit & Exit : Take entry when Red Arrow or Sell Trigger on screen & Exit when Purple Arrow or exit trigger on screen
Important note:
Backtest the algorithm with different data stamps to avoid overfitting results
How it works:
The algorithm is based on a combination of well-documented indicators. First, the algorithm calculated the weight_strategy, which represents a value from 0 to 5 of the number of strategies that are fulfilled (in case the weight of each strategy is the same). To open a position, the value of weight_strategy must be greater than the value of weight_signal, by default 2. Modify the indicator parameters for the desired asset and data frame. Set stop-loss and take profit criteria.
Features:
* The algorithm allows to trade with long, short or both positions.
* Backtest the algorithm over a defined interval (data stamp), e.g., from 2022
* stop loss (SL) orders based on movement of the previous candle source, e.g., close or candle volatility. Only close the position after the candle is close!
* It can moves the stop loss when this indicator takes profit (TP) & Market true such condition where trailing SL Activate
* Take profit based on market movement and once 3 condition true out of 6 True they push exit order
* Define delays to evaluate the strategies of more previous candles:
+ Candle Delay is for MACD strategy
+ Candle delay Stoch RSI is for the Stochastic RSI strategy.
+ RSI Candle Delay is for the RSI strategy.
+ Candle delay Exit is the number of candles the algorithm waits to open a new position.
* Choose if you want to use the weighted strategy or just some of them.
* Choose the weight (relevance) of each strategy.
* Customize the well-documented MACD strategy.
* Customize the well-documented Stochastic RSI strategy.
* Customize the well-documented RSI strategy.
* Customize the well-documented Supertrend strategy.
* Customize the well documented MA cross strategy.
Disclaimer :
AlgoGram Script,Indicator,Strategy,Trading Idea & presentations are only for educational & Research purposes and are not intended as investment advice. I cannot guarantee the accuracy of any information provided above , please take trade with help of your Financial adviser or on your own risk
Cheers! & Best Of Luck
By AlgoGram
Trend Follower Strategy [divonn1994]The Trend Follower Strategy that I made classifies red and green candles into tiny, small, and big sizes and will send buy or sell signals depending on if the candle is classified as "big" so you get into and out of a position when there is a big candle. Out during a big green candle to take profit. Out during a big red candle in case the market is turning down. It also won't enter a position unless there is positive EMA momentum.
For the chart there is a Buy and a Sell signal. Buy = 1, Sell = 0, and when the value crosses above or below 0.5 it will trigger a long position or close the long postion. The graph isn't necessary to the strategy, but can help with visualizing the trade patterns in the past if you like.
This strategy works best so far with BNBUSDT, ETHUSDT, KCSUSDT, HTUSDT, BNBUSDT, BNBBTC, ETHBTC, KCSBTC, LUNABTC, SOLBTC, ADABTC, SANDBTC, HNTBTC, KDABTC.
It can work with other pairings, but these have the healthiest charts in my opinion, as in, the profit factor is high and is greater than a simple buy and hold strategy, and the largest drawdown isn't very high.
Works best on 1 Day charts.
Bias Master SystemName: Bias Master System
Category: Bias (Template/Master).
Operating mode: enters and exits at specific times of the day
Trades duration: a few hours, usually intra-day.
Timeframe: 1H.
Suggested usage: in markets where hourly biases are present.
Entry: enters long and short in predefined times, with possibility to manage trend or volatility filters.
Exit: exits in predefined times.
Usage: It can be used in a variety of ways:
- Together with the Bias Analyzer to quickly check the Bias found by the tool. This allows you to create profitable strategies in less than an hour, as an example the starting point with the Analyzer
- The strategy itself can be used to study the market for interesting biases.
- The strategy can be used as a starting code for the development of one's own strategies.
A tutorial with working examples on BTC and ETH is also available and will be provided with the access.
Configuration:
- Long Trades: possibility to specify two long trades configuration and filter them by day of the week, trend or volatility.
- Short Trades: possibility to specify two short trades configuration and filter then by day of the week, trend or volatility.
- Backtest dates: for splitting the available data in develop, test and validation.
- Results table: possibility to specify decimal precision and Dark Mode
Credits:
- QuantNomad for Results Table
Backtesting:
⁃ Exchange: BINANCE
⁃ Pair: ETHUSDTPERP
⁃ Timeframe: 1H
⁃ Fee 0.025%
Template Trailing Strategy (Backtester)💭 Overview
💢 What is the "Template Trailing Strategy” ❓
The "Template Trailing Strategy" (TTS) is a back-tester orchestration framework. It supercharges the implementation-test-evaluation lifecycle of new trading strategies, by making it possible to plug in your own trading idea.
While TTS offers a vast number of configuration settings, it primarily allows the trader to:
Test and evaluate your own trading logic that is described in terms of entry, exit, and cancellation conditions.
Define the entry and exit order types as well as their target prices when the limit, stop, or stop-limit order types are used.
Utilize a variety of options regarding the placement of the stop-loss and take-profit target(s) prices and support for well-known techniques like moving to breakeven and trailing.
Provide well-known quantity calculation methods to properly handle risk management and easily evaluate trading strategies and compare them.
Alert on each trading event or any related change through a robust and fully customizable messaging system.
All the above, build a robust tool that, once learned, significant and repetitive work that strategy developers often implement individually on every strategy script is eliminated. Taking advantage of TradingView’s built-in backtesting engine the evaluation of the trading ideas feels natural.
By utilizing the TTS one can easily swap “trading logic” by testing, evaluating, and comparing each trading idea and/or individual component of a strategy.
Finally, TTS, through its per-event alert management (and debugging) system, provides a fully automated solution that supports automated trading with real brokers via webhooks.
NOTE: The “Template Trailing Strategy” does not dictate the way you can combine different (types of) indicators or how you should combine them. Thus, it should not be confused as a “Trading System”, because it gives its user full flexibility on that end (for better or worse).
💢 What is a “Signal Indicator” ❓
“Signal Indicator” (SI) is an indicator that can output a “signal” that follows a specific convention so that the “Template Trailing Strategy” can “understand” and execute the orders accordingly. The SI realizes the core trading logic signaling to the TTS when to enter, exit, or cancel an order. A SI instructs the TTS “when” to enter or exit, and the TTS determines “how” to enter and exit the position once the Signal Indicator generates a signal.
A very simple example of a Signal Indicator might be a 200-day Simple Moving Average Signal. When the price of the security closes above the 200-day SMA, a SI would provide TTS with a “long entry signal”. Once TTS receives the “long entry signal”, the TTS will open a long position and send an alert or automated trade message via webhook to a broker, based on the Entry settings defined in TTS. If the TTS Entry settings specify a “Market” order type, then the open long position will be executed by TTS immediately. But if the TTS Entry settings specify a “Stop” order type with a 1% Stop Distance, then when the price of the security rises by 1% after the “long entry signal” occurs, the TTS will open a long position and the Long Entry alert or webhook to the broker will be sent.
🤔 How to Guide
💢 How to connect a “signal” from a “Signal Indicator” ❓
The “Template Trailing Strategy” was designed to receive external signals from a “Signal Indicator”. In this way, a “new trading idea” can be developed, configured, and evaluated separately from the TTS. Similarly, the SI can be held constant, and the trading mechanics can change in the TTS settings and back-tested to answer questions such as, “Am I better with a different stop loss placement method, what if I used a limit order instead of a stop order to enter, what if I used 25% margin instead of trading spot market?”
To make that possible by connecting an external signal indicator to TTS, you should:
Add in the same chart, the “Signal Indicator” of your choice (e.g. “Two MA Signal Indicator” , “Click Signal Indicator” , “Signal Adapter” , “Signal Composer” ) and the “Template Trailing Strategy”.
Go to the “Settings/Inputs” tab in the “🛠️ STRATEGY” group of the TTS and change the "𝐃𝐞𝐚𝐥 𝐂𝐨𝐧𝐝𝐢𝐭𝐢𝐨𝐧𝐬 𝐌𝐨𝐝𝐞" to “🔨External”
Go to the “🔨 STRATEGY – EXTERNAL” group settings of the TTS and change the “🔌𝐒𝐢𝐠𝐧𝐚𝐥 🛈➡” to the output signal of the “Signal Indicator” you want to connect. The selected combo box option should look like “:🔌Signal to TTS” where should correspond to the short title of your “Signal Indicator”
💢 How to create a Custom Trading logic ❓
The “Template Trailing Strategy” provides two ways to plug in your custom trading logic. Both of them have their advantages and disadvantages.
✍️ Develop your own Customized “Signal Indicator” 💥
The first approach is meant to be used for relatively more complex trading logic. The advantages of this approach are the full control and customization you have over the trading logic and the relatively simple configuration setup by having two scripts only. The downsides are that you have to have some experience with pinescript or you are willing to learn and experiment. You should also know the exact formula for every indicator you will use since you have to write it by yourself. Copy-pasting from existing open-source indicators will get you started quite fast though.
The idea here is either to create a new indicator script from scratch or to copy an existing non-signal indicator and make it a “Signal Indicator”. To create a new script, press the “Pine Editor” button below the chart to open the “Pine Editor” and then press the “Open” button to open the drop-down menu with the templates. Select the “New Indicator” option. Add it to your chart to copy an existing indicator and press the source code {} button. Its source code will be shown in the “Pine Editor” with a warning on top stating that this is a read-only script. Press the “create a working copy”. Now you can give a descriptive title and a short title to your script, and you can work on (or copy-paste) the (other) indicators of your interest. Having all the information needed to make your decision the only thing you should do is define a DealConditions object and plot it like this:
import jason5480/tts_convention/4 as conv
// Calculate the start, end, cancel start, cancel end conditions
dealConditions = conv.DealConditions.new(
startLongDeal = ,
startShortDeal = ,
endLongDeal = ,
endShortDeal = ,
cnlStartLongDeal = ,
cnlStartShortDeal = ,
cnlEndLongDeal = ,
cnlEndShortDeal = )
// Use this signal in scripts like "Template Trailing Strategy" and "Signal Composer" that can use its value
// Emit the current signal value according to the "two channels mod div" convention
plot(series = conv.getSignal(dealConditions), title = '🔌Signal to TTS', color = color.olive, display = display.data_window + display.status_line, precision = 0)
You should write your deal conditions appropriately based on your trading logic and put them in the code section shown above by replacing the “…” part after “=”. You can omit the conditions that are not relevant to your logic. For example, if you use only market orders for entering and exiting your positions the cnlStartLongDeal, cnlStartShortDeal, cnlEndLongDeal, and cnlEndShortDeal are irrelevant to your case and can be safely omitted from the DealConditions object. After successfully compiling your new custom SI script add it to the same chart with the TTS by pressing the “Add to chart” button. If all goes well, you will be able to connect your “signal” to the TTS as described in the “How to connect a “signal” from a “Signal Indicator”?” guide.
🧩 Adapt and Combine existing non-signal indicators 💥
The second approach is meant to be used for relatively simple trading logic. The advantages of this approach are the lack of pine script and coding experience needed and the fact that it can be used with closed-source indicators as long as the decision-making part is displayed as a line in the chart. The drawback is that you have to have a subscription that supports the “indicator on indicator” feature so you can connect the output of one indicator as an input to another indicator. Please check if your plan supports that feature here
To plug in your own logic that way you have to add your indicator(s) of preference in the chart and then add the “Signal Adapter” script in the same chart as well. This script is a “Signal Indicator” that can be used as a proxy to define your custom logic in the CONDITIONS group of the “Settings/Inputs” tab after defining your inputs from your preferred indicators in the VARIABLES group. Then a “signal” will be produced, if your logic is simple enough it can be directly connected to the TTS that is also added to the same chart for execution. Check the “How to connect a “signal” from a “Signal Indicator”?” in the “🤔 How to Guide“ for more information.
If your logic is slightly more complicated, you can add a second “Signal Adapter” in your chart. Then you should add the “Signal Composer” in the same chart, go to the SIGNALS group of the “Settings/Inputs” tab, and connect the “signals” from the “Signal Adapters”. “Signal Composer” is also a SI so its composed “signal” can be connected to the TTS the same way it is described in the “How to connect a “signal” from a “Signal Indicator”?” guide.
At this point, due to the composability of the framework, you can add an arbitrary number (bounded by your subscription of course) of “Signal Adapters” and “Signal Composers” before connecting the final “signal” to the TTS.
💢 How to set up ⏰Alerts ❓
The “Template Trailing Strategy” provides a fully customizable per-even alert mechanism. This means that you may have an entirely different message for entering and exiting into a position, hitting a stop-loss or a take-profit target, changing trailing targets, etc. There are no restrictions, and this gives you great flexibility.
First of all, you have to enable the alerts of the events that interest you. Go to the “🔔 ALERT MESSAGES” module of the TTS settings and check the “Enable…” checkbox of the events you are interested in. For each specific event, you will find a text area where you can type the exact message you want to receive when the event occurs. What’s more, there are placeholders you can use that will be replaced by the TTS with the actual values before the message is sent. The placeholder categories are the following and the placeholder names are self-explanatory.
Chart info: {{ticker}}, {{base_currency}}, {{quote_currency}}
Quantities and percentages: {{base_quantity}}, {{quote_quantity}}, {{quote_quantity_perc}},
{{take_profit_base_quantity}}, {{remaining_quantity_perc}}, {{remaining_base_quantity}}, {{risk_perc}}
Target prices: {{stop_loss_price}}, {{entry_price}}, {{entry+_price}}, {{entry-_price}},
{{exit_price}}, {{exit+_price}}, {{exit-_price}}, {{take_profit_price_1}},
{{take_profit_price_2}}, {{take_profit_price_3}}, {{take_profit_price_4}}, {{take_profit_price_5}}
❗ To get the message on the other side you have to set a strategy alert as described here and use the {{strategy.order.alert_message}} placeholder as text in the “Message Box” that contains the message that came from the TTS.
💢 How to execute my orders in a broker ❓
To execute your orders in a broker that supports webhook integration, you should enable the appropriate alerts in the “Template Trailing Strategy” first (see the “How to set up Alerts?” guide above). Then you should go to the “Create Alert/Notifications” tab check the “Webhook URL” and paste the URL provided by your broker. You have to read the documentation of your broker for more information on what messages are expected.
Keep in mind that some brokers have deep integration with TradingView so a per-event alert approach might be overkill.
📑 Definitions
This section tries to give some definitions in terms that appear in the “Settings/Inputs" tab of the “Template Trailing Strategy”
💢 What is Trailing ❓
Trailing is a technique where a price target follows another “barrier” price (usually high or low) by trying to keep a maximum distance from the “barrier” when it moves in only one direction (up or down). When the “barrier” moves in the other direction the price target will not change. There are as many types of trailing as price targets, which means that there are entry trailing, exit trailing, stop-loss trailing, and take-profit trailing techniques.
💢 What is a Moonbag ❓
A Moonbag in a trade is the quantity of the position that is reserved and will not be exited even if all take-profit targets defined in the strategy are hit, the quantity will be exited only if the stop-loss is hit or a close signal is received. This makes the stop-loss trailing technique in a trend-following strategy a good candidate to take advantage of a Moonbag.
💢 What is Distance ❓
Distance is the difference between two prices.
💢 What is Bias ❓
Bias is a psychological phenomenon where you make decisions based on market sentiment. For example, when you want to enter a long position you have a long bias, and when you want to exit from the long position you have a short bias. It is the other way around for the short position.
💢 What is the Margin Distance of a price target ❓
The Margin Distance of a price target is the distance that the target will deviate from its initial price. The direction of this deviation depends on the bias of the market. For example, suppose you are in a long position, and you set a take-profit target to the local high (HHLL). In that case, adding a margin of five ticks will place your take-profit target 5 ticks below this local high because you have a short bias when exiting a long position. When the bias is long the margin will be added resulting in a higher target price and when you have a short bias the margin will be subtracted.
⚙️ Settings
In the “Settings/Inputs” tab of the “Template Trailing Strategy”, you can find all the customizable settings that are provided by the framework. The variety of those settings is vast; hence we will only scratch the surface here. However, for every setting, there is an information icon 🛈 where you can learn more if you mouse over it. The “Settings/Inputs” tab is divided into ten main groups. Each one of them is responsible for one module of the framework. Every setting is part of a group that is named after the module it represents. So, to spot the module of a setting find the title that appears above it comes with an emoji and uppercase letters. Some settings might have the same name but belong to different modules e.g. “Distance Method”. Some settings are indented, which means that are closely related to the non-indented setting above. Usually, intended settings provide further configuration for one or more options of the non-intended setting. The groups that correspond to each module of the framework are the following:
📆 FILTERS
In this module time filters are implemented. You can define a DateTime window for your strategy to run. You can also specify a session by selecting the days of the week and the time range you want to operate.
🛠️ STRATEGY
This module contains the "𝐃𝐞𝐚𝐥 𝐂𝐨𝐧𝐝𝐢𝐭𝐢𝐨𝐧𝐬 𝐌𝐨𝐝𝐞" that defines if the “Template Trailing Strategy” will operate using the Internal or the External (“Signal Indicator”) conditions. Some general settings can be applied regardless of the mode.
🔨 STRATEGY – EXTERNAL
This sub-module makes the connection between the external signal of the “Signal Indicator” and the “Template Trailing Strategy”. It takes effect only if the "𝐃𝐞𝐚𝐥 𝐂𝐨𝐧𝐝𝐢𝐭𝐢𝐨𝐧𝐬 𝐌𝐨𝐝𝐞" is set to “🔨External”.
🔧 STRATEGY – INTERNAL
This sub-module defines the internal strategy logic and it's used as an example to demonstrate this framework. It should produce the same results as if the “Two MA Signal Indicator” was used as a “signal” in external mode. It takes effect only if the "𝐃𝐞𝐚𝐥 𝐂𝐨𝐧𝐝𝐢𝐭𝐢𝐨𝐧𝐬 𝐌𝐨𝐝𝐞" is set to “🔧Internal”.
🎢 VOLATILITY
This module defines the volatility parameters that are used in various other settings like average true range and standard deviation. It also makes it clear whether their values are updated during a trade (DYNAMIC) or not (STATIC).
🔷 ENTRY
This module defines how the start deal conditions will be executed by defining the order type of your entry and all necessary parameters to execute them.
🎯 TAKE PROFIT
This module defines the take-profit targets placement logic. The number of the take-profit targets to use, their distance from the entry price, and the distance from each other are only some of the features that can be configured.
🛑 STOP LOSS
This module defines the stop-loss target placement logic. The distance from the entry price, move to break even, and start trailing after a take-profit target is hit are only some of the features that can be configured.
🟪 EXIT
This module defines how the end deal conditions will be executed by defining the order type of your exit and all necessary parameters to execute them.
💰 QUANTITY/RISK MANAGEMENT
This module defines the method that calculates the amount of money you will put into each trade. Also, the percentage of the Moonbag quantity can be configured.
📊 ANALYTICS
This module can visualize some extra analytics of the strategy in the chart and calculate some metrics to measure the overall performance.
🔔 ALERT MESSAGES
This module defines all the messages that can be emitted per event during the strategy execution.
😲 Caveats
💢 Does “Template Trailing Strategy” has a repainting behavior ❓
The answer is that the “Template Trailing Strategy” does not repaint as long as the “Signal Indicator” that is connected also does not repaint. If you developed your own SI make sure that you understand and know how to prevent this behavior. The publication by @PineCoders here will give you a good idea on how to avoid most of the repainting cases.
⚠️There is an exception though, when the “Enable Trail⚠️💹” checkbox is checked, the Take Profit trailing feature is enabled, and a tick-based approach is used, meaning that after a while, when the TradingView discards all the real-time data, assumptions will be made by the backtesting engine that will cause a form of repainting. To avoid making false assumptions please disable this feature in the early stages and evaluate its usefulness in your strategy later on, after first confirming the success of the logic without this feature. In this case, consider turning on the bar magnifier feature. This way you will get more accurate backtest results when the Take Profit trailing feature is enabled.
💢 Can “Template Trailing Strategy” satisfy all my trading strategies ❓
While this framework can satisfy quite a large number of trading strategies there are cases where it cannot do so. For example, if you have a custom logic for your stop-loss or take-profit placement, or if you want to dollar cost average, then it might be better to start a new strategy script from scratch.
⚠️ It is not recommended to copy the official TTS code and start developing unless you are a pine wizard! Even in that case, there is a stiff learning curve that might not be worth your time. Last, you must consider that I do not offer support for customized versions of the TTS script and if something goes wrong in the process you are all alone.
🤗 Thanks
Special thanks to @upslidedown and @metadimensional, who regularly gave feedback all those years and helped me to shape the framework as it is today! Thanks to @EltAlt, @PlusUltraTrading, and everyone else who contributed by either filing a “defect report” or asking questions that helped me to understand what improvements were necessary.
Enjoy!
Jason
Trailing SellThis script demonstrates how to do trailing sell. With this approach, given an exit signal, instead of selling directly, you just follow the price upwards (for long positions) and you sell when the price decreases by a small percentage. The order will be executed when the next bar is closed. This approach may increase the profits (slightly) in some strategies! This script can be used as a template for your own strategy. Be aware that the simulated data may produce unrealistic results.
Long Term Heat/Volatility - Accumulation/Distribution v1This is a strategy specifically made for 1D BTC/USD with the aim of capturing cycle tops and bottoms. It's mainly based on two indicators: 21d average of ATR (volatility) and (BTC.price - 180d sma)/BTC.price (heat). The strategy only signals buys or sells after occurrences of high volatility, followed by extremely high or low heat values. It's optimized for utilizing accumulation and distribution at lower and higher prices respectively with respect to last 14 days. 2nd version will include dynamic dollar cost averaging during the accumulation and distribution periods.
Heikin Ashi EMA v5 no repaint This script was inspired by the "Heikin/Kaufman Strategy" from marco valente built on v2.
The script was rebuilt on the v5 and most importantly removed the repaint function that was driving surrealistic backtesting inflated numbers.
This script is now fully functional and not repainting - At the time of testing worked efficiently 90% WR and 2x profit factor on CFD WTI OIL with a 15m time frame indexed on forex.com price.
You should utilize this script with caution, especially on high volatility cycles you can try plotting against a volatility relative index or stop.
I also strongly recommend understanding the fundamentals of WTI OIL to balance the indications of the strategy with fundamentals.
Thanks to Clovis Warlop and Nilesh Sharma for their contribution.
Cheers,
Gustavo Bramao
STR:EMA Oscilator [Azzrael]Strategy based on EMA and EMA Oscilator
(EMA - close) + Std Dev + Factor = detecting oversell/overbuy
Long only!
Pyramiding - sometimes, depends on ...
There're 2 enter strategies in one script:
1 - Classic, buy on entering to OverSell zone (more profitable ~> 70%)
2 - Crazy, buy on entering to OverBuy zone (catching trend and pyramiding, more net profit)
Exit - crossing zero of (EMA - close)
sma RSI & sudden buy and sell Strategy v1This strategy uses mostly three things:-
1. average RSI (sma rsi over a period)
2. sudden buy and sudden sell (usually to infer the change in trend or direction)
3. various EMAs ( used as a filter)
I mostly build it to work on a 3min crypto chart but it should work on any timeframe or any symbol.
Settings - Length -RSI length (hardly needed to be changed but sometimes it doubles the net profit)(+/-2)
instant length - a sudden increase or decrease in the price calculated by the length of RSI (+/-10)
Bars - No of candles to verify before starting /closing the strategy (+/-20)
Lookbackno2 - another variable to verify ema opening/closing (hardly needed to change)
emas - values of different EMAs (you can change if you want but I don't recommend it though)
over40 and over60 - the value of overbuying and overselling(+/-10)
In future, I will probably add ADX or use machine learning to filter out results
It works well considering 0.05% commission per entry and exit (total of 1% per trade)
you can message me for any query or suggestions.
Jerry J5 Dashboard & Buy Sell Strategy
----- Strategy
The strategy allows you to select from multiple moving averages and uses the concave function and the price being above or below a user defined EMA to provide buy and sell signals. You can select long trades, short trades, or both.
Concavity describes the direction of the curve and how it bends. And, just like a direction the concavity of curves can change and we call these changing points (technically they are inflection points). These changing points are used in conjunction with the stock price relationship to user defined EMAs and provide buy and sell signals when the trend is changing.
Moving Averages available in this strategy are the Exponential Moving Average (EMA), Simple Moving Average (SMA), Weighted Moving Average (WMA), Hull Moving Average (HMA), and Arnaud Legoux Moving Average (ALMA). Best results are typically with HMA and ALMA.
The indicator can be used for every type of market: indices, stocks, cryptocurrencies, currencies and others.
----- 27 Data Point Dashboard
Short Term Trend
Total Trades
Profit Factor
Win Rate %
Net Profit $, % & ROI
Buy & Hold Profit
Max Win $ & %
Max Loss $ & %
Avg Trade $, ROI%, & Bars
Avg Win $, ROI%, & Bars
Avg Loss $, ROI%, & Bars
Max Drawdown $ & %
Open Trade P&L $ & ROI%
For the dashboard you are able to set the target profit factor, win rate, net profit target ROI, winning trade target ROI, Strategy Start Date, and the Buy and Hold Start Date. The inputs are used to color dashboard labels making it easier to identify winning and losing trades based on your criteria.
Option Traders will likely appreciate the ROI% and number of bars being readily available. For example if the Average Winning Trade has a 5% ROI over 5 bars this can help you decide when to enter a trade and how long to stay in the trade.
Some of the label data is available in the TradingView Strategy Tester. However, I wanted a custom dashboard that was always visible on my chart and the J5 dashboard displays a total of 27 data points plus buy and sell signals .
Note: We calculate the ROI for Net Profit, Avg Trade, Avg Win, Avg Loss, and Open Trade based on the capital used for those trade(s). TradingView uses a different method and calculates the return percentage based on initial capital.
Indicators are not a magic pill and should be used to support trading decisions, not to make them for you. Past performance is not a guarantee of future returns. The results of individual stocks with any strategy do not constitute proof they will repeat in the future.
I hope you enjoy the J5.
DISCLAIMER: The information contained in our scripts/indicators/ideas does not constitute financial advice or a solicitation to buy or sell any securities of any type. Trading and investing in the stock market and cryptocurrencies involves substantial risk of loss and is not suitable for every investor. I’m NOT a financial adviser. All trading strategies are used at your own risk.
Please Use the link below for more information.
Mix1 : Ema Cross + Trend Channel [Gu5] - BacktestBacktest of the indicator "Mix1: Ema Cross + Trend Channel "
Trend indicator, by the crossing of moving averages
SMA200 with a channel as a filter confirms the trend.
The crossing of two moving averages, give alert only in trend.
Stochastic & MAThis trading system comes from the experience of having a "fast" signal for entry at low prices (such as the stoscastic) and then "following" the stock with a "slower" indicator such as the exponential moving average. Both the input and output signals are filtered.
The use of the trading system only carries out long operations and has been tested on shares and ETFs, including indices, on daily bases (End Of Day).
ENTRY CONDITION: when stochastic's k is higher than d (on the default value of 21 periods) we enter the lower part of the oversold, to which we apply a filter or the confirmation that the closing of the day of the crossing is higher than that of the n -th previous bar (the 2nd previous bar recommended).
Other default settings are k = 6 and d = 4; the oversold level is also customizable (recommended = 25).
EXIT CONDITIONS: once the entry has "gone well", we follow the upward trend of the stock not with a stochastic oscillator - which tends to exit too soon, especially in case of strong trends - but with a simple moving average exponential (by default at 38 periods). Also in this case a filter is added, that is, k must be> to a filter threshold (recommended = 65) which is used to distinguish the decline between a "physiological" tracking. "(k drops" slowly "together with the approach of prices to the moving average) from a more" violent "tracking (prices are below the moving average and k consequently fall" suddenly ", in a few bars).
MONEY MANAGEMENT: 13% stop loss inserted (the physiological level of tracking of the shares is generally max 8-12% so we also consider a 1% margin due to trading). For more volatile stocks, the level can be extended to 20%.
LEVERAGE: the default value is equal to 1, but it is advisable, for simulations on shares, to use higher levers (x2, x3, ...) if you trade the relative CFD or on the index in case of buying and selling of Leveraged ETFs (e.g. LEVMIB which is 2x leveraged ETFs on Italian index).
R3 ETF StrategyThis strategy is a modification of the “R3 Strategy” from the book "High Probability ETF Trading" by Larry Connors and Cesar Alvarez. This RSI strategy is for a 1-day time-frame and has these 3 simple rules:
Criteria:
The price must be above the 200 day moving average.
The 2-period (day) RSI drops 3 days in a row.
The 2-period RSI must have been below 60 3 days ago and below 10 today.
Entry and Exit:
If the 3 rules above are true, then buy on the close of the current day.
Exit on the day's close when the RSI crosses above 70.
How it works :
The Strategy will buy when the buy conditions above are true. The strategy will sell when the RSI crosses above 70. The RSI period/length, and RSI entry/exit criteria thresholds have all been coded to be adjustable with inputs.
Plots :
Blue line = 200 Day EMA (Used as Entry Criteria)
Disclaimer: Open-source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. If you would like to implement a version of any script, I would recommend making significant additions/modifications to the strategy & risk management functions. If you don’t know how to program in Pine, then hire a Pine-coder. We can help!
Titan EMA Averaging Strategy - (DYOR) By MrCryptoTitan EMA Averaging Strategy (VIP Only) Enable Longs or Shorts only Works With Crypto + Forex with correct back tested settings This is not set and forget. This requires you to back test and have relevant Risk Management in place.
The Strategy: The script uses 3EMA with engulfing candle to enter a trade in either short or long direction.
You will need to test the settings and adjust them so there isn't too many - re-entries and make sure you take profit big enough to not trigger on same candle.
When setting alerts you can use once per bar however this may trigger multiple alerts if the candle is moving very fast so this is not recommended. So doing once per bar close will mean entry is confirmed as bar is closed. You will need to select this in drop down menu.
- Max Trade Limit.
- All in one Alert. - Basically add syntax for example- Long/Take Profit/Re-entry/Emergency Stop. Then add one alert and select "Alert() function calls Only" Change Alert name to custom. That's it.
-Built-in Strategy tester.
- Trade Filter - Multi-MA Filters. - MA", "EMA", "WMA", "HullMA", "VWMA", "RMA", "DEMA", "TEMA", VWAP
- ADX Filter based on Level.
Please note when running this strategy you can only trade longs only or shorts only for this setup to be potentially profitable. Also note that setting unrealistic profit targets will make a loss. So it is very important to back test everything.
This Script does not use any Security functions. All indicators which are used part of the strategy are obtained from Trading View indicator Library and have source code has been changed to make this into Strategy.
Please Do Your Own Research before using this.
Anymore information please DM me directly
3 Candle Strike StretegyMainly developed for AMEX:SPY trading on 1 min chart. But feel free to try on other tickers.
Basic idea of this strategy is to look for 3 candle reversal pattern within trending market structure. The 3 candle reversal pattern consist of 3 consecutive bullish or bearish candles,
followed by an engulfing candle in the opposite direction. This pattern usually signals a reversal of short term trend. This strategy also uses multiple moving averages to filter long or short
entries. ie. if the 21 smoothed moving average is above the 50, only look for long (bullish) entries, and vise versa. There is option change these moving average periods to suit your needs.
I also choose to use Linear Regression to determine whether the market is ranging or trending. It seems the 3 candle pattern is more successful under trending market. Hence I use it as a filter.
There is also an option to combine this strategy with moving average crossovers. The idea is to look for 3 candle pattern right after a fast moving average crosses over a slow moving average.
By default , 21 and 50 smoothed moving averages are used. This gives additional entry opportunities and also provides better results.
This strategy aims for 1:3 risk to reward ratio. Stop losses are calculated using the closest low or high values for long or short entries, respectively, with an offset using a percentage of
the daily ATR value. This allows some price fluctuation without being stopped out prematurely. Price target is calculated by multiplying the difference between the entry price and the stop loss
by a factor of 3. When price target is reach, this strategy will set stop loss at the price target and wait for exit condition to maximize potential profit.
This strategy will exit an order if an opposing 3 candle pattern is detected, this could happen before stop loss or price target is reached, and may also happen after price target is reached.
*Note that this strategy is designed for same day SPY option scalping. I haven't determined an easy way to calculate the # of contracts to represent the equivalent option values. Plus the option
prices varies greatly depending on which strike and expiry that may suits your trading style. Therefore, please be mindful of the net profit shown. By default, each entry is approximately equal
to buying 10 of same day or 1 day expiry call or puts at strike $1 - $2 OTM. This strategy will close all open trades at 3:45pm EST on Mon, Wed, and Fri.
**Note that this strategy also takes into account of extended market data.
***Note pyramiding is set to 2 by default, so it allows for multiple entries on the way towards price target.
Remember that market conditions are always changing. This strategy was only able to be back-tested using 1 month of data. This strategy may not work the next month. Please keep that in mind.
Also, I take no credit for any of the indicators used as part of this strategy.
Enjoy~
Trailing BuyThis script demonstrates how to do trailing buy. With this approach, given an entry signal, instead of buying directly, you just follow the price downwards (for long positions) and you buy when the price increases by a small percentage. The order will be executed when the next bar is closed. This approach may increase the profits (slightly) in some strategies! This script can be used as a template for your own strategy. Be aware that the simulated data may produce unrealistic results.
Acrypto - Weighted StrategyHello traders!
I have been developing a fully customizable algo over the last year. The algorithm is based on a set of different strategies, each with its own weight (weighted strategy). The set of strategies that I currently use are 5:
MACD
Stochastic RSI
RSI
Supertrend
MA crossover
Moreover, the algo includes STOP losses criteria and a taking profit strategy. The algo must be optimized for the desired asset to achieves its full potential. The 1H and 4H dataframe give good results. The algo has been tested for several asset (same dataframe, different optimization values).
Important note:
Backtest the algorithm with different data stamps to avoid overfitting results
Best,
Alberto
Kitti-Playbook HHV LLV Simulation R0 Feb 4 2022
Objective : Visualization the result of price movement cross Higher High - Lower Low to generate Long Short Signal
Study The change of Equity curve when Changes
1) Look back for Higher High - Lower Low
2) Number of Position size
3) Type of Suorce
4) Effected when use EMA 12-26 filter
5) Effected form equity adjustment
6) Effected form margin adjustment
Conditions :
Long Conditions
If EMA 12-26 filter off
1)Source cross over Higher High value of price look back ' x ' bars
2) Addition 1 position when Source cross over Higher High value of price look back ' x ' bars again
3) Maximum Number of Long position not more than set up from input
If EMA 12-26 filter on
1)Source cross over Higher High value of price look back ' x ' bars and EMA 12 > EMA26
2) Addition 1 position when Source cross over Higher High value of price look back ' x ' bars again and EMA 12 > EMA 26
3) Maximum Number of Long position not more than set up from input
Exit long Condition
Exit all positions when Source cross under Lower Low value of price look back ' x ' bars
Short Conditions
If EMA 12-26 filter off
1)Source cross under Lower Low value of price look back ' x ' bars
2) Addition 1 position when Source cross under Lower Lower value of price look back ' x ' bars again
3) Maximum Number of Long position not more than set up from input
If EMA 12-26 filter on
1)Source cross under Lower Lower value of price look back ' x ' bars and EMA 12 < EMA26
2) Addition 1 position when Source cross under lower Low value of price look back ' x ' bars again and EMA 12 < EMA 26
3) Maximum Number of Short position not more than set up from input
Exit Short Condition
Exit all positions when Source cross Over Higher High value of price look back ' x ' bars
Program flow :
1) Initial Strategy Setting
2) Initial Input Setting
3) Data Processing
4) STRATEGY Entry And Exit
5) Information of System selection
6) Dashboard for result