MTF DPO-RSI IndicatorThis indicator uses the principle of taking the RSI of DPO readings across multiple time frames in order to provide trade signals and an overarching view of market conditions to the trader. My hope with creating this indicator was to present more divergence based signals than your typical indicator, while still keeping those signals at a high quality.
In the settings menu, you may specify:
Indicator Timeframe - the chart resolution that is used to calculate values.
Source DPO Length - the number of bars used to calculate the Detrended Price Oscillator value. The DPO value is the source for the RSI calculations.
DPO Hull Smoothing - how much smoothing is applied to the DPO . Smoothing is accomplished by taking a Hull Moving Average of the closing price, and using this to calculate the DPO value.
RSI Length - the number of bars used to calculate the RSI of the DPO value.
Time Multipliers 1 through 6 - use this to define what resolution each plot will represent. A value of 1 will represent the current Indicator Timeframe. A value of 3 will represent 3 times the current Indicator Timeframe, etc.
Show Plot 1 through 6 - toggles the display of plots.
How I trade with this indicator:
A value of under 30 represents an over sold state for that particular plot. A value of over 70 represents an overbought state for that plot.
Identify divergences on a lower timeframe plot which are apparent in overbought or oversold conditions, and confirm the signal with an overbought or oversold condition, or a divergence on a higher timeframe plot. Divergences which begin in oversold or overbought territory and end inside the 30-70 range tend to be more reliable signals, in my experience. Like all indicators, this is best when used in conjunction with other indicators. Trend indicators, such as double EMA's and Supertrend are my favorite pairing, and a stochastic RSI is a good tool to have as well.
This is my first published indicator! If you find unique ways to use it, drop me a message. I'd love to know what you find. :)
Cari dalam skrip untuk "supertrend"
Divergence-Support/ResistenceAnother script based on zigzag, divergence, and to yield support and resistence levels.
This idea started with below two concepts:
โถ Support and resistence are simply levels where price has rejected to go further down or up. Usually, we can derive this based on pivots. But, if we start looking at every pivot, there will be many of them and may be confusing to understand which one to consider.
โถ Lot of people asked about one of my previous script on divergence detector on how to use it. I believe divergence should be considered as area of support and resistence because, they only amount to temporary weakness in momentum and nothing more. As per my understanding
Trend > Hidden Divergence > Divergence > Oscillator Levels of Overbought and Oversold
โฌ Process
โถ Now combining the above two concepts - what we are trying to do here is draw support resistence lines only on pivots which has observed either divergence or hidden divergence. Continuation and indecision pivots are ignored.
โถ Input requires only few parameters.
Zigzag lengths and oscillator to be used. Oscillator periods are automatically calculated based on zigzag length. Hence no other information required. You can also chose custom oscillator via external source.
โถ Display include horizontal lines of support/resistence which are drawn from the candle from where divergence or hidden divergence is detected.
โถ Support resistence lines are colored based on divergence. Green shades for bullish divergence and bullish hidden divergence whereas red shades for bearish divervence and bearish hidden divergence. Please note, red and green lines does not mean they only provide resistence or support. Any lines which are below the price should be treated as support and any line which are above the price should be treated as resistence.
โถ Divergence symbols are also printed on the bar from where divergence/hidden divergence is detected.
โ - Bullish Hidden Divergence
โ - Bearish Hidden Divergence
โคด - Bullish Divergence
โคต - Bearish Divergence
โถ Script also demonstrates usage of libraries effectively. I have used following libraries in this code.
import HeWhoMustNotBeNamed/โzigzagโ/2 as โzgโ
import HeWhoMustNotBeNamed/enhanced_ta/8 as eta
import HeWhoMustNotBeNamed/โsupertrendโ/4 as st
Can be good combination to use it with harmonic patterns.
True BarcolorHeikin Ashi can be useful for understanding trend based on price action but it doesn't take volume in context. Here I have tried to use volume for understanding true bar color and ultimately true trend analysis. It can also help you in not getting trapped in sudden shakeouts. Also, you can use it for averaging of your existing position.
Conditions used:
Relative closing price
Relative volume against previous bar and overall moving average of volume
Volume analysis
Trend analysis
CHAMELEON TRAILA filter combining the built in supertrend function and two SMA's in order to act as a filter for trade ideas put forward by CHAMELEON which can be placed in a separate panel.
This is not accurate enough to use on its own as a signal, but helps filter out more complex ideas. To be most effective it is recommended to set the LENGTH correctly.
Includes ALERT CONDITION's for when the TRAIL is UP, DOWN or MIXED.
Multi-ZigZag Multi-Oscillator Trend DetectorThis table is intended to give you snapshot of how price and oscillators are moving along with zigzag pivots.
This is done in the same lines of Zigzag-Trend-Divergence-Detector
But, here are the differences
Table shows multiple oscillator movements at a same time instead of one selected oscillator
Divergence is not calculated and also supertrend based trend. Trend can be calculated based on zigzag movements. However, lets keep this for future enhancements.
This system also uses multiple zigzags instead of just one.
โฌ Process
โถ Derive multiple zigzags - Code is taken from Multi-ZigZag
โถ Along with zigzags - also calculate different oscillators and attach it to zigzag pivot.
โถ Calculate directions of zigzag pivots and corresponding oscillators.
โถ Plot everything in the table on last bar.
โฌ Table components
Table contains following data:
Directional legends are:
โ - Higher High (Green)
โ - Lower Low (Red)
โญก- Lower High (Orange)
โญฃ - Higher Low (Lime)
โฌ Input Parameters
โถ Source : Default is close. If Unchecked - uses high/low data for calculating pivots. Can also use external input such as OBV
โถ Stats : Gives option to select the depth of output (History) and also lets you chose text size and table position.
โถ Oscillators : Oscillator length is derived by multiplying multiplier to zigzag length. For example, for zigzag 5, with 4 as multiplier, all oscillators are calculated with length 20. But, same for zigzag 8 will be 32 and so on.
โถ Available oscillators :
CCI - Commodity Channel Index
CMO - Chande Momentum Oscillator
COG - Center Of Gravity
MFI - Money Flow Index (Shows only if volume is present)
MOM - Momentum oscillator
ROC - Rate Of Change
RSI - Relative Strength Index
TSI - Total Strength Index
WPR - William Percent R
BB - Bollinger Percent B
KC - Keltner Channel Percent K
DC - Donchian Channel Percent D
ADC - Adoptive Donchian Channel Percent D ( Adoptive-Donchian-Channel )
โฌ Challenges
There are 12 oscillators and each zigzag has different length. Which means, there are 48 combinations of the ocillators.
First challenge was generating these values without creating lots of static initialization. Also, note, if the functions are not called on each bar, then they will not yield correct result. This is achieved through initializer function which runs on every bar and stores the oscillator values in an array which emulates multi dimensional array oscillator X zigzag length.
Next challenge was getting these values within function when we need it. While doing so I realized that values stored in array also have historical series and calling array.get will actully get you the entire series and not just the value. This is an important takeaway for me and this can be used for further complex implementations.
Thanks to @LonesomeTheBlue and @LucF for some timely suggestions and interesting technical discussions :)
Keltner Center Of Gravity Channel ( KeltCOG )I have the ambition to create a โlandscapeโ which enables the user to see the โmoodโ of the market about the price of an instrument, simply by looking where the candles go. Prices are a simple phenomenon , they go up or down or stay the same. This is represented quite well for the short term by a candle. I recommend to study candle patterns. Prices not only fluctuate but also trend up, down or go sideways. The user should analyze this by determining the COG (Center Of Gravity) and the โnormalโ current range by using the historical data in a lookback period.
As a COG the center line of a Donchian Channel is often used. I.m.o. a COG should be a zone, in this channel I use the gray zone of my Donchian Fibonacci Channel, The โnormalโ range is a multiple of Average True Range, as used in a Keltner Channel. Combining the two can give a cumbersome result, as one can see in my Keltner Fibonacci Channel. In this KeltCOG channel I solved this by not using all Fibonacci levels and by making the Keltner lines strictly parallel to the nearest COG line. To do this, I use the fact that the COG lines have horizontal stretches, there I make the Keltner lines horizontal too. Only where the COG lines change value, the Keltner lines are recalculated. This way the channel gets a very regular shape with three clear zones.
Interpretation of a chart by using the KeltCOG channel.
Overbought: If the candles go higher then the blue zone, the market is hyper enthusiast, creating an overbought situation. This is often followed by a reversion to the COG.
Uptrend: If the candles form in the blue zone, the market is enthusiast and willing to pay more.
Hopeful: If the candles form in or near the upper uncolored zone, the market is hopeful and is thinking about paying more. Sometimes prices go a little up.
Content: If the candles form in the gray zone, which represents COG, the market is happy with the current prices, so these move sideways
Disappointed: If the candles form in or near the lower uncolored zone, the market is disappointed and contemplates paying less, sometimes prices go a little down.
Downtrend: If the candles form in red zone, the market doesnโt like the instrument at all, rejects the current price and is only prepared to pay less.
Oversold: If the candles form below the red zone, the market overdoes its disgust, creating an oversold situation, often followed by a reversion to the COG.
CCI 5 LEVELS BY MOADThe Commodity Channel Index ( CCI ) is a momentum oscillator used in technical analysis primarily to identify overbought and oversold levels by measuring an instrument's variations away from its statistical mean. Besides overbought/oversold levels, CCI is often used to find reversals as well as divergences. Originally, the indicator was designed to be used for identifying trends in commodities , however it is now used in a wide range of financial instruments.
There are several steps involved in calculating the CCI . The following example is for a typical 14 Period CCI:
CCI = (Typical Price - 14 Period SMA of TP) / (.015 x Mean Deviation)
Typical Price (TP) = (High + Low + Close)/3
Constant = .015
The Constant is set at .015 for scaling purposes. By including the constant, the majority of CCI values will fall within the 100 to -100 range.
Mean Deviation:
1) Subtract the most recent 14 Period Simple Moving from each typical price (TP) for the Period.
2) Sum these numbers strictly using absolute values.
3) Divide the value generated in step 2 by the total number of Periods (14 in this case).
Overbought and Oversold conditions can be used in their more traditional sense to identify future reversals. Remember true overbought/oversold thresholds values can and often do vary between instruments.
During a Bullish Trend, price crossing above the overbought threshold may indicate strong confidence in the move and price will continue to rise.
During a Bearish Trend, price crossing below the oversold threshold may indicate strong confidence in the move and price will continue to fall.
The first option is a modified CCI indicator that uses the "Arnaud Legoux Moving Average" instead of the SMA , and the source uses the VWAP instead of the HLC3. Added to this version an option to calculate CCI with different types of moving averages:
Green dots mean they are overbought
Orange dots mean they are oversold
Added a "SuperTrend Background" based on the modified CCI indicator:
Bull event = CCI crossing over the 0 line
Bear event = CCI crossing below the 0 line
Added a signal as EMA (modified CCI , signal length)
The second option is a standard CCI indicator that shows a coloured histogram of important levels, giving a good visual of the CCI levels. Added to this version is an extra coloured level +/-200 and an option to use Traditional CCI calculations according to user @JustUncleL
LEVELS:
Aqua: Greater than 200.
Lavender: Greater than 100 and less than 200.
Dark Lavender: Greater than 0 and less than 100.
Dark Coral: Less than 0 and greater than -100.
Coral: Less than -100 and greater than -200.
Light Red: Less than -200.
Zigzag Candles MAWe have the candles here: Zigzag-Candles
Lets create moving average!!
Just simple moving average at the moment. Since, items are in array. Not so easy to use standard functions of pine. Hence, will take that for future enhancements.
ATR and Supertrend next!!
Zigzag CandlesCan't deny that I am obsessed with zigzags. Been doing some crazy experiments with it and have many more in pipeline. I believe zigzag can be used to derive better trend following methods. Here is an attempt to visualize zigzag as candlesticks. Next steps probably to derive moving average, atr (although there was an attempt of AZR made earlier) and probably supertrend too ;)
Input parameters include ZigzagLength (to calculate zigzag) and CandleSize (number of zigzag pivots in each candle)
CandleSize can be 3 or more. Every time we collect pivots which are equal to CandleSize, we derive one candle. And when we derive a candle, we remove all old pivots except the last one. Becauase, the last pivot acts as open to the next bar and is required.
Body of the candle tells the start and end zigzag pivot in the range. And Wicks signify highest and lowest pivots in the range. High and Low wicks are placed at the pivot where high and lows are formed. Hence, you can see them at different positions each time.
Thanks to @RicardoSantos for suggesting boxes for candles - while I was trying to achieve this with plotbar
[VJ] Mega Supertrend for IntradayThis is a simple intraday strategy for working on Stocks or commodities based out on Super Trend and intraday's best friend - VWAP . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy: Tweaked Super trend with VWAP
Indicators used :
Super trend is simple and easy to use indicator and gives a precise reading about an on going trend.It is built with two parameters, namely period and multiplier.The Buy and Sell signal modifies once the indicator tosses over the closing price. When the Super trend closes above the Price, a Buy signal is generated, and when the Super trend closes below the Price, a Sell signal is generated. In this case we use it only for direction .
Multiplier is a vital input for Super trend. If the multiplier value is too high, then lesser number of signals is made.
Volume is important as we donโt want to get stuck with a stock which has few takers, even if you think it is priced attractively. Thus, the VWAP was created to take into account both volume as well as Price so that the potential trader would make the trading decision or not.
In simple terms, the Volume Weighted Average price is the cumulative average price with respect to the volume
Buying/Selling
when the closing price starts moving up/down and farther from the VWAP, there is pressure among the traders to sell/buy, a general belief kicks in that it might be that the stock is overvalued/undervalued .This is the time when we couple the Super trend to take our entries
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
ST multiplier : 3
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
[VJ] Hulk Smash IntraThis is a simple intraday strategy for working on Stocks or commodities based out on Super Trend and ever reliable ADX . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy: Supertrend and ADX strength (Hulk Smash)
Indicators used :
Super trend is simple and easy to use indicator and gives a precise reading about an on going trend.It is built with two parameters, namely period and multiplier.The Buy and Sell signal modifies once the indicator tosses over the closing price. When the Super trend closes above the Price, a Buy signal is generated, and when the Super trend closes below the Price, a Sell signal is generated. In this case we use it only for direction .
ADX informs a trader when the market is trending.It filters out anti trend trades to help trend chasing indicators from frequent whipsaws
Multiplier is a vital input for Super trend. If the multiplier value is too high, then lesser number of signals is made.
Buying/Selling
โข If the price is going UP, and the ADX indicator is also going UP, then we have the case for a bullish trend.
โข The same is true if the price is going down and the ADX indicator is going UP. Then we have the case for a bearish trend.
โข Value of ADX below 20 is called trading zone which implies non-trending market
โข Trade with Strength only if the Super trend is validating
ADX Values
0 - 20 : Non Trending (Range bound market, phase of Accumulation/Distribution)
20-45 : Strong Signal (helpful for traders)
45-60 : Very strong trend (occur rarely, indicate exhaustion)
60 - 100 : Extremely strong trend (very rare, unsustainable trends, be ready for reversals)
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
ADX Factor : vary as per info above
ST multiplier : 3
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
Strategy TemplateTrying to include few basic things which is needed for strategy which can be used as template.
Few important components
Strategy parameters
Few important parameters include - initial_capital, default_qty_type, default_qty_value, commission_type, pyramiding and commission_value. All my strategies will have similar settings with initial captial set to 20000 to 100000. 100% of equity per trade with no pyramiding (set to 1) and minimal commission.
margin_long and margin_short can be used for leveraged trading. But, since we are not using pyramiding, it will make no effect.
Trade Limiting parameters
Two types of limiting is available in the scripts
Limiting trading direction : this is done through method strategy.risk.allow_entry_in and input parameter tradeDirection
Limiting trades to particular time window : This is achieved through adding start time and end time parameters of type input.time and check whether time is within this window
Custom Methods
customized security method to get higher timeframe data
customized moving average method to get moving average of any type
Custom Parameters
Moving average Type option list which I use quite often. Any strategy where there is need to use moving average, I try to scan through different moving average types and lengths to see which one is more appropriate for the given strategy. Hence, keeping this parameter in template to make it readily available when I start with new strategy
waitForCloseBeforeExit - this is used if trailing stop need to activated as soon as price hits the stop or only on close price. This is again something I switch quite often based on strategy. Hence, keeping this as part of the template.
Entry and Exit statements for long and short
These statements from line (57 to 62) can remain as is even with new strategy. Only thing to be set are variables - buyCondition, sellCondition, closeBuyCondition and closeSellCondition
Last but not the least
In pinescript, a long and short position cannot coexist in a strategy at any point of time. Any short positions created will automatically stop long positions and vice versa. Hence, it is important make short and long trades mutually exclusive. In this example, I have used 200 weekly moving average as trend bias. No short positions are taken when price is trading above 200 weekly moving average low/close and no long positions are taken when price is less than 200 weekly moving average high/close. Any rule built on top of this (In this case a simple supertrend rules) ensures that there are no conflicting signals and hence avoids confusing trades on the stratgy.
Trend ExplorerAre we in a bull or a bear market?
From the technical analysis point of view, the answer is "It depends". It depends from the parameters of your indicator, the timeframe of the pair you are looking and the volatility of that specific market you are looking to.
After I experimented with various trending indicators I decided to develop a framework that potentially could "embed" already existing logic from well known indicators (e.g. Supertrend OTT etc.).
The most important part is that I managed to abstract that logic away and experiment even further to produce some more robust, market and timeframe resolution agnostic results. While at the same time I was able to switch between market and timeframe resolution specific configuration to take some decision.
Finally, I decided to share this code with you folks! Developed this indicator "Trend Explorer" in an effort to make the aforementioned abstraction of all those trending indicators.
The goal is to enable the user to explore and combine different approaches in order to create a more robust and market general/specific, timeframe resolution invariant/fluctuating and volatility auto/manual adjusted indicator according to his needs.
The logic behind the abstraction is fairly simple. The trending indicator consists of two boundary lines the "bull trend low boundary" (green) and the "bear trend high boundary" (red). The indicator also has a control line (orange). Every time the control line crosses a boundary there is a trend reversal! The boundary lines are defined by the thresholds. To be more precise, boundaries are pulled upwards by thresholds (blue) during a bull market and downwards during a bear market. I challenge the user to experiment with the different ways of calculating the thresholds and the control. I am open to suggestions that might improve and extend the possibilities of this indicator. Any feedback, comments, general thoughts or bug reports are welcome.
Why did I chose those defaults?
For threshold calculation I chose MINMAX which calculates the local minimum and maximum using a sliding window. As far as I know it is not used in any existing trending indicator, but it seems reasonable for a trader to search for local min and max to make a decision. The width of the sliding window a.k.a the "period to remember" the local min and max is 30 days by default, just because I believe that for regular people it is a reasonable period of time to forget too.
Also, compared to the SUBADD method MINMAX does not seem to lag behind, especially when using averages in the SUBADD mode. Moreover, I consider MINMAX to be more general than the margins used by the SUBADD since margins should be configured based on the underlying market volatility.
For a source of min and max I chose the low and high values just because they are timeframe resolution invariant, meaning that they have the same (not exactly due to number precision and rounding, but very close) results for a single pair whether you use "4 hour" or "1 day" time interval! Another popular choice might be (close, close) since many traders wait for the daily candle to close in order to discard outliers. However, this approach is not resolution invariant and it depends from the time interval the user has selected.
Do you have any interesting trending indicator you would like to see how it performs in this framework logic? Let me know!
Do you have in mind any variation of Control or Thresholds calculation you would like to test? Please describe it in the comments below so I can add it in my implementation for you!
Did you find any other bug or you experienced any strange behavior? PM me with a description of the bug, the trading pair the timeframe resolution the exact time (candle) and all the necessary configurations for this indicator so I can reproduce it on my machine!
Please enjoy with caution,
Jason
Portfolio Backtester Engineโโ OVERVIEW
Portfolio Backtester Engine (PBTE). This tool will allow you to backtest strategies across multiple securities at once. Allowing you to easier understand if your strategy is robust. If you are familiar with the PineCoders backtesting engine , then you will find this indicator pleasant to work with as it is an adaptation based on that work. Much of the functionality has been kept the same, or enhanced, with some minor adjustments I made on the account of creating a more subjectively intuitive tool.
โโ HISTORY
The original purpose of the backtesting engine (`BTE`) was to bridge the gap between strategies and studies . Previously, strategies did not contain the ability to send alerts, but were necessary for backtesting. Studies on the other hand were necessary for sending alerts, but could not provide backtesting results . Often, traders would have to manage two separate Pine scripts to take advantage of each feature, this was less than ideal.
The `BTE` published by PineCoders offered a solution to this issue by generating backtesting results under the context of a study(). This allowed traders to backtest their strategy and simultaneously generate alerts for automated trading, thus eliminating the need for a separate strategy() script (though, even converting the engine to a strategy was made simple by the PineCoders!).
Fast forward a couple years and PineScript evolved beyond these issues and alerts were introduced into strategies. The BTE was not quite as necessary anymore, but is still extremely useful as it contains extra features and data not found under the strategy() context. Below is an excerpt of features contained by the BTE:
"""
More than `40` built-in strategies,
Customizable components,
Coupling with your own external indicator,
Simple conversion from Study to Strategy modes,
Post-Exit analysis to search for alternate trade outcomes,
Use of the Data Window to show detailed bar by bar trade information and global statistics, including some not provided by TV backtesting,
Plotting of reminders and generation of alerts on in-trade events.
"""
Before I go any further, I want to be clear that the BTE is STILL a good tool and it is STILL very useful. The Portfolio Backtesting Engine I am introducing is only a tangental advancement and not to be confused as a replacement, this tool would not have been possible without the `BTE`.
โโ THE PROBLEM
Most strategies built in Pine are limited by one thing. Data. Backtesting should be a rigorous process and researchers should examine the performance of their strategy across all market regimes; that includes, bullish and bearish markets, ranging markets, low volatility and high volatility. Depending on your TV subscription The Pine Engine is limited to 5k-20k historical bars available for backtesting, which can often leave the strategy results wanting. As a general rule of thumb, strategies should be tested across a quantity of historical bars which will allow for at least 100 trades. In many cases, the lack of historical bars available for backtesting and frequency of the strategy signals produces less than 100 trades, rendering your strategy results inconclusive.
โโ THE SOLUTION
In order to be confident that we have a robust strategy we must test it across all market regimes and we must have over 100 trades. To do this effectively, researchers can use the Portfolio Backtesting Engine (PBTE).
By testing a strategy across a carefully selected portfolio of securities, researchers can now gather 5k-20k historical bars per security! Currently, the PTBE allows up to 5 securities, which amounts to 25k-100k historical bars.
โโ HOW TO USE
1 โ Add the indicator to your chart.
โโข Confirm inputs. These will be the most important initial values which you can change later by clicking the gear icon โ and opening up the settings of the indicator.
2 โ Select a portfolio.
โโข You will want to spend some time carefully selecting a portfolio of securities.
โโโโข Each security should be uncorrelated.
โโโโข The entire portfolio should contain a mix of different market regimes.
โโโ You should understand that strategies generally take advantage of one particular type of market regime. (trending, ranging, low/high volatility)
โโโFor example, the default RSI strategy is typically advantageous during ranging markets, whereas a typical moving average crossover strategy is advantageous in trending markets.
โโโIf you were to use the standard RSI strategy during a trending market, you might be selling when you should be buying.
โโโSimilarily, if you use an SMA crossover during a ranging market, you will find that the MA's may produce many false signals.
โโโEven if you build a strategy that is designed to be used only in a trending market, it is still best to select a portfolio of all market regimes
โโโas you will be able to test how your strategy will perform when the market does something unexpected.
3 โ Test a built-in strategy or add your own.
โโโโข Navigate to gear icon โ (settings) of strategy.
โโโโข Choose your options.
โโโโโโโข Select a Main Entry Strat and Alternate Entry Strat .
โโโโโโโโโโข If you want to add your own strategy, you will need to modify the source code and follow the built-in example.
โโโโโโโโโโข You will only need to generate (buy 1 / sell -1/ neutral 0) signals.
โโโโโโโข Select a Filter , by default these are all off.
โโโโโโโข Select an Entry Stop - This will be your stop loss placed at the trade entry.
โโโโโโโข Select Pyamiding - This will allow you to stack positions. By default this is off.
โโโโโโโข Select Hard Exits - You can also think of these as Take Profits.
โโโโข Let the strategy run and take note of the display tables results.
โโโโโโโข Portfolio - Shows each security.
โโโโโโโโโโข The strategy runs on each asset in your portfolio.
โโโโโโโโโโข The initial capital is equally distributed across each security.
โโโโโโโโโโSo if you have 5 securities and a starting capital of 100,000$ then each security will run the strategy starting with 20,000$
โโโโโโโโโ The total row will aggregate the results on a bar by bar basis showing the total results of your initial capital.
โโโโโโโข Net Profit (NP) - Shows profitability.
โโโโโโโข Number of Trades (#T) - Shows # of trades taken during backtesting period.
โโโโโโโโโโข Typically will want to see this number greater than 100 on the "Total" row.
โโโโโโโข Average Trade Length (ATL) - Shows average # of days in a trade.
โโโโโโโข Maximum Drawdown (MD ) - Max peak-to-valley equity drawdown during backtesting period.
โโโโโโโโโโข This number defines the minimum amount of capital required to trade the system.
โโโโโโโโโโข Typically, this shouldnโt be lower than 34% and we will want to allow for at least 50% beyond this number.
โโโโโโโข Maximum Loss (ML) - Shows largest loss experienced on a per-trade basis.
โโโโโโโโโโข Normally, donโt want to exceed more than 1-2 % of equity.
โโโโโโโข Maximum Drawdown Duration (MDD) - The longest duration of a drawdown in equity prior to a new equity peak.
โโโโโโโโโโข This number is important to help us psychologically understand how long we can expect to wait for a new peak in account equity.
โโโโโโโข Maximum Consecutive Losses (MCL) - The max consecutive losses endured throughout the backtesting period.
โโโโโโโโโโข Another important metric for trader psychology, this will help you understand how many losses you should be prepared to handle.
โโโโโโโข Profit to Maximum Drawdown (P:MD) - A ratio for the average profit to the maximum drawdown.
โโโโโโโโโโข The higher the ratio is, the better. Large profits and small losses contribute to a good PMD.
โโโโโโโโโโข This metric allows us to examine the profit with respect to risk.
โโโโโโโข Profit Loss Ratio (P:L) - Average profit over the average loss.
โโโโโโโโโโข Typically this number should be higher in trend following systems.
โโโโโโโโโโข Mean reversion systems show lower values, but compensate with a better win %.
โโโโโโโข Percent Winners (% W) - The percentage of winning trades.
โโโโโโโโโโข Trend systems will usually have lower win percentages, since statistically the market is only trending roughly 30% of the time.
โโโโโโโโโโข Mean reversion systems typically should have a high % W.
โโโโโโโข Time Percentage (Time %) - The amount of time that the system has an open position.
โโโโโโโโโโข The more time you are in the market, the more you are exposed to market risk, not to mention you could be using that money for something else right?
โโโโโโโข Return on Investment (ROI) - Your Net Profit over your initial investment, represented as a percentage.
โโโโโโโโโโข You want this number to be positive and high.
โโโโโโโข Open Profit (OP) - If the strategy has any open positions, the floating value will be represented here.
โโโโโโโข Trading Days (TD) - An important metric showing how many days the strategy was active.
โโโโโโโโโโข This is good to know and will be valuable in understanding how long you will need to run this strategy in order to achieve results.
โโ FEATURES
These are additional features that extend the original `BTE` features.
- Portfolio backtesting.
- Color coded performance results.
- Circuit Breakers that will stop trading.
- Position reversals on exit. (Simulating the function of always in the market. Similar to strategy.entry functionality)
- Whipsaw Filter
- Moving Average Filter
- Minimum Change Filter
- % Gain Equity Exit
- Popular strategies, (MACD, MA cross, supertrend)
Below are features that were excluded from the original `BTE`
- 2 stage in-trade stops with kick-in rules (This was a subjective decision to remove. I found it to be complex and thwarted my use of the `BTE` for some time.)
- Simple conversion from Study to Strategy modes. (Not possible with multiple securities)
- Coupling with your own external indicator (Not really practical to use with multiple securities, but could be used if signals were generated based on some indicator which was not based on the current chart)
- Use of the Data Window to show detailed bar by bar trade information and global statistics.
- Post Exit Analysis.
- Plotting of reminders and generation of alerts on in-trade events.
- Alerts (These may be added in the future by request when I find the time.)
โโ THANKS
The whole PineCoders team for all their shared knowledge and original publication of the BTE and Richard Weismann for his ideas on building robust strategies.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PMax on Rsi w/T3 *Strategy*Profit Maximizer Indicator on RSI with Tillson T3 Moving Average:
PMax uses ATR calculation inside, for this reason users couldn't manage to use PMax on RSI because RSI indicator doesn't have High and Low values in bars, but ATR needs that values. So I personally calculate RSI in a different way to have High and Low values of RSI wrt price bars.
IMPORTANT:
Because of the sudden movements and divergences on RSI , this indicator must firstly optimized for the charts before using. Optimization can be held by users for the meaningful parameters for each chart.
3 parameters are critical when optimizing:
First: Multiplier
Second: Tillson T3 Length
Third: T3 Volume Factor
Says, Kฤฑvanรง รzbilgiรง. Here's the strategy version for you to backtest & optimize properly.
Enjoy.
Atrend by OTSAtrend is a indiactor used to identify long and short term trends it uses MACD, RSI, ATR, and a DEMA along with some pieces from supertrend, the indicator works good on 1-4 hour time frame
Hopper Trigger - Free Cryptohopper WidgetWelcome to our Tradingview cryptohopper trigger widget.
We designed this script to give Cryptohopper users the possibility to set up an alarm when btc is trending down. Cause of the BTCs behavior as the supertrend coin for the market it is better to turn your hopper off or be extremly careful when BTC is trending down. We implemented to types of alarms, because atm its not possible to automate using them to deactivate your hopper. On Alarm setup could be used to send signals every minute to trigger a push notification on your App or to trigger your Alexa. The other type of alarm only sends one single signal for normal purposes.
We recommend using this indicator in the 30 minute or 1 hour timeframe and to deactivate your hopper and deleting all positions when a alarm is signaling. The risk of a larger drop is very high in this marketphase. Never take an drop again using this approach. Little drawdown in bearish or ranging times but high reward in bullish times.
Smartgrow-Trading is a community project with the aim of developing the best and most successful trading strategies and sharing them with the community.
The basic idea of this script is to calculate how far an coin is away from its ATH , to gave warning signals for deactivating coins after they reached there ATH . So it could also be used for other coins and pairs.
If there are questions, write them into the comments or contact us directly over the direct message or social media. Happy Trading!
All Time High Warning - Free Cryptohopper WidgetWelcome to our Tradingview coin prediction filter.
We designed this script to give Cryptohopper users the possibility to set up an alarm when btc is close to All Time High. Cause of the BTCs behavior as the supertrend coin for the market it is better to turn your hopper off or be extremly careful when BTC is close to ATH.
We recommend deactivating the hopper and deleting all positions. The risk of a larger drop is very high in this marketphase.
Smartgrow-Trading is a community project with the aim of developing the best and most successful trading strategies and sharing them with the community.
The basic idea of this script is to calculate how far an coin is away from its ATH, to gave warning signals for deactivating coins after they reached there ATH. So it could also be used for other coins and pairs.
If there are questions, write them into the comments or contact us directly over the direct message or social media. Happy Trading!
RedK_Larry William's TrendI'm not the author of this indicator or the concept behind it
i found this code - written for another platform - while researching "Larry William's Trend" - while i also couldn't find that specific keyword in the TV public library. So thought to bring this in.
Also unfortunately there was no coder details to give credit to with the code i found. it seems this may somehow be related to the famous SuperTrend - but i have no idea how they are connected. i simply ported this to Pine in my own way.
will be happy if this is useful to some traders who use these types of trend indicators. if you do find it useful, pls leave a comment here - or feel free to take this code and modify it in any further way for your specific need.
we continue to learn and explore new tools everyday. good luck!
SuperBi just put this combo of some older scripts
so it has a volume indicator based on VPT can be control by length
supertrend with factor to control sensitivity
for each TF you need to find best settings for best results
i hope you like this version
in future if i have time i will try to put better scripts
Follow Line Trend SignalThis Script is a Trend Following system built over the concepts of normalising ATR over Bollinger Bands and Pivot points high low,
This Script Can be used over AnyTimeframe
and Can be treated as a stable alternative to Supertrend
Script has provisions for BUY and SELL Alerts
Enjoy!
Combo VIX and DXYHello traders
It's been a while :)
I wanted to share a cool script that you can use for any asset class.
The script isn't really special - though what it displays is super helpful
Volatility Index $VIX
(Source: Wikipedia)
VIX is the ticker symbol and the popular name for the Chicago Board Options Exchange's CBOE Volatility Index, a popular measure of the stock market's expectation of volatility based on S&P 500 index options.
It is calculated and disseminated on a real-time basis by the CBOE, and is often referred to as the fear index or fear gauge.
I consider that a $VIX above 30% is a very bearish signal.
Above 30% translating investors selling in masse their assets. #blood #on #the #street
Dollar Index $DXY
(Source: Wikipedia)
The U.S. Dollar Index (USDX, DXY, DX, or, informally, the "Dixie") is an index (or measure) of the value of the United States dollar relative to a basket of foreign currencies, often referred to as a basket of U.S. trade partners' currencies.
The Index goes up when the U.S. dollar gains "strength" (value) when compared to other currencies.
The index is designed, maintained, and published by ICE (Intercontinental Exchange, Inc.), with the name "U.S. Dollar Index" a registered trademark.
It is a weighted geometric mean of the dollar's value relative to following select currencies:
Euro (EUR), 57.6% weight
Japanese yen (JPY) 13.6% weight
Pound sterling (GBP), 11.9% weight
Canadian dollar (CAD), 9.1% weight
Swedish krona (SEK), 4.2% weight
Swiss franc (CHF) 3.6% weight
In "bear markets", the $DXY usually goes up.
People are selling their hard assets to get some $USD in return - pumping the $DXY higher
Corollary
I'm not sure which one happens first between a bearish $DXY or bearish $DXY... though both are usually correlated
If:
- $VIX goes above 30%, usually $DXY increases and assets versus the good old' $USD drop
- $VIX goes below 30%, usually $DXY decreases and assets versus the good old' $USD increases
This is a nice lever effect between both the $VIX, $DXY and the assets versus the $USD
That's being said, I don't only use those 2 information to enter in a trade.
It gives me though a strong confirmation whenever I'm long or short
Imagine I get a LONG signal but the combo $VIX + $DXY is bearish... this tells me to be cautious and to:
- enter at a pullback
- protect my position quickly at breakeven
- take my profit quick
For a mega bull market (some called it hyperinflation), you want your fiat to drop in value for the counter-asset to increase in value.
And before you ask.... yes I look at what $DXY is doing before taking a trade on $BTCUSD :)
In other words, $DXY going down is quite bullish for Bitcoin.
Settings and Alerts
The settings by default are the ones I use for my trading.
The background colors will be colored whenever the COMBO is bullish (green) or bearish (red)
Alerts are enabled using the brand new alert function published last week by @TradingView
That's it for today, I hope you'll like it :)
PS: In this chart above, I'm using the Supertrend indicator from @KivancOzbilgic
Dave