ค้นหาในสคริปต์สำหรับ "bot"
Trend Friend - Swing Trade & Scalp Signals - Stocks Crypto ForexTREND FRIEND is a custom built, data driven algorithm that gives buy and sell signals when many different factors line up together on a single candle. It is designed to catch every move so you can expect early entries and exits across all of your favorite markets. Use scalp mode for early entries with lots of signals or swing mode for longer swings with fewer signals and long swing mode for really long swing trades with even less signals.
The best markets to use this indicator on are high volume tickers with a lot of price action as these markets have enough data to use to give the signals the algo needs to be able to detect highly probable moves in price. That being said, it works across all markets such as stocks, crypto, forex and futures and across all timeframes(on really long timeframes it may not give signals due to not having enough data to work with).
***MAJOR POINTS TO REMEMBER BEFORE USING THIS INDICATOR***
The algo is designed to catch major moves, so if a signal seems to come in late, it is highly likely the market is about to reverse so use caution when taking signals that seem late. This typically happens because the market is indecisive so always be careful in these situations and just wait for a better signal when markets are really decisive.
Always trade in the direction of the trend meaning the volume weighted moving average clouds. There is also a trend detection label and risk level label that you should follow to keep your trades as safe as possible. The safest way to do this is only trade short when the VWMA 100 is below the VWMA 500 and a Bear signal comes in very close to a VWMA line. Only trade long when the VWMA 100 is above the VWMA 500 and a Bull signal comes in very close to a VWMA line.
If price is between the moving averages, play the VWMA 100 and VWMA 500 as support and resistance and only take signals near one of the VWMAs with the plan of price returning to the other VWMA. If you are taking trades against the trend, like trying to buy the dips or sell the tops, wait for price to cross the VWMA 100 before following a signal.
If the VWMA 100 and VWMA 500 are close to each other and/or moving sideways, you can expect choppy price action and consolidation so use caution when taking trades during this time. It is better to wait for the price to hold above or below both VWMAs and stay supportive there before taking trades. Waiting for volume to increase is also a good way to avoid chop after the trend decides a direction.
This indicator will repaint sometimes before the candle has closed, so either wait for the candle to close with a signal before entering trades or only take signals before it closes on candles with good volume and technical analysis backing it.
***ALL THE FEATURES YOU NEED***
Trend Friend has multiple features designed to help you trade better and make decisions faster.
Buy & Sell Signals - When the algo detects all of our required parameters lining up on a single candle, Trend Friend will give Bull or Bear signals on the chart. Bull means upward price action is expected. Bear means downward price action is expected.
Take Profit Signals - When the price action makes a move that typically signals a reversal, a take profit signal will show up on the chart to help you get out of a trade before the next signal comes in.
Risk Levels For Signals
There is a risk detection system that tells you how risky each signal is as it comes in to help you stay out of dangerous trades. Wait for signals with low risk and you’ll be much safer than trying to take trades against the trend.
Alerts - There are options for alerts on buy signals, sell signals, take profit signals, price crossing the VWMA 100 and price crossing the VWMA 500. All of these can be controlled using tradingview alerts so you don't have to watch the charts and wait for things to happen. These alerts can also be used to send orders to trading bots if you choose.
Candles Painted Green Or Red According To Buy & Sell Pressure - By default, this indicator paints the candle sticks green, red or blue according to buy & sell pressure(DMI). You will need to turn off candle colors in your chart settings for this to appear correctly.
Percentage Updates - The table on the right has live percentage updates so you don’t have to measure out every move you are expecting. It will tell you the percentage from closest fibonacci levels, percentage away from the VWAP, percent gain or loss from the last signal entry and percentages from your own trades that can be configured in the settings. These help you always know how much more you can squeeze out of a trade and where your position stands without having to switch screens between Tradingview and your broker constantly.
Moving Average & VWAP Clouds - We included two color coded volume weighted moving averages(VWMA 100 and VWMA 500) and a color coded RMA 10 moving average. We also have a VWAP dotted line and cloud so you can easily see the trend direction on the chart at all times. The cloud and moving averages will turn green or red in real time depending on whether price is above or below each moving average or the VWAP respectively.
Trend Detection Label - The top label on the percentage update table tells you if the trend for this timeframe is Bullish or Bearish as well as when the trend is undecisive with choppy price action expected.
Chop & Low Volume Warning Labels - When price action is choppy or there is very low volume compared to historic candles, a warning label will appear at the top of the screen so you know to use caution and stay out of trades during these times.
Auto Fibonacci Levels - The chart will automatically populate fibonacci retracement and extension levels. The percentage update table will also give you real time updates on how far away the next fibonacci levels are from the current price.
Bounce Zone - We also included a very long term moving average cloud(EMA 1000 and EMA 2000) that shows as purple on the chart. When price enters that cloud, you can expect a reversal in that area. If price was trending above the cloud, expect that cloud to act as support. If price was trending below the cloud, expect that cloud to act as resistance. When price is trying to break through that cloud in either direction you can expect price action to be choppy and big moves to happen once price gets supportive in that zone and breaks out.
Margin Multiplier - If you are using margin to trade, our margin multiplier will multiply all of the percentage updates by the margin level you input in the settings tab so your percentages will reflect the percentages in your account.
***HOW TO USE***
Scalp, Swing And Long Swing Mode
You can choose from scalp mode, swing mode or long swing mode in the indicator settings. It is set to scalp mode by default. Scalpers will want to use the scalp mode as it provides early entries and exits and is designed to catch every move quickly. Swing mode is designed to catch almost every move and filter out some of the noise so it will have less signals than scalp mode. Long swing mode is designed to catch those lengthy moves and will hold positions the longest but give entries later than the other modes.
Try all three on a few charts and timeframes to see which setting matches your trading style the best. If you want more signals with any of the 3 modes, go to a lower timeframe. If you want less signals on any mode, go to a higher timeframe.
Bull & Bear Signals - When all of our algo parameters line up, a BULL or BEAR label will print on the chart. Bull labels will be colored green and bear labels will be colored red. Bull indicates a good place to enter a long trade because the algo is detecting patterns that indicate price should move upwards. Bear indicates a good place to enter a short trade because the algo is detecting patterns that indicate price should move downwards.
For best results using these signals, take trade signals that line up very closely with fibonacci levels or volume weighted moving averages or the vwap or any combination of them. It is also recommended to only take trades in the direction of the trend to avoid trading false reversals. Wait for low risk signals using our risk identifier and then enter the market. Waiting for good volume to come in will also help you avoid chop and catch those quick moves.
Also, make sure to check the percentage updates table to see if the expected move to the next fibonacci level is far enough away to make the risk to reward ratio worth taking the trade. Watch for signals when the VWMAs squeeze together after a wide gap and price breaks out with a corresponding signal as these can bring large, quick moves in price. Use caution when the VWMAs are close to each other and trending sideways as this usually brings choppy price action.
(The bull and bear signals can be turned on or off in the indicator settings input tab. Useful if you want to clean up the chart or only show bear or bull signals according to the trend.)
Take profit Signals - Take profit labels will show up on the chart when a reversal candle pattern or reversal indicator pattern is detected while a trade is still open. Use these signals as times that it may be a good point to exit the trade to avoid losses or reduced profits.
(The take profit signals can be turned on or off in the indicator settings input tab.)
Risk Level Label
Taking trades against the trend is dangerous because there are more false bottoms than there are actual bottoms. Our risk detection label is there to keep you from taking dangerous trades against the trend. The label will say Low Risk when the trend is in the same direction as the last signal given. The label will say Medium Risk when the trend is neutral because price likes to chop around during these times. The label will say High Risk when the trend is in the opposite direction as the last signal given.
Make sure you wait for the risk level detector to show Low Risk before taking trades or you may be buying a false bottom.
Candles Colored According To Buy & Sell Pressure - By default this indicator will paint the candlesticks green, red or blue depending on the buy & sell pressure for those candles using the Directional Movement Index or DMI. If buy pressure is higher than sell pressure, it will paint green. If Sell pressure is higher than buy pressure, it will paint red. If buy pressure is equal to sell pressure, it will paint blue. Use this to confirm which direction buying and selling is favoring and use a change in color trend to determine reversal points early. For this to work correctly you will need to go into chart settings(gear icon top right) and in the symbol tab turn off body, wicks and border.
(The buy & sell pressure candle coloring can be turned on or off in the indicator settings input tab.)
Auto Fibonacci - This indicator will automatically populate fibonacci retracement and extension levels for you. These levels are calculated using the previous high and low. You can switch the source between the previous day, week, month, quarter and year(the weekly setting is the default as it is great for day trading). The previous high and low levels will show as white(These are very important levels so watch for price to bounce off of the white lines). The percentage update table will also show the percentage gap from the current price and the next closest fibonacci level above and below, with labels telling you which fib levels they are.
(The fibonacci levels can be turned on or off in the indicator settings input tab.)
Volume Weighted Moving Averages With Clouds - The red or green moving averages should be treated as dynamic support and resistance as well as a visual way of telling current price trends. You can expect price to bounce off of these moving averages very often and quick moves usually happen when price breaks out of these moving averages.
The safest long trades you can take will be when the VWMA 100 is above the VWMA 500 and you get a BULL signal that is very close to the VWMA 100 or VWMA 500. The safest short trades you can take will be when the VWMA 100 is below the VWMA 500 and you get a BEAR signal that is very close to the VWMA 100 or VWMA 500.
When the moving averages squeeze together and price bounces between them, you can expect big moves in price when it breaks out. If price has been trending up and the moving averages squeeze together, expect the price to fall quickly once it breaks down from there. If price has been trending down and the moving averages squeeze together, expect the price to jump quickly once it breaks out from there.
These moving averages and the clouds associated with them will paint green when price is above them, indicating a bullish trend and they will change to red when price is below the moving averages, indicating a bearish trend.
You can also use the moving averages as support and resistance levels when markets are moving sideways. Since these are volume weighted moving averages, price tends to stick to them very well and paints a much clearer picture of what is going to happen than regular moving averages that don't take volume into account. Try it on a bunch of different timeframes and charts to see for yourself.
(The moving averages and clouds can be turned on or off in the indicator settings input tab.)
Bounce Zone - The bounce zone is a purple cloud that is made up of two very long term moving averages. When price is trending above this cloud and comes back down to it, you can expect the price to bounce back upwards in this zone. If the price is trending below this cloud and comes up to it, you can expect the price to bounce back downwards when it reaches this zone.
Sometimes price will break through this cloud and you will usually notice a lot of choppy price action and accumulation in this zone. When price does break out of it, you can expect fast, large moves. I also like to call this zone the safe zone because taking trades in this zone is typically a very safe place to enter trades depending on how the price is trending before it entered this zone. If you look at the cloud on any of your favorite charts, you will see that the cloud usually represents support and resistance areas quite well.
(The bounce zone can be turned on or off in the indicator settings input tab.)
Chop & Low Volume Warnings - When price is choppy, it can be a portfolio killer. When volume is low, it can give false signals or the market can reverse easily, so stay out of trades when these warning labels appear on your chart. If you were already in a trade when these warnings appear, keep a close eye on your trades and be ready to exit if things start to go the wrong way.
Long & Short Entry Calculator - Here you can enter your own entry price for short or long positions so that your actual P&L will be shown live on your chart. This eliminates the need to calculate percentages in your head or switch screens to your broker often or use the measuring tool to calculate your P&L. These will show as zero until a trade price is entered.
Margin Multiplier - If you use margin to trade, enter your margin multiplier in this input and all of the percentages in the percentage update table will reflect how far each level is based on your margin. So a 5x margin will multiply all percentages in the chart by 5 and so on. This way you don’t have to calculate everything in your head or switch between your chart and your broker constantly.
Customization - Go into the indicator settings and you can customize just about everything to suit your style. In the Input tab you can: turn the Bull or Bear labels off or on so you only get the signals that are going in the direction of the trend, turn on or off the moving average lines & clouds, turn on or off the vwap & clouds, set your fibonacci timeframe or turn them off completely and set your long or short entry price as well as your margin level for percentage updates according to your portfolio.
You can also easily customize: the moving average lines & clouds, the bounce zone lines and cloud, the vwap color and line style, the support and resistance line colors and thickness, the bull and bear label styles, the take profit label styles and more.
***MARKETS***
This indicator can be used as a signal on all markets, including stocks, crypto, futures and forex as long as Tradingview has enough data to support the calculations needed by the algo.
***TIMEFRAMES***
Trend Friend can be used on all timeframes.
***IMPORTANT NOTES***
For the buy & sell pressure colored candles to show up properly you will need to go to the chart settings(gear icon in top right corner) and in the symbol tab turn off body, wicks and border.
No indicator can be right 100% of the time and remember that past results do not guarantee future performance. You still need to make smart decisions when using this indicator to be successful. It is also important to note that markets with little volume and price action may not give very good signals due to many different parameters needing to line up on one candle for a signal to be given so use it on high volume tickers with lots of price action for best results.
***TIPS***
Try using numerous indicators of ours on your chart so you can instantly see the bullish or bearish trend of multiple indicators in real time without having to analyze the data. Some of our favorites are our Volume Spikes, Directional Movement Index + Fisher, Volume Profile with DMI, and MOM + MFI + RSI with Trend Friend. They all have real time Bullish and Bearish labels as well so you can immediately understand each indicator's trend.
Cycle strategy DEMO V1.0READ BEFORE USING:
This indicator includes the Cycle strategy and 2 bonus indicators ( pivot strategy & volume strategy). This is a DEMO version that doesn't show the signals after end of January 2022. This indicator only allows you the backtest/study previous results and give a general idea on the workings on the indicator.
Introduction
Cycle strategy works on the following timeframes, 1HR, 4HR, 12HR and 1D. Cycle strategy is mostly used by me on the 1D timeframe, however, if you prefer shorter timeframes you can select those. Indicator settings will automatically adjust based off the timeframe on your chart. I use this indicator mainly for BTC , however, altcoins such as ETH, LTC, DOGE, ADA, ETC, SOL and more have shown reasonable results in the past.
The theory behind cycle strategy
The cycle strategy is based off the theory that Bitcoin moves in cycles, each time followed by periods of sideways action. This strategy tries to breakout trade momentum out of a sideways range by calculating things such as momentum, volatility and average price. The indicators, based off calculations, tries to spot breakout trends. When a trend break up it gives a "long" signal on the chart and when the trend breaks down it gives a "short" signal.
Sometimes the price doesn't break out, this is called a fakeout. The bot will automatically reverse its previous signal and take a small loss.
Applications of it in my trading setup
I apply the wave strategy in my own trading enviroment as a tool to determine buy/sell moments and general trend.
Whenever Bitcoin reaches extreme overbought level I'll wait for the indicator to give me a "sell" signal in order to hedge myself against possible corrections. In the past I've seen many bearmarkets before, I tended to not have any fiat on the side to buy these dips. The indicator has be allowed in the past to almost perfectly sell the top multiple times allowing me to accumulate BTC on lower levels and therefor increase my BTC position. I also use this indicator to spot the current Bitcoin trend. If the indicator shows a "long" signal I'll generally be looking to long on dips and whenever there is a "sell" signal I tend to look for shorts.
Bonus indicators
There are 2 bonus indicators included in this strategy. These are "bonus" indicators as I haven't had a long enough time to backtest them. They are based off my own strategies that I apply when trading. The bonus indicators have been highly succesful in the past though they are a bit more experimental.
Bonus indicator 1: Pivot strategy
Pivot points is a powerful indicator that Bitcoin tends to be very reactive to. The pivot strategy tries to determine if Bitcoin is in a bulltrend/beartrend. If Bitcoin is inside a bulltrend it will look to buy on pivot points . If the price is in a beartend it'll be looking to sell on pivot points .
Pivot strategy only works on 1HR timeframe, optimized on BYBIT:BTCUSD
Bonus indicator 2: Volume strategy
Volume strategy tries to look for large spikes of volume , once price breaks under this volume spike it'll try to buy/sell. The theory is that large volume spikes are traders getting stopped out on their leverage positions. By buying under these spikes it tries to counter trade these small price sqeeuzes.
Volume strategy only works on 1HR timeframe, only works on BYBIT:USD
[Fedra Algotrading Strategy 2tp+L&S] Futures Long or ShortStrategy for crypto market, designed for automatic algorithmic trading with bots.
Can place long and short orders
Calculates your entries based on the breakout of the simple deviation of the linear regression of the last X periods.
Configures TP (green line) and SL (red line) percentages, the TP is a trailing TP.
Optionally, you can set a first TP (white line) that sells half of the position.
Advanced trend filter to not open trades against the market. SMA (yellow line), WMA (blue line) and secret sauce
Includes an advanced system to control the backtest period (choose how many days to backtest).
Risk management by volume of capital or amount of losing trades (kill switches that will exit the trade and stop the script)
The script includes default commissions of 0.2% per trade (configurable).
- Dinamic table with Price positions to plan your limit orders if you are trading manually
- Highly customizable and optimizable.
If you want to trade longs and shorts, it is advisable to create 2 different alerts. In most cases, the optimal parameters for longs are not the same as for shorts. In a forthcoming update I will enable separate configurations.
For better performance the script uses real time price information, for this reason Tradingview may warn you that there is "repainting", as the backtest information does not contain the information of each tick but only the open, close, high and low values of each candle.
To avoid this, you can disable the "calculate on every tick" option from the strategy settings panel.
Level 1 - Learn to code simply - PineScriptThe goal of this script is honestly to help everyone learn about trading with bots and algos.
At least, to get started.
Level 1:
10 lines of code.
learn to plot 2 moving averages on your chart.
learn to create a signal from a crossover.
learn the very basics of Pine Script algo.
Oversold RSI with Tight Stop-Loss Strategy (by Coinrule)KRAKEN:LINKUSD
This is one of the best strategies that can be used to get familiar with technical indicators and start to include them in your rules on Coinrule .
ENTRY
1. This trading system uses the RSI (Relative Strength Index) to anticipate good points to enter positions. RSI is a technical indicator frequently used in trading. It works by measuring the speed and change of price movements to determine whether a coin is oversold (indicating a good entry point) or overbought (indicating a point of exit/entry for a short position). The RSI oscillates between 0 and 100 and is traditionally considered overbought when over 70 and oversold when below 30.
2. To pick the right moment to buy, the strategy enters a trade when the RSI falls below 30 indicating the coin is oversold and primed for a trend reversal.
EXIT
The strategy then exits the position when the price appreciates 7% from the point of entry. The position also maintains a tight stop-loss and closes the position if the price depreciates 1% from the entry price. The idea behind this is to cut your losing trades fast and let your winners ride.
The best time frame for this strategy based on our back testing data is the daily. Shorter time frames can also work well on certain coins, however in our experience, the daily works best. Feel free to experiment with this script and test it on a variety of your coins! With our back testing data a trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange by volume. In the example shown, this strategy made a handsome net profit of 52.6% on Chainlink with 66.67% of trades being profitable.
You can execute this strategy on your favorite exchanges with Coinrule .
Bounce Manager TrendlinesThe trendline script is made for manual input of trendlines using point clicks on the chart. The script will then see if price respects these lines by the parameters you input in settings panel. On a respectable bounce it will print buy/sell arrows. The script also has functionality to send alerts, this is helpful if you want to automate trendlines . I created this script and many others under the bounce manager toolkit to expand on the signalling capabilities of popular drawing tools as I find using just a crossover to be lacking especialy for full automation.
components:
- Line respect: When price moves past this the script will no longer look for entry until a new trend has been established. The line can also be used as a stop loss.
- Confirmation: When price touches the line during a trend it
will wait to cross over this line to confirm a reaction from the line.
- Consolidation filter: A trend filtering system, this is a distance from
the line price has to break to confirm trend direction.
- Stop loss: This can be set to a percentage distance from the low after
bounce. Or it can be set to the line respect line
- Take profit: This can be a fixed take profit target or a risk to reward
based take profit. With risk to reward it will multiply the stop loss
distance by the input and use that to create target (green cross)
- ATR based or % based: there are 2 versions of the script, one for strict
percentage based logic and another one based on ATR values
If you are having problems figuring out which settings to use I recommend you check the Bounce Manager ATR script for reference as this script plots the components:
Zignaly automation settings:
zignaly integration, you can use the settings panel to decide your risk management. Option to use a fixed take profit % or an automatic risk to reward calculation based on the stop loss. Stop loss can get calculated using the max violation setting as a stop loss (this will put stop loss below line respect level) or when not checked it will use 0.01% below the low of the signal candle as stop loss. Just add your zignaly private key in the settings and use any alert function call as alert. Make sure to use zignaly.com as your webhook url.
If 5 trendlines are not enough use the 20 line input version, this script is for the clean strong trendline trader.
Part of the Honest Algo indicator suite
Bounce Manager 20 TrendlinesThe trendline script is made for manual input of trendlines using point clicks on the chart. The script will then see if price respects these lines by the parameters you input in settings panel. On a respectable bounce it will print buy/sell arrows. The script also has functionality to send alerts, this is helpful if you want to automate trendlines. I created this script and many others under the bounce manager toolkit to expand on the signalling capabilities of popular drawing tools as I find using just a crossover to be lacking especialy for full automation.
components:
- Line respect: When price moves past this the script will no longer look for entry until a new trend has been established. The line can also be used as a stop loss.
- Confirmation: When price touches the line during a trend it
will wait to cross over this line to confirm a reaction from the line.
- Consolidation filter: A trend filtering system, this is a distance from
the line price has to break to confirm trend direction.
- Stop loss: This can be set to a percentage distance from the low after
bounce. Or it can be set to the line respect line
- Take profit: This can be a fixed take profit target or a risk to reward
based take profit. With risk to reward it will multiply the stop loss
distance by the input and use that to create target (green cross)
- ATR based or % based: there are 2 versions of the script, one for strict
percentage based logic and another one based on ATR values
If you are having problems figuring out which settings to use I recommend you check the Bounce Manager ATR script for reference as this script plots the components:
Zignaly automation settings:
zignaly integration, you can use the settings panel to decide your risk management. Option to use a fixed take profit % or an automatic risk to reward calculation based on the stop loss. Stop loss can get calculated using the max violation setting as a stop loss (this will put stop loss below line respect level) or when not checked it will use 0.01% below the low of the signal candle as stop loss. Just add your zignaly private key in the settings and use any alert function call as alert. Make sure to use zignaly.com as your webhook url.
The trendlines you see in preview are based on a long term pitchfork on BTCUSDT 10H chart
If 20 trendlines are too much I will be releasing a 5 line input version, this script is more to be used to automate pitchforks, gann boxes etc.
Part of the Honest Algo indicator suite
MilleMachineHello traders,
I hereby present to you the second stage of my journey to finding a reliable, profitable trading strategy.
The "Millemachine" is based on the "Millebot", my previous published strategy. This means the backbone of the strategy is still the same: a trend following system. Instead of using a fixed TP and SL, a trailing stoploss is now used. To limit the losses when the trend weakens, the trailing stoploss automatically gets smaller, as it is based on the ATR.
A new utility is you can now easily switch between indicators on which the decision making is based. This allows the user to discover which indicators work best for entry, long/short switching and stoploss configuration.
The strategy has been proven to be very profitable in trending markets, but can suffer losses during ranging market. To make the system more robust, the strategy cannot solely rely on a trending system. Other systems must be added.
I believe that a good trading bot must consist of more than 4 different strategies, based on different systems. This is what I am currently working on.
My goal for publishing this strategy is to help other traders build their own. In my journey I found it difficult to find a good strategy that employs a decent risk management, which is truly essential for having good, consistent results. Also, a realistic commission needs to be defined to have a realistic performance prediction. This weighs on the profitability and therefore is often set at 0 by authors of other strategies, which I find misleading.
If you have found this strategy informative or useful, please leave a comment.
Greetings Michael
Bounce Manager S/RThis script is based on the bounce manager ATR script
The S/R script is made for manual input of horizontal S/R lines, the script will then see if price respects these levels by the parameters you input in settings panel. On a respectable bounce it will print buy/sell arrows. The script also has functionality to send alerts, this is helpful if you want to automate S/R lines.
An easy strategy to use would be the one you see in the preview using a grid of round numbers. This script in no way shape or form promises easy gains and like all algorithms should be forward tested on a paper trading account before using real money.
components:
- Max violation: When price moves past this the script will no longer look for entry until a new trend has been established. The line can also be used as a stop loss.
- Confirmation line: When price touches the line during a trend it
will wait to cross over this line to confirm a reaction from the line.
- Min past distance: A trend filtering system, this is a distance from
the line price has to break to confirm trend direction.
- Stop loss: This can be set to a percentage distance from the low after
bounce. Or it can be set to the max violation line
- Take profit: This can be a fixed take profit target or a risk to reward
based take profit. With risk to reward it will multiply the stop loss
distance by the input and use that to create target (green cross)
- ATR based or % based: there are 2 versions of the script, one for strict
percentage based logic and another one based on ATR values
Part of the Honest Algo service.
[Fedra Algotrading 2TPs]This strategy uses the deviation of a simple linear regression to determine the entry point into a short-term trend. It also includes an intelligent trend filter (SMA, WMA, Super trend and MACD), to determine the dominant trend over a longer time frame and avoid opening trades against the market.
It manages capital by dividing the position into 2 take profits, the first one configurable in a fixed percentage, which will sell half of the position, and the second one that will trigger a trailing take profit once the desired percentage is reached, with the rest of the position.
Each parameter is optimizable to adapt it to the desired market, but this strategy benefits from the high volatility of mid and low capitalization cryptocurrencies due to their higher volatility.
It also includes tools to adjust the backtests, and command inputs so that the script can automatically work with bots.
Bogdan Ciocoiu - Sniper EntryWhat is Sniper Entry
Sniper Entry is a set indicator that encapsulates a collection of pre-configured scripts using specific variables that enable users to extract signals by interpreting market behaviour quickly, suitable for 1-3min scalping. This instrument is a tool that acts as a confluence for traders to make decisions concerning current market conditions. This indicator does not apply solely to an asset.
What Sniper Entry is not
Sniper Entry is not interpreting fundamental analysis and will also not be providing out of box market signals. Instead, it will provide a collection of integrated and significantly improved open-source subscripts designed to help traders speculate on market trends. Traders must apply their strategies and configure Sniper Entry accordingly to maximise the script's output.
Originality and usefulness
The collection of subscripts encapsulated in this tool makes it unique in the Trading View ecosystem. This indicator enables traders to consider entry positions or exit positions by comparing similar algorithms at once.
Its usefulness also emerges from the unique configurations embedded in the indicator's settings, which are different from those of the original scripts.
This indicator's originality is also reflected in how its modules are integrated, including the integration of the settings.
Open-source reuse
I used the following open-source resources, which I simplified significantly and pre-configured for short term scalping. The source codes for the below are already in the public domain, including the following links listed below.
www.tradingview.com (open source)
(open source and generic algorithm)
www.tradingview.com (open source)
(open source)
(open source)
www.tradingview.com (generic MA algorithm and open source)
(generic VWAP algorithm and open source)
I11L OIL BotThe System makes use of the Bolinger Bands strategy from TradingView and implements simple Money Management Rules like SL and TP.
You can adjust the following Parameters:
Leverage: Leverage.
Risk Capital per Trade: The amount you are willing to lose per Trade, keep in mind that changes in Leverage should follow changes in Risk Capital.
TP_Factor: Default is 2:1 Risk:Reward, you might want to adjust this according to the underlying market.
InvertBuyLogic: Inverts the Logic of the System, important for checking if you have a true performance advantage from using the System. I look for a flat looking Curve in the wrong mode.
LookbackDistance: The distance your standart Deviation is refering to. A Lookback Distance too big might result in very few signals.
DevMult: We only want outliers, so we multiply our standart Deviation Bands by a Factor.
crypto futures hourly scalping with ma & rsi - ogcheckershi to all lovable traders,
hereby i want to share a combination of trade ideas for scalping
i've chosen hourly timeframe
indicators used: moving averages and rsi
moving averages:
ema 3, ema 5, ema 7
sma 3, sma 5, sma 7
daily_ema_3, daily_ema_5
daily_ema_5, daily_sma_5
rsi:
rsi 7, rsi 14, rsi 26
daily_rsi_7, daily_rsi_14, daily_rsi_26
as per the analysis over moving average behavioral patterns & rsi movements, useful points are given below which will be helpful while choosing good entry points & exit points,
strategical points for LONG:
* when ema3 crosses above sma3 - green candles start to form
* it's followed by ema5 > sma5 and ema7 > sma7
* when ema3 crosses down sma3 - it's considered as an indication of exit
* if rsi supports then can wait for ema5 crossing down sma5
* as similar, when daily_ema_3 crosses above daily_sma_3, its an higher timeframe bullish indication, so the lower timeframe entries inside this higher timeframe is a sure shot confident entry
* for LONG always take entries when rsi_14 < 30 or 25 else check rsi_7 < 25 or below
* as along the above, bullish CANDLE patterns like bullish engulfing , morning star is been used for entry at lower levels
* so here i've used OPEN as rsi_source in majority
* exit points also indicated at high_rsi and moving average crossunders or reverse crossovers
* for SHORTING, the above said ideas can be used in viceversa
* inputs in the indicator were tailored for users needs so that you will enjoy the magics of customization
if i am wrong in anyways regarding the above indicator strategy, please forgive me and help me improve in this aspect by commenting.
after few more studies and analysis and mainly QUERIES & COMMENTS, i'm planning to backtest these strategies here in tradingview.
also if these strategies are coded in python, we can link it to Binance Futures Algo or Bot Trading.
thankyou for this opportunity,
thanks to tradingview and pinecoders
thanks to Pranab (for 365MA)
thanks to Gandalf (for inspiring)
Special Thanks & Love to Chartbank for Everything
Ichimoku Cloud MasterIchimoku Cloud Master aims to provide the ichimoku trader with easy alert functionality to not miss out on valuable trade setups. The key purpose of this script is to better visualise crucial moments in Ichimoku trading. These alerts should not be used for botting in my opinion as they always need a human to confirm the ichimoku market structure. For example, is the Kijun-Sen flat and too far away from price? A good ichimoku trader will not enter at such a point in time.
Explanation of script:
Chikou(lagging span): pink line, this is price plotted 26 bars ago. People ignore the power of this it is crucial to see how chikou behaves towards past price action as seen in the chart below where we got an entry at red arrow because chikou bounced from past fractal bottom.
Kijun-Sen(base line): Black line or color coded line. This is the equilibrium of last 26 candles. To me this is the most important line in the system as it attracts price.
Kijun = (Highest high of 26 periods + Lowest low of 26 periods) ÷ 2
Tenkan-Sen(conversion line): Blue line. This is the equilibrium of last 9 candles. In a strong uptrend price stays above this line.
Tenkan = (Highest high of 9 periods + Lowest low of 9 periods) ÷ 2
Senkou A (Leading span A)= Pink cloud line, this is the average of the 2 components projected 26 bars in the future.
Senkou A = (Tenkan + Kijun) ÷ 2
Senkou B (Leading span B) = Green cloud line, this is the 52 day equilibrium projected 26 bars in the future.
Senkou B = (Highest high of prior 52 periods + Lowest low of prior 52 periods) ÷ 2
Notice how the distance between Chikou and the cloud is also 52 bars. This is all part of Hosoda's numbers which I am not going to explain here.
Fractals: These are the black triangles you find at key turning point. If you want to know how they work reseach williams fractals. I've used fractals with a period of 9 as it is an ichimoku number. These fractals are useful when working with ichimoku wave theory. Again I will not explain that here but in further education
Fractal Support: Ability to extend lines from the fractals which can be used as an entry/exit mechanism in your trading. For example wait for tenkan to cross kijun and then enter on fractal breakout.
Signals:
Crossing of Chikou (lagging span) with past Kijun-Sen: this will color code the Bars / Kijun-Sen (you can turn this off in options)
The script also has a signal for this, this will be the green and purple diamonds. Where green is bullish and purple is bearish.
wy is this important?
When current price plotted 26 candles back (chikou) crosses over the past equilibrium (kijun-sen) this usualy means price has moved past resistance levels where sellers come in. This indicates a switch in market structure and price is bullish from this point, this is the same in the other direction.
Kumo Twist: when the kumo cloud (future) has a crossover from for example green to red (bull to bear). The script plots these using the colored cross symbols as seen in the picture above. A chikou cross + a Kumo twist at same bar of next to eachother below the cloud can be a great entry sign: this would be an entry after cross in the chart above.
Kijun Bounce: when in an uptrend the price retraces back to Kijun-Sen and starts to go back up. These are marked by the yellow circles as seen in chart below:
low below Kijun-Sen and close above it
Strong Trend: when Tenkan is above Kijun, price above cloud, future cloud green, chikou above close, chikou above Kijun we establish a strong bullish trend. For bearish the exact opposite. The script has a function to send an alert at the start of such trends and to plot them with small colored circles above the bars.
Customisation:
I've added options to disable specific aspects of the indicator for those traders who do not want to use all aspects of the indicator. In the customisation tab I've given each part a clear title so you can use your own colors/shapes.
The perfect entry?
Further info:
Look into my education pane, I will be adding education in the future. The chance of me making a more advanced version of the script including line forecasting etc is rather high so watch out for that.
For those who want to master this system I recommend reading the book:
How to make money with the ichimoku system by Balkrishna M. Sadekar
Or the originals books by Hosoda the inventor of Ichimoku if you can get your hands on them and can read Japanese.
Almost all info about the ichimoku system you find on the internet will lose you money because they reduce the system to simple signals that do not generate money.
I will be providing educational material on tradingview using this indicator.
Ridicoulous_MA - Multitimeframe MA that adapts to TrendRidicoulous_MA
This is my very own creation of an MA that adapts to Trend strength! - It gets Thicker when Trend is weak and Thinner when Trend is Strong to help you Filter out Bad Trades
I was looking for an MA that Adapts fast to sideway Markets to filter out Signals from Algos in Sidewaymarkets but couldnt find anything, So i decided to create my own
The MA is created Multitimeframe with close so it does not repaint!
The MA gets Builded with Values from EMA or SMA from the Choosen Timeframe (you can decide to use SMA or MA Values for building it up) i personally prefer to build it on EMA.
Trade Below the MA for Short and Above the MA for long!
If you need the MA for a Bot or anything contact me and i can add an output for you if close above/below the MA then you can use it as an external Filter!
This is only the MA! no Strategy! but i still just did some test on very simple strategies for autotrade
In this screenshot i simulated entry on Crossover MA and close Above an EMA & Above Vwap
prnt.sc
In this screenshot i just tested it as a Filter for a Strategy, simple Long above MA & Vwap (Pyramiding 1, 0.05% comission)
prnt.sc
In this screenshot i just entered a Trade after the breakabove and retesting the MA (Pyramiding 5, 0.05% comission)
prnt.sc
Ultimate Kinski Histogram Strategy [PrismBot] [Lite]This is an anti-curve fitting strategy that has no value inputs for the strategy settings. It just works , as they say.
This is based on the @KINSKI Buy-Sell Signal , but also incorporates other confluence (an MACD and histogram) and incorporates it into a fully automatable strategy with customizable order settings and quantity calculations.
The strategy has potential in scalping, but works best (in my testing) on higher timeframes (15M and up) with the default strategy.
Included in this Strategy:
✔️ Tweak a multitude of specific settings (MA lengths, R:R, SL distance etc)
✔️ Enable advanced setup filters
✔️ Use money management and risk calculations
✔️ Draw trade info directly to chart (eg. SL size in percent, win rate etc)
✔️ Use various filters (eg. time filter, date filter, MA slope angle etc)
✔️ Manage risk per position when auto-trading forex through AutoView
✔️ Choose from various alert conditions!
✔️ Sync to any bot or algorithmic trading system
[TTI] Net New Highs / Lows––––History & Credit
There are multiple methodologies that use Net New Highs for the NASDAQ or NYSE as a market direction indicator. Recently, I saw Matt Caruso to also apply such methodology, so I decided to code this indicator.
–––––What it does
👉 Plots a Net Change histogram. This shows New Highs - New Lows, if the histogram is above 0 this means there are more highs than lows
👉 Plots Background colouring. This is dependant on the sensitivity setting of the indicator. We would require a few days of downward action before concluding a downward action. Sensitivity can be adjusted in the menu
👉 Bot the Histogram and the Background colouring can be turned on and off (as per screenshot example)
–––––How to use it
You can use it to validate if the market conditions are ripe for entering a trade. For instance if you trade long, you would want to confirm with the indicator that general market is facilitating moves to the upside. IBD have mentioned more than once that a stock move is 50% due to the general market move.
Trading Assistant DiNGUETrading Assistant DiNGUE This indicator is like a trading assistant for your charts.
It helps set your biases and emotions aside and lets you focus on managing trades in an easy visual way.
Get various types of signals to enter your trades (either Long or Short). Then use take profits, stops, or the opposite signal to exit trades.
The signals are created from various indicators and sensibility options you can customize any way you want. Works on every timeframe.
You can customize every setting or used the preset ones. Preset settings adjust automatically based on the timeframe you are using on the chart.
The 12 Indicators are Volume - RSI - Stochastic - MacD - Moving Averages (MA) - Rate of Change (ROC) - ADX DMI Directional Movement Index - On Balance Volume (OBV) - Bollinger Bands - VWAP - ATR - Parabolic SAR.
Every indicator can be turned On or Off.
You can adjust the way it creates signals by selecting either 'rise-fall', 'crosses' or by combining both.
You can select the sensitivity of the signal from Normal - Safe - Safer.
You can adjust lengths or use the preset ones.
There are also additional options for each indicator, you can filter weak levels for ADX, filter for tight bands, have ROC above 0…
You can also plot several of those indicators on the screen. 2x Moving Averages, 2x VWAP, 2x ATR, 2x SAR for even easier visualization of the trend.
You can also plot fractals to facilitate once again on trend visualization. Higher high, lower low, higher low, lower high.
Trade with the Trend and Safe Trades:
If you want to have a higher chance of success, you can trade with the trend. First, select the trend timeframe you would like to use. Let's say the “Weekly” trend. Meaning it will generate a signal on the weekly timeframe and based on the result (Long or Short) it will only take trades in that direction. So the trend is LONG on the Weekly and you get a “Long” signal, it will take it. “Short” signals on the other hand will be treated as “stops” and won’t want to go against the trend by going ‘short’.
Safe Trend works in the same manner, but instead of using the signal on a bigger timeframe, it uses an indicator as to the deciding factor. Let's say you select the 200SMA as the “Safe signal”. The indicator will only go “Long” when above the 200SMA and “Short” under the 200SMA. Otherwise, it will put a stop instead of going against the trend.
Stop Loss:
There are 4 different types of stop-loss that you can use at the same time.
- Indicator Stop
- Fib stop
- Fix % stop
- Trailing stop
You can plot the stops directly on the chart AND OR add them to the panel for an easy visualization once again.
With the ‘indicator stop’, you can select one of the two: MA ATR SAR VWAP as a stop.
Fib stop, it uses fib numbers to calculate a stopping point.
Fix %, you can select your max loss in percent. Could be 2%, 5%
A trailing stop is like a fixed stop but that will trail as the price moves in the right direction.
Take Profit:
There are 4 different types of take profit that you can use simultaneously.
- Fix % Take Profit
- ATR multiple Take Profit
- Fib multiple Take Profit
- Bollinger Band Take Profit
Fix % just let you set a fix take profit target in percent.
ATR multiple lets you select a target based on a multiple of the average true range.
Fib multiple lets you select a target based on a fib multiple
Bolling Band lets you take profit based on the Bollinger band settings you select.
Visual Panel:
The visual panel lets you see exactly how is the last trade progressing. It will give you the entry price, profit, stop, and target. You can turn it on or off, as is for the stop and target.
You can also decide to plot 1 position or more, you can even show all the possible signals, add backgrounds with colors. You can also plot the bigger Trend and Safe Signals explained above.
If you have any questions, suggestions, or comments, feel free to do so!
Market Maker Indicator V2 [tecnocrypto]This indicator is based on the idea that prices are generated by the interaction between a Market Maker on one side (sometimes also called the "Composite Man") and Retail Traders on the other side (Retail Traders include simple retail, professional traders, whales, institutions...as a single entity). These two opposite entities "play" the trading game on trading platforms/exchanges (crypto), which are neutral to the game.
Market makers are liquidity providers, and make profits either by charging a spread between buy and sell prices, and (also) by trapping retail traders into specific positions.
Trading is a "zero sum" game in the sense that it generates a transfer of resources between these two specific players, which are indeed the Market Maker and Retail Traders. If Retail Traders are in profit, Market Maker is (temporarily) in loss, and viceversa. Market Maker goal is to squeeze profits out of Retail Traders, by inducing them to take wrong positions.
The Market Maker Method Indicator executes the following:
1) Identifies and plots candles that are generated by the Market Maker's moves (called "Shift Candles"); shift candles are "artificial" price/volumes moves, generated to induce retail traders into specific zones which are, essentially, traps. They are called Shift Candles as they generate abnormal (and mostly unexpected) price movements in either direction. They move the price from one zone to the next to execute the Market Maker strategy. Observe how often sudden (apparent) prices increases are followed by price crashes (stop hunt rise, drop); and observe how often sudden (apparent) price collapses are followed by price uptrends (stop hunt low, rise); sometimes these movements are made in progressive steps (generally, 3).
2) Plots open long/open short alerts based on the assumption that when Market Maker plots upwards shift candles, vivid green color, they are preparing for an upcoming price reversal (down); same, but opposite sign, for downwards shift candles. This is a counterintuitive logic for Retail Traders, that generally open long when price is rising, and open shorts when price is falling - jumping into Market Makers traps.
3) Plots the areas where price is expected to return (upwards or downwards) based on previous shift candles (called "Recovery Zones")
You can use this indicator on any timeframe and for any asset.
The Market Maker indicator V2 provides long / short entry signals based upon the market maker manipulative moves described above.
Long alerts are triggered by manipulative price push-downs by the marker maker, which will be followed by price increases (while price was decreasing, market maker was purchasing from retail). Additional factors are taken into consideration to plot long entry signals, , mainly volume build up and mean reversion, around this basic concept.
Short alerts are triggered by manipulative price push-ups by the marker maker, which will be followed by price drops (while price was increasing, market maker was selling to retail). Additional factors are taken into consideration to plot short entry signals, mainly volume build up and mean reversion, around this basic concept.
The indicator is based on the Traders Reality indicator, but improved with alerts, that can be used with trading bots, and additional possibilities to customize the behavior of the indicator.
A strategy associated with this indicator is also available.
Best results on the 1H timeframe.
Contact me for further info.
boonam17_ALERT이용 관련 문의는 이메일 boonam17@naver.com 통해 해주시기 바랍니다.
백테스트 결과와 실제 투자 결과는 개인 블로그를 통해 업데이트할 계획입니다.
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
MarketMaker Method [ShiftCandles]This indicator is based on the idea that prices are generated by the interaction between a Market Maker on one side (sometimes also called the "Composite Man") and Retail Traders on the other side (Retail Traders include simple retail, professional traders, whales, institutions...as a single entity).
These two opposite entities "play" the trading game on trading platforms/exchanges (crypto), which are neutral to the game.
Market makers are liquidity providers, and make profits either by charging a spread between buy and sell prices, and (also) by trapping retail traders into specific positions.
Trading is a "zero sum" game in the sense that it generates a transfer of resources between these two specific players, which are indeed the Market Maker and Retail Traders. If Retail Traders are in profit, Market Maker is (temporarily) in loss, and viceversa. Market Maker goal is to squeeze profits out of Retail Traders, by inducing them to take wrong positions.
The Market Maker Method Indicator executes the following:
1) Identifies and plots candles that are generated by the Market Maker's moves (called "Shift Candles"); shift candles are "artificial" price/volumes moves, generated to induce retail traders into specific zones which are, essentially, traps. They are called Shift Candles as they generate abnormal (and mostly unexpected) price movements in either direction. They move the price from one zone to the next to execute the Market Maker strategy. Observe how often sudden (apparent) prices increases are followed by price crashes (stop hunt rise, drop); and observe how often sudden (apparent) price collapses are followed by price uptrends (stop hunt low, rise); sometimes these movements are made in progressive steps (generally, 3).
2) Fires open long/open short alerts based on the assumption that when Market Maker plots upwards shift candles, vivid green color, they are preparing for an upcoming price reversal (down); same, but opposite sign, for downwards shift candles. This is a counterintuitive logic for Retail Traders, that generally open long when price is rising, and open shorts when price is falling - jumping into Market Makers traps.
3) Plots the areas where price is expected to return (upwards or downwards) based on previous shift candles (called "Recovery Zones")
The script will be further developed to prevent early open long/open short alerts, trying to catch the Market Makers cycles in a more detailed way (to account for situations where artificial price moves are executed in consecutive steps, instead of single candles).
You can use this indicator on any timeframe and for any asset.
You can connect the open long/open short alerts to trading bots to execute automatic trades.