[SPOILED]SuperTrench - ETH Super ScalperHi Traders,
I'm republishing this script as I finally polished it to perfection IMO. The script uses 5 coding sections: entry, trend filter, pivot filter, take profit, and stop loss. The script mainly uses trailing as take profit; this is probably the easiest way to make a profitable scalper strategy.
Backtest capital is set to 1000 USDT, 35% equity, 0.04% commission, limited backtest date from Jan 2022 to now, backtested on ETH/USDT prep contracts 15m timeframe, result as shown below.
It looks unreal right? Hell no, I actually tested this strategy on Binance from Dec 06 to Dec 10. I got 8.29% return with 4x leverage, 50% equity setup; 75% win rate,1.58 profit factor, with 4.3% max drawdown, it is amazingly close to the backtest result.
User Manual
Entry >>> Stoch RSI:
I added 5 MA types to the Stoch RSI which is HMA/VWMA/WMA/EMA/SMA, HMA with Length setting of 5, 8 seems to be most efficient, VWMA and WMA with 8, 13 will generate less entry signals but with less entry risks.
Entry >>> R Style:
It based on price action, with candlestick makes a U turn, after 2nd candlestick confirmed, it generates entry signal, this will give you some extra entries, better leave it enabled.
Entry >>> Price Step:
This probably is the core feature of this strategy; also my secret ingredient to making this strategy this efficient. It is recommended to enable step 1-5, more steps basically means more entries, but they are not necessarily profitable.
Trend Filter >>> Price Step:
I couldn't tell you much details about how this indicator works, but it is a reliable indicator, based on price action, and I got some ideas from Demark9 indicator. The bigger the level, the stronger the filter is, please note that if 'Price Step Entries' less than Price Step Trend, entries will be ignored.
Pivot Filter >>> RSI Pivot & Pinbar Pivot:
RSI Pivot detects if the RSI signal line making U turn in certain condition, Pinbar detection combines R Style entry when price action U turn took place, these 2 pivot filter will close the trade once it is counter trend, so it better enable and leave it as is.
Trend Filter >>> Trend Magic:
Trend Magic uses CCI and ATR to calculate trend status, green means uptrend, red means downtrend, pretty straight forward, the best value for this indicator would be, 21, 34, 55, 89.
Trend Filter >>> Alpha:
This filter combines R style pivot, price step, EMA all together to detects consolidation area, because EMA was involved, so the best look back period would be around 15-35, it is best to use default value IMO, in another hands, if you need stronger filter, feel free to use 10, 18, 20, 25, 30, 35, make sure look back period should increase or decrease by 5 every time.
Take Profit and Stop Loss:
The default value for tp is set to 0.4%, but I also give you option to switch to ATR TP; you can adjust in the ATR multiplier, default ATR trailing stop loss uses 1 ATR, but you can adjust it for better drawdown tolerance. Fixed ATR SL is also given when fixed ATR is enabled. There will be a failsafe SL default set to 1% if price moves counter direction of opened position, it will close trade no matter what happens.
Enjoy :)
Penunjuk dan strategi
Time Based Crypto DayTrade StrategyThis is a time based strategy, designed to enter and exit within the same day of the week, using different hours for entry and exit.
The script is long only direction, and it has no risk management inside, so use it with caution.
At the same time you can also calculate each individual hour return within a certain day, and make your own idea about the best moments to be enter.
In order to filter a bit from the bad trades, I have applied an ATR filter, to check if that volatility is rising in order to help eliminate some of the bad trades when there is no volatility around.
For this example, on BTC, it seems that for the last years, on tuesday and thursday, enterring at the beginning of the daily candle, 01:00hours and exit at 00:00 hours, seems to give positive results giving the idea that can be converted in some sort of edge into our favor.
However dont take this entirelly for granted and conduct your own searches
I11L - Meanreverter 4h---Overview---
The system buys fear and sells greed.
Its relies on a Relative Strength Index (RSI) and moving averages (MA) to find oversold and overbought states.
It seems to work best in market conditions where the Bond market has a negative Beta to Stocks.
Backtests in a longer Timeframe will clearly show this.
---Parameter---
Frequency: Smothens the RSI curve, helps to "remember" recent highs better.
RsiFrequency: A Frequency of 40 implies a RSI over the last 40 Bars.
BuyZoneDistance: Spacing between the different zones. A wider spacing reduces the amount of signals and icnreases the holding duration. Should be finetuned with tradingcosts in mind.
AvgDownATRSum: The multiple of the Average ATR over 20 Bars * amount of opentrades for your average down. I choose the ATR over a fixed percent loss to find more signals in low volatility environments and less in high volatility environments.
---Some of my thoughts---
Be very careful about the good backtesting performance in many US-Stocks because the System had a favourable environment since 1970.
Be careful about the survivorship bias as well.
52% of stocks from the S&P500 were removed since 2000.
I discount my Annual Results by 5% because of this fact.
You will find yourself quite often with very few signals because of the high market correlation.
My testing suggests that there is no expected total performance difference between a signal from a bad and a signal from a good market condition but a higher volatility.
I am sharing this strategy because i am currently not able to implement it as i want to and i think that meanreversion is starting to be taken more serious by traders.
The challange in implementing this strategy is that you need to be invested 100% of the time to retrieve the expected annual performance and to reduce the fat tail risk by market crashes.
EURUSD COT Trend StrategyThis is a long term/investment type of strategy designed to have a good idea about where the big trend direction is headed.
Its logic, its made entirely on the COT report, mainly from looking into the net non comercial positions aka the speculators.
For bullish trend we look that the difference between long non comercial vs short non comercial is higher than 0
For bearish trend we look that the difference between long non comercial vs short non comercial is lower than 0.
This is mainly as an educational tool, for a full strategy, I recommend implement other things into it, like technical analysis or risk management.
If you have any questions, please let me know !
Wunder Trend Reversal botWunder Trend Reversal bot
1. Wunder Trend Reversal Bot - this has only one goal to find a reversal of the trend.
2. The strategy determines, based on the specified value for the filter, a market reversal based on the price actions of the previous bars.
3. A short EMA is used to filter false signals after the reversal signal was received. Crossing the EMA and changing its direction confirms the trend change.
4. There are 2 ways to calculate stop loss and take profit. You can choose one of them:
- Classic stop loss and take profit in a fixed percentage
- ATR stop loss and take pro
5. ATR uses risk reward (R:R) to calculate take profit. The script calculates the risk-reward based on a certain stop loss level and uses it to calculate the take profit
6. A function for calculating risk on the portfolio (your deposit) has been added to the script. When this option is enabled, you get a calculation of the entry amount in dollars relative to your Stop Loss. In the settings, you can select the risk percentage on your portfolio. The loss will be calculated from the amount that will be displayed on the chart.
For example. Deposit - $1000, you set the risk to 1%. SL 5%. Entry volume will be $200. The loss at SL will be $10.10$ this is your 1% risk or 1% of the deposit.
Important! The risk per trade must be less than the Stop Loss value. If the risk is greater than SL, then you should use leverage.
The amount of funds entering the trade is calculated in dollars. This option was created if you want to send the dollar amount from Tradingview to the exchange. However, putting your volume in dollars you get the incorrect net profit and drawdown indication in the backtest results, as TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview Backtest results, use the ”Volume in contracts” option.
RSI Divergence Strategywhat is "RSI Divergence Strategy"?
it is a RSI strategy based this indicator:
what it does?
it gives buy or sell signals according to RSI Divergences. it also has different variables such as "take profit", "stop loss" and trailing stop loss.
how it does it?
it uses the "RSI Divergence" indicator to give signal. For detailed information on how it works, you can visit the link above. The quantity of the inputs is proportional to the rsi values. Long trades are directly traded with "RSI" value, while short poses are traded with "100-RSI" value.
How to use it?
The default settings are for scalp strategy but can be used for any type of trading strategy. you can develop different strategies by changing the sections. It is quite simple to use.
RSI length is length of RSİ
source is source of RSİ
RSİ Divergence lenght is length of line on the RSI
The "take profit", "stop" and "trailing stop" parts used in the "buy" group only affect buys. The "sell" group is similarly independent of the variables in the "buy" group.
The "zoom" section is used to enlarge or reduce the indicator. it only changes the appearance, it does not affect the results of the strategy.
Breakeven Line DemoPlug the breakeven line code into the bottom of your strategy to get visualization of your breakeven price. Line is green when net position is long, red when net short and invisible when strategy is risk neutral. Most useful for strategies which use pyramiding (successive entries in same direction stacked upon each other) as it can be difficult to track where prices needs to return to to allow closing in profit. Disclaimer: the strategy logic is garbage do not use it. It is only there so you can see how Breakeven Line logic is implemented.
Fast EMA above Slow EMA with MACD (by Coinrule)An exponential moving average ( EMA ) is a type of moving average (MA) that places a greater weight and significance on the most recent data points. The exponential moving average is also referred to as the exponentially weighted moving average . An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average simple moving average ( SMA ), which applies an equal weight to all observations in the period.
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA .
The result of that calculation is the MACD line. A nine-day EMA of the MACD called the "signal line," is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. Traders may buy the coin when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line. Moving average convergence divergence ( MACD ) indicators can be interpreted in several ways, but the more common methods are crossovers, divergences, and rapid rises/falls.
The Strategy enters and closes the trade when the following conditions are met:
LONG
The MACD histogram turns bullish
EMA8 is greater than EMA26
EXIT
Price increases 3% trailing
Price decreases 1% trailing
This strategy is back-tested from 1 January 2022 to simulate how the strategy would work in a bear market and provides good returns.
Pairs that produce very strong results include AXSUSDT on the 5-minute timeframe. This short timeframe means that this strategy opens and closes trades regularly.
Additionally, the trailing stop loss and take profit conditions can also be changed to match your needs.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
[-_-] Level Breakout, Auto Backtesting StrategyDescription:
A Long only strategy based on breakout from a certain level formed by High price. It has auto-backtesting capabilities (you set ranges for the three main parameters: Lookback, TP and SL; the strategy then goes through different combinations of those parameters and displays a table with results that you can sort by Percentage of profitable trades AND/OR Net profit AND/OR Number of trades). So you can, for example, sort only by Net profit to find combination of parameters that gives highest net profit, or sort by Net profit and Percentage profitable to find a combination of parameters that gives the best balance between profitability and profit. The auto-backtesting also takes into account the commission which is set in % in the inputs (make sure to set the same value in properties of the strategy so that auto-backtesting and real backtesting results match).
NOTE: auto-backtesting only find the best combinations and displays them in a table, you will then need to manually set the Lookback, TP and SL inputs for real backtesting to match.
Parameters:
- Lookback -> # of bars for filtering signals; recommended range from 2 to 5
- TP (%) -> take profit; recommended range from 5 to 10
- SL (%) -> stop loss; recommended range from 1 to 5
- Commission (%) -> commission per trade
- Min/Max Lookback -> lookback range for auto-backtesting
- Min/Max TP -> take profit range for auto-backtesting
- Min/Max SL -> stop loss range for auto-backtesting
- Percentage profitable -> sort by percentage of profitable trades
- Net profit -> sort by net profit
- Number of trades -> sort by number of trades
ETHUSDT Long-Short using EMA,OBV,ADX,LinearReg,DXY(No repaint)This script strategy is used to follow the trending EMA with a delta difference (Price-EMA) to know when to enter and with 5 variables mentioned below, stop loss is below EMA line all the time in long and above EMA line in short, is like a trailing stop after candle is closed. Hard stop is also placed to prevent big candles movements, also correlation between VIX and ETH when the correlation is <-0.2 the position can be opened.
Indicators used:
EMA , OBV , ADX , Linear regression and Dollar Index trending, Leverage is available for Long and Short positions.
LONG
When Price is above EMA and price-ema difference is smaller than "Long delta Price/MA"
OBV(4hrs) is above OBV-EMA(110)
Linear regression is strong
ADX is strong >50
DXY is trending down
SHORT
When Price is below EMA and ema-price difference is smaller than "Long delta Price/MA"
OBV(4hrs) is below OBV-EMA(110)
Linear regression is weak
ADX is weak <50
DXY is trending up
BINANCE:ETHUSDT 30 minutes Timeframe
US Market Balance of Power Heikin Ashi Swing StrategyThis is a swing strategy, using the power of correlation, mainly designed for an investment approach for the US Market.
It uses the original OBV formula, which has been adapted to monthly heikin ashi candles values, which are taken from the correlated asset, in this case we are using QQQ chart for testing, but internally we are using the logic from SPY chart for calculations.
Once we that value, we make a moving average of it with the length of half of a year to have an idea about the overall price trend during that period of time.
After that, we are going to apply a percentile formula for the OBV value, and we are going to look for the percentile near 100th rank of the entire history of that data.
Finally once we have the top percentile values, we are going to create different formulas for long and short entries:
Short Entry/ Long exit = Current top percentile is higher than the previous top percentile value
Long Entry/ Short Exit = Current obv value is negative and the top percentile is smaller than the previous one or we are near the top values for the OBV oscillators ( crossing upwards previous candle/downwards current candle)
The strategy has been tested using 25% of the entire initial capital available in order to have an idea about the compound effect over the entire history of time which was selected.
From the test which can determine, that on average when we have strong bullish trends, the initial buy n hold strategy outperforms us, however the strategy is definitely a winner when there are side market/ bearish periods of time since it will help cut losses during these periods.
If you have any questions, please let me know !
Cyatophilum Universal Oscillator TraderAn indicator to backtest and create an infinite number of strategies using any external indicator.
═════════════════════════════════════════════════════════════════════════
█ HOW IT WORKS
The indicator allows you to create your oscillator strategy and get backtest results from the Strategy Tester.
You can also create alerts for each of the strategy events.
█ HOW TO USE
Choose a strategy direction long or short that you want to create.
Always use regular candle type.
Configure your entry condition . To use any other indicator as source, it needs to be added to the chart first.
If you have the basic (free) TradingView plan, you can only have 1 indicator on your chart, and cannot use this external source feature. For this case, the indicator has a list of built-in oscillator (that can be increased upon request).
Then choose your condition: Cross over, Greater than, Pullback, Turning up, etc.
You now have your entry and should already see trades on the chart!
Next you can fine tune your entry condition or move to the risk management and filters.
Configure your stop loss
Use the stop loss feature to exit a trade at a certain loss.
You can also create a trailing stop using price % movement or ATR.
Configure your profit target
Use the Take Profit feature to set a target in percentage of price. You can also make it trail.
Configure your safety orders
This indicator has a safety orders feature to reduce the risk of your trade. See more below.
Check your backtest parameters
Make sure that the initial capital and order size make sense. Since it is a pyramiding strategy with safety orders, the sum of all deals should not be bigger than the initial capital.
If you use % equity as order size, please note that it will create compounding.
Check the fees, by default they are set to 0.1%.
I also recommend to set a slippage that corresponds to your exchange's spread.
█ FEATURES
• Strategy direction
Configure to go long or short.
• Entry Conditions
- External Oscillator source
- Built-in Oscillator (for basic plans)
- Base Condition for entry (Less/Greater than, Crossing Up/Down, Pullback Bull/Bear, Turning Up/Down, etc. More can be added later on)
- Additional Momentum Condition: Oscillator should be rising/falling for x number of bars
- Addition Threshold Condition: Oscillator should be Greater/Lowser than x
• Trend Filter
Filter Trades using 1 or 2 moving averages (MTF), based on Slop Change or Price Cross. Trend line is green = only longs, red = only shorts.
• Entry Filters
- Volume filter to remove low volume entries
- Overbought/Oversold filters
- Flat market Filter
• Stop Loss and Take Profit
Configure your stop loss and take profit for long and short trades.
You can also make a trailing take profit and trailing stop.
• DCA (Safety orders)
Create up to 100 safety orders with configurable options for step and volume scaling, take profit from total volume, base and safety order size.
• Backtest Settings
Choose a backtest period, longs or shorts, wether to use limit orders or not.
Graphics
A Backtest Results panel with additional information from the strategy tester.
A lightweight mode to remove background plots and make the indicator load faster.
█ ALERTS
The indicator is using the alert() calls: it only uses 1 alert slot to send order messages for each event (Long/Short entry, stop loss, take profit, safety order, exit timer). This means basic-free TV plans can create 1 complete strategy.
To set your alert messages, open the indicator settings and scroll to the bottom of the "inputs" tab.
Create your alert after you set the messages in the indicator settings, and make sure "Any alert() function call" is set in the alert option.
Use placeholders to automatically replace values in your alert messages like price, target profit, order size etc. (see the indicator inputs).
█ BACKTEST RESULTS
The backtest settings can be seen in the 'Properties' tab of the backtest report below.
Please read the author instructions below for access.
Trend Following based on Trend ConfidenceThis is a Trend Following strategy based on the Trend Confidence indicator.
The goal of this strategy is to be a simple Trend Following strategy, but also to be as precise as possible when it comes to the question 'how confident are we that a linear trend is ongoing?'. For this we calculate the 'confidence' of a linear trend in the past number of closing prices. The idea of this strategy is that past a certain confidence, the ongoing linear trend is more likely to continue than not.
Trend Confidence:
The Trend Confidence shows us how strong of a linear trend the price has made in the past number (given by Length parameter) of closing prices. The steepness of the price change makes the Trend Confidence more extreme (more positive for an uptrend or more negative for a downtrend), and the deviation from a straight line makes the Trend Confidence less extreme (brings the confidence closer to 0). This way we can filter out signals by wild/sudden price moves that don't follow a clear linear trend.
Math behind the Trend Confidence:
A linear fit is made on the past number of closing prices, using Ordinary Linear Regression. We have the steepness of the linear fit: b in y=a+bx . And we have the standard deviation of the distances from the closing prices to the linear fit: sd . The Trend Confidence is the ratio b/sd .
Entries and Exits:
For entry and exit points we look at how extreme the Trend Confidence is. The strategy is based on the assumption that past a certain confidence level, the ongoing linear trend is more likely to continue than not.
So when the Trend Confidence passes above the 'Long entry" threshold, we go Long. After that when the Trend Confidence passes under the 'Long exit' threshold, we exit. The Long entry should be a positive value so that we go Long once a linear uptrend with enough confidence has been detected.
When the Trend Confidence passes below the 'Short entry' threshold, we go Short. After that when the Trend Confidence passes above the 'Short exit' threshold, we exit. The Short entry should be a negative value so that we go Short once a linear downtrend with enough confidence has been detected.
Default Parameters:
The strategy is intended for BTC-USD market, 4 hour timeframe. The strategy also works on ETH-USD with similar parameters.
The Length is arbitrarily set at 30, this means we look at the past 30 closing prices to determine a linear trend. Note that changing the length will change the range of Trend Confidence values encountered.
The default entry and exit thresholds for Longs and Shorts do not mirror each other. This is because the BTC-USD market goes up more heavily and more often than it goes down. So the ideal parameters for Longs and Shorts are not the same.
The positive results of the strategy remain when the parameters are slightly changed (robustness check).
The strategy uses 100% equity per trade, but has a 10% stop loss so that a maximum of 10% is risked per trade.
Commission is set at 0.1% as is the highest commission for most crypto exchanges.
Slippage is set at 5 ticks, source for this is theblock.co.
Ichimoku Cloud with MACD and Trailing Stop Loss (by Coinrule)The Ichimoku Cloud is a collection of technical indicators that show support and resistance levels, as well as momentum and trend direction. It does this by taking multiple averages and plotting them on a chart. It also uses these figures to compute a “cloud” that attempts to forecast where the price may find support or resistance in the future.
The Ichimoku Cloud was developed by Goichi Hosoda, a Japanese journalist, and published in the late 1960s. It provides more data points than the standard candlestick chart. While it seems complicated at first glance, those familiar with how to read the charts often find it easy to understand with well-defined trading signals.
The Ichimoku Cloud is composed of five lines or calculations, two of which comprise a cloud where the difference between the two lines is shaded in.
The lines include a nine-period average, a 26-period average, an average of those two averages, a 52-period average, and a lagging closing price line.
The cloud is a key part of the indicator. When the price is below the cloud, the trend is down. When the price is above the cloud, the trend is up.
The above trend signals are strengthened if the cloud is moving in the same direction as the price. For example, during an uptrend, the top of the cloud is moving up, or during a downtrend, the bottom of the cloud is moving down.
The MACD is a trend following momentum indicator and provides identification of short-term trend direction. In this variation it utilises the 12-period as the fast and 26-period as the slow length EMAs, with signal smoothing set at 9.
This strategy combines the Ichimoku Cloud with the MACD indicator to better enter trades.
Long/Exit orders are placed when three basic signals are triggered.
Long Position:
Tenkan-Sen is above the Kijun-Sen
Chikou-Span is above the close of 26 bars ago
Close is above the Kumo Cloud
MACD line crosses over the signal line
Exit Position:
Price increases 3% trailing
Price decreases 3% trailing
The script is backtested from 1 June 2022 and provides good returns.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
SeongMo_MA_V3(Elliot_helper)Made to make it easier to count Elliott waves.
If you renew your new high price, you'll continue your new high price
When the new low is renewed, the new low is continued.
If you are within the range of the previous candle, use the ratio of the difference between the median value of the previous candle and the closing price of the current candle to determine whether to continue the high or low price.
If a can with a tail that updates a new high price and a new low price at the same time comes out, the phrase "Check_candle!" appears to mean that you should check it with a lower time zone candle.
I11L - Reversal Trading Ideas by Larry ConnorsThis is my own Twist on Larry Connors Simple Tradingideas.
It Combines the RSI, Averaging In and the Lowest Bars in a Single System.
The current Configuration is designed for the Daily Timeframe.
Feel free to play with the Parameters and keep in mind that Larry Intended to buy fear and sell the greed!
The Rules are the following:
---Buy---
Buy, if the lowest Bar of your Configuration has been hit (default is set to 7).
---Average Down--
Buy, if the lowest Bar of your Configuration * Your open trades has been hit AND only if the buyin is atleast 1% cheaper.
---Close---
Close, if the RSI closes above a certain level (default is set to 70).
---TP---
There is no TP
---SL---
There is no SL, so be cautions of your tail Risk!
Extended Recursive Bands StrategyThe original indicator was created by alexgrover .
All credit goes to alexgrover for creating the indicator that this strategy uses.
This strategy was posted because there were multiple requests for it, and no strategy based on this indicator exists yet.
The Recursive Bands Indicator, an indicator specially created to be extremely efficient, I think you already know that calculation time is extra important in algorithmic trading, and this is the principal motivation for the creation of the proposed indicator. Originally described in Alex's paper "Pierrefeu, Alex (2019): Recursive Bands - A New Indicator For Technical Analysis", the indicator framework has been widely used in his previous uploaded indicators, however it would have been a shame to not upload it, however user experience being a major concern for me, I decided to add extra options, which explain the term "extended".
The Indicator
The indicator displays one upper and one lower band, every common usages applied to bands indicators such as support/resistance , breakout, trailing stop, etc, can also be applied to this one. Length controls how reactive the bands are, higher values will make the bands cross the price less often.
In order to provide more flexibility for the user alexgrover added the option to use various methods for the calculation of the indicator, therefore the indicator can use the average true range , standard deviation, average high-low range, and one totally exclusive method specially designed for this indicator.
Added logic:
We have implemented a logic that checks whether the bands have been following in the same direction for a set amount of bars. This logic must be true before it can enter trades. This is completely new code that was written by us entirely, and it makes a huge difference on strategy performance.
Strategy Long conditions:
1 — Price low is below the the lower band.
2 — The lower band keeps increasing in value until the 'lookback' setting amount of bars is reached.
Strategy Short conditions:
1 — Price high is above the upper band.
2 — The upper band keeps decreasing in value until the 'lookback' setting amount of bars is reached.
Strategy Properties:
We have set a default commission of 0.06% because these are Bybit's fees. The strategy uses an order size of 10% of equity, since drawdown is very low like this. We also use a 10 tick slippage to keep results realistic and account for this. All other settings were left as default apart from initial capital, just to decrease the size of the numbers.
Bollinger Band strategy with split, limit, stopEntering a short position after breaking the upper Bollinger Band, entering a long position when entering after breaking the lower Bollinger Band
Provides templates for how to display position average price, stop loss, and profit price using the plot function on the chart, and how to buy splits
After entering the position, if the price crosses the mid-band line, the stop loss is adjusted to the mid-band line.
Macro Score -- User-Customized Scores and SignalsA "macro score", as defined here, is created by giving various weights to different signals and adding them together to get one smooth score. Positive or negative values are assigned to each of the signals depending on if the statement is true or false (e.g. DPO > 0: +1, DPO < 0: -1). This manner of strategy allows for a subset of the available signals to be present at one time as opposed to every technical signal having to be active in order for a long/short signal to trigger. This particular strategy allows the user to choose between 18 different signals to be used in scoring as well as allowing the user to determine the individual weights of each score as well as the overall threshold to determine long or short signals. Weights for each score range between 1 and 5, with 5 being the greatest weight. The overall threshold for long or short is dependent on the total possible weights added together (i.e. if your weights total -10 or +10, a threshold within this range must be used).
The macro score itself is printed in an underlay as a white line that goes between the maximum positive and negative values for all weights added together for this strategy. In addition to the macro score line, a green momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score. The length of the Macro Score's momentum line can be found in the settings.
The current signals to choose from include:
- ADX Threshold - if the Average Directional Index is above a set threshold, signal positive or negative
- CMF Threshold - if the Chaikin Money Flow oscillator is above 0, signal positive; otherwise, signal negative
- CMO > TSI Signal - signal positive if there is a cross of the Chande Momentum Oscillator and the True Strength Index signal line
- CMO Threshold - if the Chande Momentum Oscillator is above 0, signal positive; otherwise, signal negative
- DPO Threshold - if the Detrended Price Oscillator is above 0, signal positive; otherwise, signal negative
- EOM Threshold - if the Ease of Money Oscillator is above 0, signal positive; otherwise, signal negative
- Jurik Threshold - if the Jurik price line (from the Jurik Volatility Bands) is above 0, signal positive; otherwise, signal negative
- MACD Threshold - if the MACD signal line is above 0, signal positive; otherwise, signal negative
- McGinley Cross - a crossover of a fast McGinley Dynamic length line and a slow McGinley Dynamic line signals positive; otherwise, signal negative
- PSAR - if the direction of the PSAR is heading long, signal positive; otherwise, signal negative
- ROC Threshold - if the Rate of Change oscillator is above 0, signal positive; otherwise, signal negative
- RSI Threshold - if the Relative Strength Index is above 50, signal positive; otherwise, signal negative
- Stoch RSI Threshold - if the Stoch RSI is above 50, signal positive; otherwise, signal negative
- Supertrend - if the Supertrend determines long, signal positive; otherwise, signal negative
- TSI Cross - a crossover of the True Strength Index value line and the TSI signal line signals positive; otherwise, signal negative
- TSI Signal Threshold - if the TSI signal line is above 0, signal positive; otherwise, signal negative
- Williams Alligator Cross - if the Williams Alligator lips cross the teeth and jaw, signal positive; otherwise, signal negative
- Williams %R - if the Williams %R is above -50, signal positive; otherwise, signal negative
Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.
Profitview Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else.
Sample setup for SOLUSDT 30M:
- Score 1 - Value 4, PSAR (0.05 start, 0.02 increment, 0.2 max value; sourced open)
- Score 2 - Value 4, Jurik Threshold (JVB Length 25, JVB Smoothing 6, JVB Price Threshold 0)
- Score 3 - Value 5, DPO Threshold (DPO Length 40, uncentered)
- Score 4 - Value 5, CMO Threshold (CMO Length 40, sourced open)
- Score 5 - Value 2, MACD Threshold (Fast Length 12, Slow Length 30, sourced open)
- Macro Length 21
- Long Threshold - -3
- Short Threshold - +3
- Take Profit % - 0.9/0.9
- Trail % - 0.005
- Stop Loss % - 1.4
Sample setup for AVAXUSDT 20M:
- Score 1 - Value 3, TSI Cross (Long Length 25, Short Length 16, Signal Length 17)
- Score 2 - Value 2, TSI Signal Threshold (same settings as the TSI Cross)
- Score 3 - Value 2, Jurik Threshold (JVB Length 20, JVB Smoothing 8, JVB Price Threshold 0)
- Score 4 - Value 2, DPO Threshold (DPO Length 40, uncentered)
- Score 5 - Value 1, Stoch Threshold (K/D 3, RSI (Stoch) Length 10, Stochastic Length 4, sourced open)
- Macro Length 13
- Long Threshold - +5
- Short Threshold - -5
- Take Profit % - 1.2/1.2
- Trail % - 0.005
- Stop Loss % - 1.5
Macro Score - TSI-BasedA "macro score", as defined here, is created by giving various weights to different signals and adding them together to get one smooth score. Positive or negative values are assigned to each of the signals depending on if the statement is true or false (e.g. DPO > 0: +1, DPO < 0: -1). This manner of strategy allows for a subset of the available signals to be present at one time as opposed to every technical signal having to be active in order for a long/short signal to trigger.
This strategy has the signals and weights pre-determined in the code. Heaviest weights have been given to various TSI (True Strength Index) signals, including a crossover/crossunder of TSI signal and TSI value, a threshold for the TSI Signal (above or below 0), and a crossover/crossunder of the CMO (Chande Momentum Oscillator) and the TSI signal line. Additionally, there are thresholds for DPO (Detrended Price Oscillator, above or below 0), Jurik Volatility Bands (above or below 0), and Stoch RSI (above or below 50). These three signals hold a lighter weight than the three TSI signals.
The macro score itself is printed in an underlay as a white line that goes between -10 and 10 for this strategy. In addition to the macro score line, a red momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score (-6/6).
Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.
Profitview Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else.
Cipher_B (Finandy support)In this version of the script you can force to cancel your position after some amount of time indepedently on price action. For example, your bot open a short position with SL=1% and TP=2.4% but price did not reach any of this level over the course of to say 8 hours. In this case, position will be closed regardless of the price.
Other interesting features are volume and slope filters. Slope is essentially a derivative of price action. If you don't like to buy your instrument under high volatility, for example, if a trend goes down too fast then you can filter long position which could be opened according to the strategy. Same thing for volume filter. If the volume is too high/too low, you might want to escape such setup in your trading strategy.
Moreover, you can tune price shift for opening position. To say, if you believe that the signal for opening position comes too early everytime, you can force the strategy to buy at 1% lower price than the current price when the signal comes. Similar logic for short: open position price will be always higher than the price of the signal. If the price did not reach such level then position will be automatically cancel with a new signal arrival. Check the backtesting results to understand better the logic.
ILDA FINALY_BOT_V1conversionPeriods = input.int(9, minval=1, title="Conversion Line Length")
basePeriods = input.int(26, minval=1, title="Base Line Length")
laggingSpan2Periods = input.int(52, minval=1, title="Leading Span B Length")
displacement = input.int(26, minval=1, title="Lagging Span")
donchian ( len ) => math. avg (ta.lowest( len ), ta.highest( len ))
conversionLine = donchian (conversionPeriods)
baseLine = donchian (basePeriods)
leadLine1 = math. avg (conversionLine, baseLine)
leadLine2 = donchian (laggingSpan2Periods)
plot(conversionLine, color=#2962FF, title="Conversion Line")
plot(baseLine, color=#B71C1C, title="Base Line")
plot(close, offset = -displacement + 1, color=#43A047, title="Lagging Span")
p1 = plot(leadLine1, offset = displacement - 1, color=#A5D6A7,
title="Leading Span A")
p2 = plot(leadLine2, offset = displacement - 1, color=#EF9A9A,
title="Leading Span B")
plot(leadLine1 > leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Upper Line", display = display.none)
plot(leadLine1 < leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Lower Line", display = display.none)
fill(p1, p2, color = leadLine1 > leadLine2 ? color. rgb (67, 160, 71, 90) : color. rgb (244, 67, 54, 90))
ILDA FINALY_BOTconversionPeriods = input.int(9, minval=1, title="Conversion Line Length")
basePeriods = input.int(26, minval=1, title="Base Line Length")
laggingSpan2Periods = input.int(52, minval=1, title="Leading Span B Length")
displacement = input.int(26, minval=1, title="Lagging Span")
donchian(len) => math.avg(ta.lowest(len), ta.highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = math.avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
plot(conversionLine, color=#2962FF, title="Conversion Line")
plot(baseLine, color=#B71C1C, title="Base Line")
plot(close, offset = -displacement + 1, color=#43A047, title="Lagging Span")
p1 = plot(leadLine1, offset = displacement - 1, color=#A5D6A7,
title="Leading Span A")
p2 = plot(leadLine2, offset = displacement - 1, color=#EF9A9A,
title="Leading Span B")
plot(leadLine1 > leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Upper Line", display = display.none)
plot(leadLine1 < leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Lower Line", display = display.none)
fill(p1, p2, color = leadLine1 > leadLine2 ? color.rgb(67, 160, 71, 90) : color.rgb(244, 67, 54, 90))